NewBuildWindow.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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() {
  27. super();
  28. this.settings = Atomic.UI_WINDOW_SETTINGS_DEFAULT & ~Atomic.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 = "New Build Detected";
  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. this.resizeToFitContent();
  37. this.center();
  38. }
  39. handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
  40. if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
  41. var id = ev.target.id;
  42. if (id == "cfi") {
  43. Atomic.fileSystem.systemOpen("http://www.atomicgameengine.com/funding/");
  44. }
  45. if (id == "ok") {
  46. this.hide();
  47. if (this.newBuildCheck.value) {
  48. Preferences.getInstance().editorBuildData.lastEditorBuildSHA = Atomic.AtomicBuildInfo.getGitSHA();
  49. Preferences.getInstance().write();
  50. }
  51. return true;
  52. }
  53. }
  54. }
  55. generateNewBuildText(): string {
  56. var text = "";
  57. // TODO: this needs to be externally generated
  58. text += `
  59. <color #D4FB79>Hello and thanks for installing a new build of the Atomic Editor!</color>
  60. <color #AAAAAA>(Git SHA: ${Atomic.AtomicBuildInfo.getGitSHA()})</color>
  61. <color #76D6FF>Latest Updates:</color>
  62. • Support for <color #D4FB79>Atomic C#</color> scripting on Windows, macOS, Linux, Android, and iOS
  63. • <color #D4FB79>Visual Studio</color> and <color #D4FB79>Xamarin Studio</color> integration (with VSCode support coming soon!)
  64. • Updated to TypeScript 2.0
  65. • Physically Based Rendering (PBR) - Thanks to @dragonCASTjosh
  66. • New examples and project templates
  67. • Revamped build targeting JavaScript, TypeScript, C#, and native C++
  68. • Updated to Urho3D 1.6 and SDL 2.0.4 with a great number of platform improvements
  69. • Updated to to Monaco VSCode editor 0.6
  70. • Bug fixes, improvements, and optimization
  71. `;
  72. return text;
  73. }
  74. newbuild_text: Atomic.UIEditField;
  75. newBuildCheck: Atomic.UICheckBox;
  76. }
  77. export = NewBuildWindow;