Browse Source

Merge pull request #1044 from AtomicGameEngine/JME-ATOMIC-FIXES

Installer fixes, better default player window position/size
JoshEngebretson 9 years ago
parent
commit
498e42fcc2

+ 7 - 4
Build/Scripts/Windows/Installer/AtomicEditor.nsi

@@ -62,10 +62,13 @@ InstallDirRegKey HKLM "Software\${coname}\InstallDir" "${prodname}"
 !insertmacro MUI_PAGE_DIRECTORY
 !insertmacro MUI_PAGE_INSTFILES
 	; These indented statements modify settings for MUI_PAGE_FINISH
-	!define MUI_FINISHPAGE_NOAUTOCLOSE
-	!define MUI_FINISHPAGE_RUN "$INSTDIR\${appexe}"
-	!define MUI_FINISHPAGE_RUN_CHECKED
-	!define MUI_FINISHPAGE_RUN_TEXT "Launch the Atomic Editor"
+	; The installer runs in elevated mode, NSIS doesn't have a  way
+	; without plugins to run the installed application in normal user mode
+	; so disabling launch checkbox, look into a MSI replacement
+	;!define MUI_FINISHPAGE_NOAUTOCLOSE
+	;!define MUI_FINISHPAGE_RUN "$INSTDIR\${appexe}"
+	;!define MUI_FINISHPAGE_RUN_CHECKED
+	;!define MUI_FINISHPAGE_RUN_TEXT "Launch the Atomic Editor"
 !insertmacro MUI_PAGE_FINISH
 
 !insertmacro MUI_UNPAGE_CONFIRM

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

@@ -1,6 +1,6 @@
 TBLayout: axis: y, distribution: gravity
     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
         font: size: 13
         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()) {
             this.sendEvent("IPCPlayerExitRequest");
         } else {
+
             var playerWindow = Preferences.getInstance().playerWindow;
+
             if (playerWindow) {
+
                 if ((playerWindow.monitor + 1) > Atomic.graphics.getNumMonitors()) {
                     //will use default settings if monitor is not available
                     var args = "--resizable";
                     Atomic.editorMode.playProject(args, debug);
+
                 } 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";
+
                     if (playerWindow.maximized) {
                         args += " --maximize";
                     }
+
                     Atomic.editorMode.playProject(args, debug);
                 }
+
             } else {
                 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
 
-• Bug fixed, improvements, and optimization
+• Bug fixes, improvements, and optimization
 `;
 
         return text;

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

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