From 034196ddd629988e60f6da4b3b0d9b566997df5a Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 17 Nov 2010 14:14:50 +1300 Subject: [PATCH] Build a list of parent mods before launching. --- OpenRA.Launcher.Mac/JSBridge.m | 29 ++++++++++++++++++++++------- mods/cnc/mod.html | 1 + 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/OpenRA.Launcher.Mac/JSBridge.m b/OpenRA.Launcher.Mac/JSBridge.m index d1ae80e43c..ebc9760c2c 100644 --- a/OpenRA.Launcher.Mac/JSBridge.m +++ b/OpenRA.Launcher.Mac/JSBridge.m @@ -61,14 +61,29 @@ static JSBridge *SharedInstance; - (BOOL)launchMod:(NSString *)aMod { - id mod = [[controller allMods] objectForKey:aMod]; - if (mod == nil) - { - NSLog(@"Invalid or unknown mod: %@", aMod); - return NO; - } + // Build the list of mods to launch + NSMutableArray *mods = [NSMutableArray array]; + NSString *current = aMod; - [controller launchMod:aMod]; + // Assemble the mods in the reverse order to work around an engine bug + while (current != nil) + { + Mod *mod = [[controller allMods] objectForKey:current]; + if (mod == nil) + { + NSLog(@"Unknown mod: %@", current); + return NO; + } + [mods addObject:current]; + + if ([mod standalone]) + current = nil; + else + current = [mod requires]; + } + // Todo: Reverse the array ordering once the engine bug is fixed + + [controller launchMod:[mods componentsJoinedByString:@","]]; return YES; } diff --git a/mods/cnc/mod.html b/mods/cnc/mod.html index 7de0b9f6d0..2e62d39527 100644 --- a/mods/cnc/mod.html +++ b/mods/cnc/mod.html @@ -79,6 +79,7 @@ .button:hover { background-color: #333; + cursor:pointer; }