diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index e675ed267d..6311862a97 100755 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -254,7 +254,7 @@ namespace OpenRA viewport = new Viewport(new int2(Renderer.Resolution), Rectangle.Empty, Renderer); modData.WidgetLoader.LoadWidget( new Dictionary(), Widget.RootWidget, "PERF_BG" ); - Widget.OpenWindow("MAINMENU_INIT"); + modData.WidgetLoader.LoadWidget( new Dictionary(), Widget.RootWidget, "MAINMENU_INIT" ); Game.orderManager.LastTickTime = Environment.TickCount; } diff --git a/OpenRA.Launcher.Mac/Controller.m b/OpenRA.Launcher.Mac/Controller.m index 579fdccbd4..7cdf231367 100644 --- a/OpenRA.Launcher.Mac/Controller.m +++ b/OpenRA.Launcher.Mac/Controller.m @@ -5,7 +5,7 @@ * as published by the Free Software Foundation. For more information, * see LICENSE. */ - +#import "main.h" #import "Controller.h" @implementation Controller @@ -43,13 +43,17 @@ [[NSApplication sharedApplication] terminate:self]; } - [self launchMod:@"cnc"]; + [self launchMod:@"ra"]; [NSApp terminate: nil]; } - (void)launchFilePicker:(NSArray *)args { + hide_menubar_if_necessary(); + [NSApp activateIgnoringOtherApps:YES]; + NSOpenPanel *op = [NSOpenPanel openPanel]; + [op setLevel:CGShieldingWindowLevel()]; [op setAllowsMultipleSelection:NO]; NSUInteger a = [args indexOfObject:@"--title"]; @@ -64,6 +68,18 @@ if (a != NSNotFound) [op setDirectory:[[args objectAtIndex:a+1] stringByExpandingTildeInPath]]; + a = [args indexOfObject:@"--require-directory"]; + if (a != NSNotFound) + { + [op setCanChooseFiles:NO]; + [op setCanChooseDirectories:YES]; + } + + a = [args indexOfObject:@"--button-text"]; + if (a != NSNotFound) + [op setPrompt:[[args objectAtIndex:a+1] stringByExpandingTildeInPath]]; + + if ([op runModal] == NSFileHandlingPanelOKButton) printf("%s\n", [[[op URL] path] UTF8String]); diff --git a/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj index 878f66cc8a..aa4ddbecbd 100644 --- a/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj +++ b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 8D1107310486CEB800E47090 /* OpenRA-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "OpenRA-Info.plist"; sourceTree = ""; }; 8D1107320486CEB800E47090 /* OpenRA.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRA.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DA134CC412E6F131009AA0EF /* main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = main.h; sourceTree = ""; }; DA81FA801290F5C800C48F2F /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = ""; }; DA81FA811290F5C800C48F2F /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = ""; }; DA81FBDB12910E4900C48F2F /* OpenRA.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = OpenRA.icns; sourceTree = ""; }; @@ -99,6 +100,7 @@ children = ( 256AC3F00F4B6AF500CF3369 /* OpenRA_Prefix.pch */, 29B97316FDCFA39411CA2CEA /* main.m */, + DA134CC412E6F131009AA0EF /* main.h */, ); name = "Other Sources"; sourceTree = ""; diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA index b52e320fca..39645a7b53 100755 Binary files a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA differ diff --git a/OpenRA.Launcher.Mac/main.m b/OpenRA.Launcher.Mac/main.m index f3b367a68e..01d439e54a 100644 --- a/OpenRA.Launcher.Mac/main.m +++ b/OpenRA.Launcher.Mac/main.m @@ -7,6 +7,7 @@ // #import +#import "main.h" extern char **environ; int main(int argc, char *argv[]) @@ -45,11 +46,8 @@ int main(int argc, char *argv[]) setenv("DYLD_LIBRARY_PATH", buf, 1); } - // Hide the menubar if we are running fullscreen - // TODO: HACK: Parse the settings.yaml / commandline args for fullscreen options - if (YES) - [NSMenu setMenuBarVisible:NO]; - + + hide_menubar_if_necessary(); /* Exec mono */ execve(args[0], args, environ); } @@ -57,3 +55,11 @@ int main(int argc, char *argv[]) /* Else, start the launcher */ return NSApplicationMain(argc, (const char **) argv); } + +// Hide the menubar and dock if we are running fullscreen +void hide_menubar_if_necessary() +{ + // TODO: HACK: Parse the settings.yaml / commandline args for fullscreen options + if (YES) + [NSMenu setMenuBarVisible:NO]; +} diff --git a/mods/ra/chrome/mainmenu.yaml b/mods/ra/chrome/mainmenu.yaml index dce60ada04..0e2c190310 100644 --- a/mods/ra/chrome/mainmenu.yaml +++ b/mods/ra/chrome/mainmenu.yaml @@ -7,15 +7,39 @@ Background@MAINMENU_INIT: Visible:true Delegate:RAInitDelegate Children: - Button@FINISH_INIT: - Id:FINISH_INIT + Label@MAINMENU_LABEL_TITLE: + Id:MAINMENU_LABEL_TITLE + X:0 + Y:20 + Width:250 + Height:25 + Text:Install Game Content + Align:Center + Bold:True + Button@INIT_DOWNLOAD: + Id:INIT_DOWNLOAD X:45 Y:70 Width:160 Height:25 - Text:START + Text:Download + Bold:True + Button@INIT_FROMCD: + Id:INIT_FROMCD + X:45 + Y:110 + Width:160 + Height:25 + Text:From CD + Bold:True + Button@INIT_QUIT: + Id:INIT_QUIT + X:45 + Y:150 + Width:160 + Height:25 + Text:Quit Bold:True - Background@MAINMENU_BG: Id:MAINMENU_BG X:(WINDOW_RIGHT - WIDTH)/2