About.ts 3.6 KB

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