Use window.external instead of Launcher in js for windows support. Tweak the OpenRA.Utility calls - still doesn't work 100%.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
[outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO];
|
||||
|
||||
jsbridge = [[JSBridge alloc] initWithController:self];
|
||||
[[webView windowScriptObject] setValue:jsbridge forKey:@"Launcher"];
|
||||
[[webView windowScriptObject] setValue:jsbridge forKey:@"external"];
|
||||
}
|
||||
|
||||
- (SidebarEntry *)sidebarModsTree
|
||||
|
||||
@@ -110,22 +110,20 @@
|
||||
|
||||
- (NSString *)runUtilityQuery:(NSString *)arg
|
||||
{
|
||||
NSTask *aTask = [[NSTask alloc] init];
|
||||
NSPipe *aPipe = [NSPipe pipe];
|
||||
NSFileHandle *readHandle = [aPipe fileHandleForReading];
|
||||
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
NSPipe *outPipe = [NSPipe pipe];
|
||||
NSMutableArray *taskArgs = [NSMutableArray arrayWithObject:@"OpenRA.Utility.exe"];
|
||||
[taskArgs addObject:arg];
|
||||
|
||||
[aTask setCurrentDirectoryPath:[gameURL absoluteString]];
|
||||
[aTask setLaunchPath:@"/Library/Frameworks/Mono.framework/Commands/mono"];
|
||||
[aTask setArguments:taskArgs];
|
||||
[aTask setStandardOutput:aPipe];
|
||||
[aTask setStandardError:[aTask standardOutput]];
|
||||
[aTask launch];
|
||||
NSData *data = [readHandle readDataToEndOfFile];
|
||||
[aTask release];
|
||||
|
||||
[task setCurrentDirectoryPath:[gameURL absoluteString]];
|
||||
[task setLaunchPath:@"/Library/Frameworks/Mono.framework/Commands/mono"];
|
||||
[task setArguments:taskArgs];
|
||||
[task setStandardOutput:outPipe];
|
||||
[task setStandardError:[task standardOutput]];
|
||||
[task launch];
|
||||
NSData *data = [[outPipe fileHandleForReading] readDataToEndOfFile];
|
||||
[task waitUntilExit];
|
||||
[task release];
|
||||
return [NSString stringWithUTF8String:[data bytes]];
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
- (void)launchCurrentMod
|
||||
{
|
||||
NSLog(@"launchcurrent");
|
||||
[controller launchGame];
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="buttons">
|
||||
<input type="button" class="button" onclick="Launcher.launchCurrentMod();" value="Play" />
|
||||
<input type="button" class="button" onclick="window.external.launchCurrentMod();" value="Play" />
|
||||
<input type="button" class="button" value="Install Music" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user