ProPlatformWindow.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. import EditorEvents = require("editor/EditorEvents");
  8. import EditorUI = require("ui/EditorUI");
  9. import ModalWindow = require("../ModalWindow");
  10. import ProgressModal = require("../ProgressModal");
  11. class ProPlatformWindow extends ModalWindow {
  12. constructor() {
  13. super(false);
  14. this.init("Platform License Required", "AtomicEditor/editor/ui/platformsinfo.tb.txt");
  15. var editField = <Atomic.UIEditField> this.getWidget("info");
  16. var text = "\nAtomic Game Engine Pro is required to deploy apps to this platform.\n\n<color #D4FB79>Installed platforms:</color>\n\n";
  17. var licenseSystem = ToolCore.licenseSystem;
  18. var installedText = " <widget TBSkinImage: skin: 'LogoMac-Small'> <widget TBSkinImage: skin: 'LogoWindows-Small'> <widget TBSkinImage: skin: 'LogoHTML5-Small'> ";
  19. var availableText = " ";
  20. if (licenseSystem.licenseAndroid)
  21. installedText += "<widget TBSkinImage: skin: 'LogoAndroid-Small'> ";
  22. else
  23. availableText += "<widget TBSkinImage: skin: 'LogoAndroid-Small'> ";
  24. if (licenseSystem.licenseIOS)
  25. installedText += "<widget TBSkinImage: skin: 'LogoIOS-Small'> ";
  26. else
  27. availableText += "<widget TBSkinImage: skin: 'LogoIOS-Small'> ";
  28. text += installedText + "\n\n\n";
  29. if (!licenseSystem.licenseIOS || !licenseSystem.licenseAndroid || !licenseSystem.licenseModule3D) {
  30. text += "<color #76D6FF>Available platforms:</color>\n\n";
  31. text += availableText + "\n\n\n";
  32. }
  33. editField.text = text;
  34. this.resizeToFitContent();
  35. this.center();
  36. editField.reformat();
  37. }
  38. handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
  39. if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
  40. var id = ev.target.id;
  41. if (id == 'purchase') {
  42. Atomic.fileSystem.systemOpen("https://store.atomicgameengine.com/site");
  43. } else if (id == "ok") {
  44. this.hide();
  45. return true;
  46. }
  47. return false;
  48. }
  49. }
  50. }
  51. export = ProPlatformWindow;