NewBuildWindow.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 Atomic Editor 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.getGitRevision();
  49. Preferences.getInstance().write();
  50. }
  51. return true;
  52. }
  53. }
  54. }
  55. generateNewBuildText(): string {
  56. var text = "";
  57. text += `<widget TBImageWidget: filename: 'AtomicEditor/editor/images/atomic_logo.png'>
  58. <color #D4FB79>Hello and thanks for installing a new build of the Atomic Editor!</color>
  59. A cross platform game engine targeting 6 platforms is a lot of work! We need to raise funds in order to continue developing features such as integrated debugging, C# scripting, editor workflow improvements, platform updates, and to address a growing list of issues. There are also other project expenses such as CI hardware, web site updates, hosting costs, etc.
  60. In addition to monetary funding, we need help reviewing pull requests, addressing open issues, providing support in chat, etc.
  61. <color #D4FB79>Thanks for your support!</color>
  62. <widget TBImageWidget: filename: 'AtomicEditor/editor/images/josh.jpg'> - Josh Engebretson on behalf of the Atomic Community
  63. `;
  64. return text;
  65. }
  66. newbuild_text: Atomic.UIEditField;
  67. newBuildCheck: Atomic.UICheckBox;
  68. }
  69. export = NewBuildWindow;