Set the game path to the launcher resource dir. Can be overwritten using the system defaults mechanism.

This commit is contained in:
Paul Chote
2010-11-25 21:39:28 +13:00
parent 9f21d944d1
commit a0741ba26b
3 changed files with 12 additions and 2 deletions

View File

@@ -18,9 +18,18 @@
@synthesize allMods;
@synthesize webView;
+ (void)initialize
{
[[NSUserDefaults standardUserDefaults]
registerDefaults:[NSDictionary dictionaryWithObject:[[NSBundle mainBundle] resourcePath]
forKey:@"gamepath"]];
}
- (void)awakeFromNib
{
game = [[GameInstall alloc] initWithURL:[NSURL URLWithString:@"/Users/paul/src/OpenRA"]];
NSString *gamePath = [[NSUserDefaults standardUserDefaults] stringForKey:@"gamepath"];
game = [[GameInstall alloc] initWithURL:[NSURL URLWithString:gamePath]];
[[JSBridge sharedInstance] setController:self];
downloads = [[NSMutableDictionary alloc] init];
hasMono = [self hasSupportedMono];