Use the launcher in osx packaged builds. Leopard support. Fix some wording. Remove old osx launcher project.
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
{
|
||||
NSString *gamePath = [[NSUserDefaults standardUserDefaults] stringForKey:@"gamepath"];
|
||||
|
||||
game = [[GameInstall alloc] initWithURL:[NSURL URLWithString:gamePath]];
|
||||
game = [[GameInstall alloc] initWithPath:gamePath];
|
||||
[[JSBridge sharedInstance] setController:self];
|
||||
downloads = [[NSMutableDictionary alloc] init];
|
||||
hasMono = [self hasSupportedMono];
|
||||
@@ -138,7 +138,8 @@
|
||||
id aMod = [allMods objectForKey:key];
|
||||
if ([aMod standalone])
|
||||
{
|
||||
id child = [SidebarEntry entryWithMod:aMod allMods:allMods baseURL:[[game gameURL] URLByAppendingPathComponent:@"mods"]];
|
||||
id path = [[game gamePath] stringByAppendingPathComponent:@"mods"];
|
||||
id child = [SidebarEntry entryWithMod:aMod allMods:allMods baseURL:[NSURL URLWithString:path]];
|
||||
[rootItem addChild:child];
|
||||
}
|
||||
}
|
||||
@@ -176,7 +177,7 @@
|
||||
}
|
||||
|
||||
#pragma mark Sidebar Datasource and Delegate
|
||||
- (int)outlineView:(NSOutlineView *)anOutlineView numberOfChildrenOfItem:(id)item
|
||||
- (NSInteger)outlineView:(NSOutlineView *)anOutlineView numberOfChildrenOfItem:(id)item
|
||||
{
|
||||
// Can be called before awakeFromNib; return nothing
|
||||
if (sidebarItems == nil)
|
||||
@@ -195,7 +196,7 @@
|
||||
}
|
||||
|
||||
- (id)outlineView:(NSOutlineView *)outlineView
|
||||
child:(int)index
|
||||
child:(NSInteger)index
|
||||
ofItem:(id)item
|
||||
{
|
||||
if (item == nil)
|
||||
@@ -271,10 +272,10 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
|
||||
|
||||
NSString *format = count == 1 ? @"1 download is" : [NSString stringWithFormat:@"%d downloads are",count];
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:@"Are you sure you want to quit?"
|
||||
defaultButton:@"Cancel"
|
||||
defaultButton:@"Wait"
|
||||
alternateButton:@"Quit"
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:@"%@ in progress and will be cancelled.", format];
|
||||
informativeTextWithFormat:@"%@ in progress and will be cancelled if you quit.", format];
|
||||
|
||||
[alert beginSheetModalForWindow:window modalDelegate:self didEndSelector:@selector(quitAlertEnded:code:context:) contextInfo:NULL];
|
||||
return NSTerminateLater;
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
@class Mod;
|
||||
@class Controller;
|
||||
@interface GameInstall : NSObject {
|
||||
NSURL *gameURL;
|
||||
NSString *gamePath;
|
||||
Controller *controller;
|
||||
NSMutableDictionary *downloadTasks;
|
||||
}
|
||||
@property(readonly) NSURL *gameURL;
|
||||
@property(readonly) NSString *gamePath;
|
||||
|
||||
-(id)initWithURL:(NSURL *)path;
|
||||
-(id)initWithPath:(NSString *)path;
|
||||
-(void)launchMod:(NSString *)mod;
|
||||
- (NSString *)runUtilityQuery:(NSString *)arg;
|
||||
- (NSArray *)installedMods;
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
#import "Mod.h"
|
||||
|
||||
@implementation GameInstall
|
||||
@synthesize gameURL;
|
||||
@synthesize gamePath;
|
||||
|
||||
-(id)initWithURL:(NSURL *)url
|
||||
-(id)initWithPath:(NSString *)path
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
gameURL = [url retain];
|
||||
gamePath = [path retain];
|
||||
downloadTasks = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
return self;
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[gameURL release]; gameURL = nil;
|
||||
[gamePath release]; gamePath = nil;
|
||||
[downloadTasks release]; downloadTasks = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
@@ -70,8 +70,8 @@
|
||||
// Commit prev mod
|
||||
if (current != nil)
|
||||
{
|
||||
id url = [gameURL URLByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]];
|
||||
[ret setObject:[Mod modWithId:current fields:fields baseURL:url] forKey:current];
|
||||
id path = [gamePath stringByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]];
|
||||
[ret setObject:[Mod modWithId:current fields:fields baseURL:[NSURL URLWithString:path]] forKey:current];
|
||||
}
|
||||
NSLog(@"Parsing mod %@",value);
|
||||
current = value;
|
||||
@@ -84,8 +84,8 @@
|
||||
}
|
||||
if (current != nil)
|
||||
{
|
||||
id url = [gameURL URLByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]];
|
||||
[ret setObject:[Mod modWithId:current fields:fields baseURL:url] forKey:current];
|
||||
id path = [gamePath stringByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]];
|
||||
[ret setObject:[Mod modWithId:current fields:fields baseURL:[NSURL URLWithString:path]] forKey:current];
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -99,7 +99,7 @@
|
||||
// First argument is the directory to run in
|
||||
// Second...Nth arguments are passed to OpenRA.Game.exe
|
||||
// Launcher wrapper sets mono --debug, gl renderer and support dir.
|
||||
NSArray *args = [NSArray arrayWithObjects:[gameURL absoluteString],
|
||||
NSArray *args = [NSArray arrayWithObjects:gamePath,
|
||||
[NSString stringWithFormat:@"Game.Mods=%@",mod],
|
||||
nil];
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
[taskArgs addObject:arg];
|
||||
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
[task setCurrentDirectoryPath:[gameURL absoluteString]];
|
||||
[task setCurrentDirectoryPath:gamePath];
|
||||
[task setLaunchPath:@"/Library/Frameworks/Mono.framework/Commands/mono"];
|
||||
[task setArguments:taskArgs];
|
||||
[task setStandardOutput:outPipe];
|
||||
@@ -155,7 +155,7 @@
|
||||
NSMutableArray *taskArgs = [NSMutableArray arrayWithObject:@"OpenRA.Utility.exe"];
|
||||
[taskArgs addObject:arg];
|
||||
|
||||
[task setCurrentDirectoryPath:[gameURL absoluteString]];
|
||||
[task setCurrentDirectoryPath:gamePath];
|
||||
[task setLaunchPath:@"/Library/Frameworks/Mono.framework/Commands/mono"];
|
||||
[task setArguments:taskArgs];
|
||||
[task setStandardOutput:pipe];
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
NSString *version;
|
||||
NSString *author;
|
||||
NSString *requires;
|
||||
NSString *description;
|
||||
BOOL standalone;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# as published by the Free Software Foundation. For more information,
|
||||
# see LICENSE.
|
||||
|
||||
export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH"
|
||||
echo "Launching OpenRA from $1"
|
||||
cd $1
|
||||
mono --debug OpenRA.Game.exe SupportDir=~/Library/"Application Support"/OpenRA ${@:2}
|
||||
@@ -21,6 +21,7 @@
|
||||
DA9292C81291DF2D00EDB02E /* OpenRA.app in Resources */ = {isa = PBXBuildFile; fileRef = DA9292C71291DF2D00EDB02E /* OpenRA.app */; };
|
||||
DA9295A712921DF900EDB02E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA9295A612921DF900EDB02E /* WebKit.framework */; };
|
||||
DA9296901292328200EDB02E /* SidebarEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = DA92968F1292328200EDB02E /* SidebarEntry.m */; };
|
||||
DAB887F5129E5D6C00C99407 /* SDL in Resources */ = {isa = PBXBuildFile; fileRef = DAB887EE129E5D6100C99407 /* SDL */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -50,6 +51,7 @@
|
||||
DA9295A612921DF900EDB02E /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
DA92968E1292328200EDB02E /* SidebarEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SidebarEntry.h; sourceTree = "<group>"; };
|
||||
DA92968F1292328200EDB02E /* SidebarEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SidebarEntry.m; sourceTree = "<group>"; };
|
||||
DAB887EE129E5D6100C99407 /* SDL */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = SDL; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -136,6 +138,7 @@
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DAB887EE129E5D6100C99407 /* SDL */,
|
||||
DA9292C71291DF2D00EDB02E /* OpenRA.app */,
|
||||
DA81FBDB12910E4900C48F2F /* OpenRA.icns */,
|
||||
8D1107310486CEB800E47090 /* OpenRA-Info.plist */,
|
||||
@@ -180,6 +183,9 @@
|
||||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
ORGANIZATIONNAME = OpenRA;
|
||||
};
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OpenRA" */;
|
||||
compatibilityVersion = "Xcode 3.1";
|
||||
developmentRegion = English;
|
||||
@@ -204,6 +210,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
DAB887F5129E5D6C00C99407 /* SDL in Resources */,
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
|
||||
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
|
||||
DA81FBDC12910E4900C48F2F /* OpenRA.icns in Resources */,
|
||||
@@ -264,6 +271,10 @@
|
||||
GCC_PREFIX_HEADER = OpenRA_Prefix.pch;
|
||||
INFOPLIST_FILE = "OpenRA-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
PRODUCT_NAME = OpenRA;
|
||||
};
|
||||
name = Debug;
|
||||
@@ -278,6 +289,10 @@
|
||||
GCC_PREFIX_HEADER = OpenRA_Prefix.pch;
|
||||
INFOPLIST_FILE = "OpenRA-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)\"",
|
||||
);
|
||||
PRODUCT_NAME = OpenRA;
|
||||
};
|
||||
name = Release;
|
||||
@@ -292,7 +307,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
SDKROOT = macosx10.5;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -303,8 +318,9 @@
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
SDKROOT = macosx10.5;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
BIN
OpenRA.Launcher.Mac/SDL
Executable file
BIN
OpenRA.Launcher.Mac/SDL
Executable file
Binary file not shown.
@@ -35,10 +35,8 @@
|
||||
// Temporary hack until mods define an icon
|
||||
NSString* imageName = [[NSBundle mainBundle] pathForResource:@"OpenRA" ofType:@"icns"];
|
||||
id icon = [[[NSImage alloc] initWithContentsOfFile:imageName] autorelease];
|
||||
id url = [[baseURL URLByAppendingPathComponent:[baseMod mod]]
|
||||
URLByAppendingPathComponent:@"mod.html"];
|
||||
|
||||
id ret = [SidebarEntry entryWithTitle:[baseMod title] url:url icon:icon];
|
||||
id path = [[[baseURL absoluteString] stringByAppendingPathComponent:[baseMod mod]] stringByAppendingPathComponent:@"mod.html"];
|
||||
id ret = [SidebarEntry entryWithTitle:[baseMod title] url:[NSURL URLWithString:path] icon:icon];
|
||||
|
||||
for (id key in allMods)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>OpenRA Launcher</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>OpenRA.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.open-ra.launcher</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>OpenRA Launcher</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.5</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA
Executable file
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA
Executable file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
APPL????
|
||||
Binary file not shown.
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/MainMenu.nib
generated
Normal file
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/MainMenu.nib
generated
Normal file
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>OpenRA</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>OpenRA.icns</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
# This file is part of OpenRA, which is free software. It is made
|
||||
# available to you under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation. For more information,
|
||||
# see LICENSE.
|
||||
|
||||
export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH"
|
||||
echo "Launching OpenRA from $1"
|
||||
cd $1
|
||||
mono --debug OpenRA.Game.exe SupportDir=~/Library/"Application Support"/OpenRA ${@:2}
|
||||
@@ -0,0 +1 @@
|
||||
../../../OpenRA.icns
|
||||
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.icns
Executable file
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.icns
Executable file
Binary file not shown.
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/SDL
Executable file
BIN
OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/SDL
Executable file
Binary file not shown.
Reference in New Issue
Block a user