diff --git a/OpenRA.Launcher.Mac/JSBridge.m b/OpenRA.Launcher.Mac/JSBridge.m index ffe57b9c0f..552268113b 100644 --- a/OpenRA.Launcher.Mac/JSBridge.m +++ b/OpenRA.Launcher.Mac/JSBridge.m @@ -43,6 +43,7 @@ static JSBridge *SharedInstance; @"launchMod", NSStringFromSelector(@selector(launchMod:)), @"log", NSStringFromSelector(@selector(log:)), @"existsInMod", NSStringFromSelector(@selector(fileExists:inMod:)), + @"metadata", NSStringFromSelector(@selector(metadata:forMod:)), // File downloading @"registerDownload", NSStringFromSelector(@selector(registerDownload:withURL:filename:)), @@ -215,4 +216,20 @@ static JSBridge *SharedInstance; return [[NSFileManager defaultManager] fileExistsAtPath:path]; } +- (NSString *)metadata:(NSString *)aField forMod:(NSString *)aMod +{ + id mod = [[controller allMods] objectForKey:aMod]; + if (mod == nil) + { + NSLog(@"Invalid or unknown mod: %@", aMod); + return @""; + } + + if ([aField isEqualToString:@"VERSION"]) + return [mod version]; + + NSLog(@"Invalid or unknown field: %@", aField); + return @""; +} + @end diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA index afccd909cf..5540a8c82d 100755 Binary files a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA differ diff --git a/mods/cnc/mod.html b/mods/cnc/mod.html index 88d58c4f30..01c6c750d5 100644 --- a/mods/cnc/mod.html +++ b/mods/cnc/mod.html @@ -125,6 +125,7 @@ function onLoad() { refreshSections(); + document.getElementById("versionstring").innerHTML = window.external.metadata("VERSION", "cnc"); } function refreshSections() @@ -211,6 +212,7 @@
diff --git a/mods/ra/mod.html b/mods/ra/mod.html index 625580e7a2..910f510864 100644 --- a/mods/ra/mod.html +++ b/mods/ra/mod.html @@ -125,6 +125,7 @@ function onLoad() { refreshSections(); + document.getElementById("versionstring").innerHTML = window.external.metadata("VERSION", "ra"); } function refreshSections() @@ -211,6 +212,7 @@