Sfoglia il codice sorgente

Merge pull request #1025 from AtomicGameEngine/JME-ATOMICNET-WORK

A couple minor updates for #1023
JoshEngebretson 9 anni fa
parent
commit
6b28492630

+ 11 - 0
Source/ThirdParty/nativefiledialog/nfd_cocoa.mm

@@ -131,6 +131,7 @@ nfdresult_t NFD_OpenDialog( const char *filterList,
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     
+    NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
     NSOpenPanel *dialog = [NSOpenPanel openPanel];
     [dialog setAllowsMultipleSelection:NO];
 
@@ -158,6 +159,8 @@ nfdresult_t NFD_OpenDialog( const char *filterList,
         memcpy( *outPath, utf8Path, len+1 ); /* copy null term */
         nfdResult = NFD_OKAY;
     }
+
+    [keyWindow makeKeyAndOrderFront:nil];
     [pool release];
 
     return nfdResult;
@@ -170,6 +173,7 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     
+    NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
     NSOpenPanel *dialog = [NSOpenPanel openPanel];
     [dialog setAllowsMultipleSelection:YES];    
 
@@ -198,6 +202,8 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
 
         nfdResult = NFD_OKAY;
     }
+
+    [keyWindow makeKeyAndOrderFront:nil];
     [pool release];
 
     return nfdResult;
@@ -211,6 +217,7 @@ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
+    NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
     NSSavePanel *dialog = [NSSavePanel savePanel];
     [dialog setExtensionHidden:NO];
     [dialog setCanCreateDirectories:YES];
@@ -239,6 +246,7 @@ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
         nfdResult = NFD_OKAY;
     }
 
+    [keyWindow makeKeyAndOrderFront:nil];
     [pool release];
 
     return nfdResult;
@@ -249,6 +257,7 @@ nfdresult_t NFD_ChooseDirectory(const nfdchar_t *prompt, const nfdchar_t *defaul
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
+    NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
     NSOpenPanel *dialog = [NSOpenPanel openPanel];
     [dialog setAllowsMultipleSelection:NO];
     [dialog setCanChooseDirectories:YES];
@@ -277,6 +286,8 @@ nfdresult_t NFD_ChooseDirectory(const nfdchar_t *prompt, const nfdchar_t *defaul
         memcpy( *outPath, utf8Path, len+1 ); /* copy null term */
         nfdResult = NFD_OKAY;
     }
+
+    [keyWindow makeKeyAndOrderFront:nil];
     [pool release];
 
     return nfdResult;

+ 17 - 1
Source/ToolCore/NETTools/NETProjectGen.cpp

@@ -836,7 +836,23 @@ namespace ToolCore
 
         // OutputType
         XMLElement outputType = pgroup.CreateChild("OutputType");
-        outputType.SetValue(outputType_);
+
+		String oType = outputType_;
+
+#ifdef ATOMIC_PLATFORM_WINDOWS
+#ifndef ATOMIC_DEBUG
+
+		if (oType.ToLower() == "exe") 
+		{
+			// use windows subsystem for release builds
+			// TODO: make this an option in the json?
+			oType = "WinExe";
+		}
+
+#endif
+#endif
+
+        outputType.SetValue(oType);
 
         pgroup.CreateChild("AppDesignerFolder").SetValue("Properties");