About.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 EditorUI = require("../EditorUI");
  8. import ModalWindow = require("./ModalWindow");
  9. class About extends ModalWindow {
  10. constructor() {
  11. super();
  12. // we're not calling this.init here as it calls resizeToFitContent
  13. // and center, which screw up the generated About text being resized
  14. this.text = "About the Atomic Game Engine";
  15. this.load("AtomicEditor/editor/ui/about.tb.txt");
  16. this.age_license = <Atomic.UIEditField>this.getWidget("age_license");
  17. this.age_runtimelicense = <Atomic.UIEditField> this.getWidget("age_runtime_license");
  18. this.thirdparty_license = <Atomic.UIEditField>this.getWidget("thirdparty_license");
  19. this.externaltool_license = <Atomic.UIEditField>this.getWidget("externaltool_license");
  20. this.about_text = <Atomic.UIEditField>this.getWidget("about_text");
  21. var cache = Atomic.cache;
  22. var file = cache.getFile("AtomicEditor/eulas/atomic_game_engine_eula.txt");
  23. this.age_license.text = file.readText();
  24. var file = cache.getFile("AtomicEditor/eulas/atomic_runtime_eula.txt");
  25. this.age_runtimelicense.text = file.readText();
  26. file = cache.getFile("AtomicEditor/eulas/atomic_thirdparty_eula.txt");
  27. this.thirdparty_license.text = file.readText();
  28. file = cache.getFile("AtomicEditor/eulas/atomic_external_tools_eula.txt");
  29. this.externaltool_license.text = file.readText();
  30. this.about_text.text = this.generateAboutText();
  31. var get_pro = <Atomic.UIButton>this.getWidget("purchase_pro");
  32. if (get_pro) {
  33. get_pro.onClick = function() {
  34. Atomic.fileSystem.systemOpen("https://store.atomicgameengine.com/site");
  35. }
  36. }
  37. this.resizeToFitContent();
  38. this.center();
  39. this.getWidget("tabcontainer").value = 0;
  40. }
  41. handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
  42. if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
  43. var id = ev.target.id;
  44. if (id == "ok") {
  45. this.hide();
  46. return true;
  47. }
  48. }
  49. }
  50. generateAboutText(): string {
  51. var text = "";
  52. text += "<widget TBImageWidget: filename: 'AtomicEditor/editor/images/atomic_logo.png'>\n\n";
  53. text += "<color #D4FB79>Version 0.1.p0</color>\n\n";
  54. text += "(c) 2014-2015 THUNDERBEAST GAMES LLC\n\n\n";
  55. text += "<color #D4FB79>Installed platforms and modules:</color>\n\n";
  56. var licenseSystem = ToolCore.licenseSystem;
  57. var installedText = " <widget TBSkinImage: skin: 'LogoMac-Small'> <widget TBSkinImage: skin: 'LogoWindows-Small'> <widget TBSkinImage: skin: 'LogoHTML5-Small'> ";
  58. var availableText = " ";
  59. if (licenseSystem.licenseAndroid)
  60. installedText += "<widget TBSkinImage: skin: 'LogoAndroid-Small'> ";
  61. else
  62. availableText += "<widget TBSkinImage: skin: 'LogoAndroid-Small'> ";
  63. if (licenseSystem.licenseIOS)
  64. installedText += "<widget TBSkinImage: skin: 'LogoIOS-Small'> ";
  65. else
  66. availableText += "<widget TBSkinImage: skin: 'LogoIOS-Small'> ";
  67. installedText += "<widget TBSkinImage: skin: 'Module2D-Small'> ";
  68. if (licenseSystem.licenseModule3D)
  69. installedText += "<widget TBSkinImage: skin: 'Module3D-Small'> ";
  70. else
  71. availableText += "<widget TBSkinImage: skin: 'Module3D-Small'> ";
  72. text += installedText + "\n\n\n";
  73. if (!licenseSystem.licenseIOS || !licenseSystem.licenseAndroid || !licenseSystem.licenseModule3D) {
  74. text += "<color #76D6FF>Available platforms and modules:</color>\n\n";
  75. text += availableText + "\n\n\n";
  76. }
  77. text += "<color #76D6FF>Special Thanks:</color>\n\n";
  78. text += " The Urho3D Project - http://urho3d.github.io\n\n";
  79. text += " Sami Vaarala - http://www.duktape.org";
  80. return text;
  81. }
  82. age_license: Atomic.UIEditField;
  83. age_runtimelicense: Atomic.UIEditField;
  84. thirdparty_license: Atomic.UIEditField;
  85. externaltool_license: Atomic.UIEditField;
  86. about_text: Atomic.UIEditField;
  87. }
  88. export = About;