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