Browse Source

Better default player window size/position, fix scaling issue on New Build window, fix typo

Josh Engebretson 9 years ago
parent
commit
77f736b736

+ 1 - 1
Resources/EditorData/AtomicEditor/editor/ui/newbuildwindow.tb.txt

@@ -1,6 +1,6 @@
 TBLayout: axis: y, distribution: gravity
 TBLayout: axis: y, distribution: gravity
     TBImageWidget: filename: "AtomicEditor/editor/images/newbuilddetected_header.jpg"
     TBImageWidget: filename: "AtomicEditor/editor/images/newbuilddetected_header.jpg"
-        lp: width: 500, height: 167, min-width: 500, min-height: 167
+        lp: width: 512, height: 167, min-width: 512, min-height: 167
     TBEditField: multiline: 1, styling: 1, gravity: all, id: newbuild_text, readonly: 1, adapt-to-content: 0
     TBEditField: multiline: 1, styling: 1, gravity: all, id: newbuild_text, readonly: 1, adapt-to-content: 0
         font: size: 13
         font: size: 13
         lp: min-width: 480, min-height: 274
         lp: min-width: 480, min-height: 274

+ 26 - 0
Script/AtomicEditor/ui/Shortcuts.ts

@@ -43,19 +43,45 @@ class Shortcuts extends Atomic.ScriptObject {
         if (Atomic.editorMode.isPlayerEnabled()) {
         if (Atomic.editorMode.isPlayerEnabled()) {
             this.sendEvent("IPCPlayerExitRequest");
             this.sendEvent("IPCPlayerExitRequest");
         } else {
         } else {
+
             var playerWindow = Preferences.getInstance().playerWindow;
             var playerWindow = Preferences.getInstance().playerWindow;
+
             if (playerWindow) {
             if (playerWindow) {
+
                 if ((playerWindow.monitor + 1) > Atomic.graphics.getNumMonitors()) {
                 if ((playerWindow.monitor + 1) > Atomic.graphics.getNumMonitors()) {
                     //will use default settings if monitor is not available
                     //will use default settings if monitor is not available
                     var args = "--resizable";
                     var args = "--resizable";
                     Atomic.editorMode.playProject(args, debug);
                     Atomic.editorMode.playProject(args, debug);
+
                 } else {
                 } else {
+
+                    if (playerWindow.width == 0 || playerWindow.height == 0) {
+
+                        playerWindow.width = Atomic.graphics.width * .75;
+                        // 16:9
+                        playerWindow.height = playerWindow.width * .56;
+
+                        let pos = Atomic.graphics.windowPosition;
+
+                        playerWindow.x = pos[0] + (Atomic.graphics.width/2 - playerWindow.width/2);
+                        playerWindow.y = pos[1] + (Atomic.graphics.height/2 - playerWindow.height/2);
+
+                        // if too small a window, use default (which maximizes)
+                        if (playerWindow.width < 480) {
+                            playerWindow.width = playerWindow.height = playerWindow.x = playerWindow.y = 0;
+                        }
+
+                    }
+
                     var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable" + " --fromEditorPlay";
                     var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable" + " --fromEditorPlay";
+
                     if (playerWindow.maximized) {
                     if (playerWindow.maximized) {
                         args += " --maximize";
                         args += " --maximize";
                     }
                     }
+
                     Atomic.editorMode.playProject(args, debug);
                     Atomic.editorMode.playProject(args, debug);
                 }
                 }
+
             } else {
             } else {
                 Atomic.editorMode.playProject("", debug);
                 Atomic.editorMode.playProject("", debug);
             }
             }

+ 1 - 1
Script/AtomicEditor/ui/modal/info/NewBuildWindow.ts

@@ -102,7 +102,7 @@ class NewBuildWindow extends ModalWindow {
 
 
 • Updated to to Monaco VSCode editor 0.6
 • Updated to to Monaco VSCode editor 0.6
 
 
-• Bug fixed, improvements, and optimization
+• Bug fixes, improvements, and optimization
 `;
 `;
 
 
         return text;
         return text;

+ 0 - 1
Source/AtomicEditor/Application/AEEditorPrefs.cpp

@@ -77,7 +77,6 @@ namespace AtomicEditor
 
 
     bool AEEditorPrefs::ReadPreferences(VariantMap& engineParameters)
     bool AEEditorPrefs::ReadPreferences(VariantMap& engineParameters)
     {
     {
-        FileSystem* fileSystem = GetSubsystem<FileSystem>();
         String path = GetPreferencesPath();
         String path = GetPreferencesPath();
 
 
         JSONValue prefs;
         JSONValue prefs;