Browse Source

Adding VS/XS/Code info box

Josh Engebretson 9 years ago
parent
commit
769baf82e3

BIN
Resources/EditorData/AtomicEditor/editor/images/atomicnet_info_header.png


+ 14 - 0
Resources/EditorData/AtomicEditor/editor/ui/atomicnetwindow.tb.txt

@@ -0,0 +1,14 @@
+TBLayout: axis: y, distribution: gravity
+    TBImageWidget: filename: "AtomicEditor/editor/images/atomicnet_info_header.png"
+        lp: width: 500, height: 167, min-width: 500, min-height: 167
+    TBEditField: multiline: 1, styling: 1, gravity: all, id: atomicnet_text, readonly: 1, adapt-to-content: 0
+        font: size: 13
+        lp: min-width: 480, min-height: 140
+        text: "..."
+    TBSeparator: gravity: left right, skin: AESeparator
+    TBLayout:
+        TBButton: text: "...", id: download_button, skin: TBButton.greentext
+            font: size: 16
+            lp: min-width: 128, min-height: 64
+        TBButton: text: Ok, id: ok
+            lp: min-width: 64, min-height: 64

+ 11 - 0
Script/AtomicEditor/ui/modal/ModalOps.ts

@@ -43,6 +43,7 @@ import ExtensionWindow = require("./ExtensionWindow");
 
 import ProjectTemplates = require("../../resources/ProjectTemplates");
 
+import AtomicNETWindow = require("./info/AtomicNETWindow");
 
 class ModalOps extends Atomic.ScriptObject {
 
@@ -236,6 +237,16 @@ class ModalOps extends Atomic.ScriptObject {
 
     }
 
+    showAtomicNETWindow() {
+
+        if (this.show()) {
+
+            this.opWindow = new AtomicNETWindow();
+
+        }
+
+    }
+
     // TODO: standardize  to same pattern as other modal windows
     showError(windowText: string, message: string) {
         var view = EditorUI.getView();

+ 105 - 0
Script/AtomicEditor/ui/modal/info/AtomicNETWindow.ts

@@ -0,0 +1,105 @@
+//
+// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+import EditorUI = require("../../EditorUI");
+import ModalWindow = require("../ModalWindow");
+
+class AtomicNETWindow extends ModalWindow {
+
+    constructor() {
+
+        super();
+
+        this.settings = Atomic.UI_WINDOW_SETTINGS_DEFAULT & ~Atomic.UI_WINDOW_SETTINGS_CLOSE_BUTTON;
+
+        // we're not calling this.init here as it calls resizeToFitContent
+        // and center, which screw up the generated About text being resized
+
+        this.text = "Atomic C# Requirements";
+        this.load("AtomicEditor/editor/ui/atomicnetwindow.tb.txt");
+
+        this.downloadButton = <Atomic.UIButton>this.getWidget("download_button");
+
+        this.atomicnet_text = <Atomic.UIEditField>this.getWidget("atomicnet_text");
+        this.atomicnet_text.text = this.generateAtomicNETText();
+
+        this.resizeToFitContent();
+        this.center();
+
+    }
+
+    handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
+
+        if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
+
+            var id = ev.target.id;
+
+            if (id == "ok") {
+
+                this.hide();
+
+                return true;
+            }
+
+            if (id == "download_button") {
+
+                this.hide();
+
+                Atomic.fileSystem.systemOpen(Atomic.platform == "Windows" ?
+                "https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx" :
+                "https://www.xamarin.com/download");
+
+            }
+        }
+    }
+
+
+    generateAtomicNETText(): string {
+
+        var installText:string;
+
+        var ideText:string = Atomic.platform == "Windows" ? "Visual Studio" : "Xamarin Studio";
+
+        var installText = `Please install ${ideText} with <color #D4FB79>Xamarin.Android</color> and <color #D4FB79>Xamarin.iOS</color>`;
+
+        this.downloadButton.text = `Download ${ideText}`;
+
+        var text = "";
+
+        text += `
+Atomic C# is integrated with <color #D4FB79>Visual Studio</color> and <color #D4FB79>Xamarin Studio</color> to provide a first class editing, debugging, and deployment experience.
+
+${installText}
+
+<color #76D6FF>Visual Studio Code support is also coming soon!</color>
+
+`;
+
+        return text;
+
+    }
+
+    atomicnet_text: Atomic.UIEditField;
+    downloadButton: Atomic.UIButton;
+}
+
+export = AtomicNETWindow;

+ 1 - 0
Script/tsconfig.json

@@ -82,6 +82,7 @@
         "./AtomicEditor/ui/modal/build/platforms/WindowsSettingsWidget.ts",
         "./AtomicEditor/ui/modal/CreateProject.ts",
         "./AtomicEditor/ui/modal/ExtensionWindow.ts",
+        "./AtomicEditor/ui/modal/info/AtomicNETWindow.ts",
         "./AtomicEditor/ui/modal/license/EULAWindow.ts",
         "./AtomicEditor/ui/modal/license/NewBuildWindow.ts",
         "./AtomicEditor/ui/modal/MessageModal.ts",