Build a list of parent mods before launching.
This commit is contained in:
@@ -61,14 +61,29 @@ static JSBridge *SharedInstance;
|
|||||||
|
|
||||||
- (BOOL)launchMod:(NSString *)aMod
|
- (BOOL)launchMod:(NSString *)aMod
|
||||||
{
|
{
|
||||||
id mod = [[controller allMods] objectForKey:aMod];
|
// Build the list of mods to launch
|
||||||
if (mod == nil)
|
NSMutableArray *mods = [NSMutableArray array];
|
||||||
{
|
NSString *current = aMod;
|
||||||
NSLog(@"Invalid or unknown mod: %@", aMod);
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
[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;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
.button:hover
|
.button:hover
|
||||||
{
|
{
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user