NewBuildWindow.ts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. //
  2. // Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. import EditorUI = require("../../EditorUI");
  23. import ModalWindow = require("../ModalWindow");
  24. import Preferences = require("editor/Preferences");
  25. class NewBuildWindow extends ModalWindow {
  26. constructor(showCheck:boolean = true) {
  27. super();
  28. this.settings = Atomic.UI_WINDOW_SETTINGS.UI_WINDOW_SETTINGS_DEFAULT & ~Atomic.UI_WINDOW_SETTINGS.UI_WINDOW_SETTINGS_CLOSE_BUTTON;
  29. // we're not calling this.init here as it calls resizeToFitContent
  30. // and center, which screw up the generated About text being resized
  31. this.text = showCheck ? "New Build Detected" : "Latest Updates";
  32. this.load("AtomicEditor/editor/ui/newbuildwindow.tb.txt");
  33. this.newbuild_text = <Atomic.UIEditField>this.getWidget("newbuild_text");
  34. this.newbuild_text.text = this.generateNewBuildText();
  35. this.newBuildCheck = <Atomic.UICheckBox> this.getWidget("newbuild_check");
  36. if (!showCheck) {
  37. this.getWidget("newbuild_check_text").visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
  38. this.newBuildCheck.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
  39. }
  40. this.resizeToFitContent();
  41. this.center();
  42. }
  43. handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
  44. if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK) {
  45. var id = ev.target.id;
  46. if (id == "cfi") {
  47. Atomic.fileSystem.systemOpen("http://www.atomicgameengine.com/funding/");
  48. }
  49. if (id == "ok") {
  50. this.hide();
  51. if (this.newBuildCheck.value) {
  52. Preferences.getInstance().editorBuildData.lastEditorBuildSHA = Atomic.AtomicBuildInfo.getGitSHA();
  53. Preferences.getInstance().write();
  54. }
  55. return true;
  56. }
  57. }
  58. }
  59. generateNewBuildText(): string {
  60. var text = "";
  61. // TODO: this needs to be externally generated
  62. text += `
  63. <color #D4FB79>Hello and thanks for installing a new build of the Atomic Editor!</color>
  64. Atomic Build 2 - <color #AAAAAA>(Git SHA: ${Atomic.AtomicBuildInfo.getGitSHA()})</color>
  65. <color #D4FB79>Closed Issues</color>
  66. <widget TBButton: text: 'https://github.com/AtomicGameEngine/AtomicGameEngine/milestone/1' url: 'https://github.com/AtomicGameEngine/AtomicGameEngine/milestone/1?closed=1' skin: TBButton.link>
  67. <color #D4FB79>Update Highlights</color>
  68. • <color #D4FB79>[Editor]</color> Custom file resource inspector plugins (with example)
  69. • <color #D4FB79>[Editor]</color> Added TmxFile2D resource type for inspector fields
  70. • <color #D4FB79>[Docs]</color> Added new C#, C++, and updated JavaScript/TypeScript API references
  71. • <color #D4FB79>[Network]</color> Restored functionality for master server and client
  72. • <color #D4FB79>[Web]</color> Added Web subsystem events and convenience methods for post data and responses
  73. • <color #D4FB79>[C#]</color> Output dev project assemblies to Lib, so when modifying AtomicNET sources, changes are used properly
  74. • <color #D4FB79>[C#]</color> CSComponent cleanups for instantiation from script/serialized from scene (also cleans up nativeOverride hack)
  75. • <color #D4FB79>[C#]</color> Fix for exception when instantiating any RefCounted derived instance during a CSComponent default constructor
  76. • <color #D4FB79>[C#]</color> Better error reporting for CSComponent load issues
  77. • <color #D4FB79>[C#]</color> Added Material.SetShaderParameter API
  78. • <color #D4FB79>[C#]</color> Added Vector4/String to ScriptVariant
  79. • <color #D4FB79>[C#]</color> On demand project assembly compilation from within the Atomic Editor
  80. • <color #D4FB79>[C#]</color> Inspector attribute can now be used to set inspector tooltips
  81. • <color #D4FB79>[TypeScript]</color> Upgraded to TypeScript 2.1
  82. • <color #D4FB79>[TypeScript]</color> Removed deprecated allowNonTsExtensions
  83. • <color #D4FB79>[TypeScript]</color> Automatically generate a tasks.json for VSCode
  84. • <color #D4FB79>[TypeScript]</color> Updated tsconfig with rootUrl properly for non-relative imports
  85. • <color #D4FB79>[TypeScript]</color> Strongly typed native event interfaces and subscription
  86. • <color #D4FB79>[Examples]</color> Fixed exception with virtual dpad in JavaScript examples
  87. • <color #D4FB79>[Desktop]</color> Fixed issues with engine configuration json parsing in deployed applications
  88. • <color #D4FB79>[Windows]</color> Fixed issue with Visual Studio 2017 detection
  89. • <color #D4FB79>[Windows]</color> Fixed UI pixel offset issue when rendering with OpenGL
  90. • <color #D4FB79>[macOS]</color> Added NSHighResolutionCapable flag to Atomic Editor
  91. • <color #D4FB79>[General]</color> Updated About dialog with contributor and build vendor information
  92. • <color #D4FB79>[General]</color> Misc bug fixes and optimizations
  93. • <color #D4FB79>[Maintenance]</color> Removed CurlManager from ToolCore as duplicated Web subsystem
  94. `;
  95. return text;
  96. }
  97. newbuild_text: Atomic.UIEditField;
  98. newBuildCheck: Atomic.UICheckBox;
  99. }
  100. export = NewBuildWindow;