Changeset View
Standalone View
binaries/data/mods/public/gui/loadgame/load.js
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | function selectionChanged() | ||||
setMapPreviewImage("savedInfoPreview", mapData.preview); | setMapPreviewImage("savedInfoPreview", mapData.preview); | ||||
Engine.GetGUIObjectByName("savedPlayers").caption = metadata.initAttributes.settings.PlayerData.length - 1; | Engine.GetGUIObjectByName("savedPlayers").caption = metadata.initAttributes.settings.PlayerData.length - 1; | ||||
Engine.GetGUIObjectByName("savedPlayedTime").caption = timeToString(metadata.gui.timeElapsed ? metadata.gui.timeElapsed : 0); | Engine.GetGUIObjectByName("savedPlayedTime").caption = timeToString(metadata.gui.timeElapsed ? metadata.gui.timeElapsed : 0); | ||||
Engine.GetGUIObjectByName("savedMapType").caption = translateMapType(metadata.initAttributes.mapType); | Engine.GetGUIObjectByName("savedMapType").caption = translateMapType(metadata.initAttributes.mapType); | ||||
Engine.GetGUIObjectByName("savedMapSize").caption = translateMapSize(metadata.initAttributes.settings.Size); | Engine.GetGUIObjectByName("savedMapSize").caption = translateMapSize(metadata.initAttributes.settings.Size); | ||||
Engine.GetGUIObjectByName("savedVictory").caption = translateVictoryCondition(metadata.initAttributes.settings.GameType); | Engine.GetGUIObjectByName("savedVictory").caption = translateVictoryCondition(metadata.initAttributes.settings.GameType); | ||||
let caption = sprintf(translate("Mods: %(mods)s"), { "mods": metadata.mods.join(translate(", ")) }); | let caption = sprintf(translate("Mods: %(mods)s"), { "mods": modsToString(metadata.mods) }); | ||||
elexis: This doesn't work properly anymore since there is a space missing after the comma that… | |||||
Not Done Inline Actions
Sure xD Imarok: > Also we should split the public mod into a 0ad mod and a pyrogenesis mod, can you add it to… | |||||
if (!hasSameMods(metadata, Engine.GetEngineInfo())) | if (!hasSameMods(metadata, Engine.GetEngineInfo())) | ||||
caption = coloredText(caption, "orange"); | caption = coloredText(caption, "orange"); | ||||
Engine.GetGUIObjectByName("savedMods").caption = caption; | Engine.GetGUIObjectByName("savedMods").caption = caption; | ||||
Engine.GetGUIObjectByName("savedPlayersNames").caption = formatPlayerInfo( | Engine.GetGUIObjectByName("savedPlayersNames").caption = formatPlayerInfo( | ||||
metadata.initAttributes.settings.PlayerData, | metadata.initAttributes.settings.PlayerData, | ||||
metadata.gui.states | metadata.gui.states | ||||
); | ); | ||||
Show All 11 Lines | function loadGame() | ||||
let sameEngineVersion = hasSameEngineVersion(metadata, engineInfo); | let sameEngineVersion = hasSameEngineVersion(metadata, engineInfo); | ||||
if (sameEngineVersion && sameMods) | if (sameEngineVersion && sameMods) | ||||
{ | { | ||||
reallyLoadGame(gameId); | reallyLoadGame(gameId); | ||||
return; | return; | ||||
} | } | ||||
// Version not compatible ... ask for confirmation | // Version not compatible ... ask for confirmation | ||||
let message = translate("This saved game may not be compatible:"); | let message = translate("This saved game may not be compatible:"); | ||||
elexisUnsubmitted Done Inline ActionsThere's at least a newline missing here, but the string seems pointless / redundant with the stings following that. elexis: There's at least a newline missing here, but the string seems pointless / redundant with the… | |||||
ImarokAuthorUnsubmitted Not Done Inline ActionsMakes sense when both occurs (wrong engine version and wrong mods. Imarok: Makes sense when both occurs (wrong engine version and wrong mods. | |||||
elexisUnsubmitted Not Done Inline ActionsStill don't see the sense as all three following strings imply the string above. elexis: Still don't see the sense as all three following strings imply the string above. | |||||
Not Done Inline ActionsIt wouldn't hurt to define the variable we reference below. elexis: It wouldn't hurt to define the variable we reference below. | |||||
Not Done Inline ActionsWhat do you mean? Imarok: What do you mean? | |||||
Not Done Inline ActionsI think I got it .\ Imarok: I think I got it .\ | |||||
if (!sameEngineVersion) | if (!sameEngineVersion) | ||||
if (metadata.engine_version) | if (metadata.engine_version) | ||||
message += "\n" + sprintf(translate("It needs 0 A.D. version %(requiredVersion)s, while you are running version %(currentVersion)s."), { | message += "\n" + sprintf(translate("It needs 0 A.D. version %(requiredVersion)s, while you are running version %(currentVersion)s."), { | ||||
"requiredVersion": metadata.engine_version, | "requiredVersion": metadata.engine_version, | ||||
"currentVersion": engineInfo.engine_version | "currentVersion": engineInfo.engine_version | ||||
}); | }); | ||||
else | else | ||||
message += "\n" + translate("It needs an older version of 0 A.D."); | message += "\n" + translate("It needs an older version of 0 A.D."); | ||||
Not Done Inline ActionsI wonder if we shouldn't kill this string now. Do we care about people with that old savegame versions? elexis: I wonder if we shouldn't kill this string now. Do we care about people with that old savegame… | |||||
Not Done Inline ActionsI think explicitly warning the cause shouldn't hurt. Imarok: I think explicitly warning the cause shouldn't hurt. | |||||
if (!sameMods) | if (!sameMods) | ||||
{ | { | ||||
if (!metadata.mods) | if (!metadata.mods) | ||||
metadata.mods = []; | metadata.mods = []; | ||||
message += translate("The savegame needs a different set of mods:") + "\n" + | message += translate("The savegame needs a different set of mods:") + "\n" + | ||||
elexisUnsubmitted Done Inline Actionssince the order matters, set is wrong. Sequence? elexis: since the order matters, `set` is wrong. Sequence? | |||||
sprintf(translate("Required: %(mods)s"), { | comparedModsString(metadata.mods, engineInfo.mods); | ||||
elexisUnsubmitted Done Inline ActionsSeems more readable with a blank line before and after the mod list, but I suspect the message box doesn't autoresize. (Also the left-alignment would fit better for the modlist) elexis: Seems more readable with a blank line before and after the mod list, but I suspect the message… | |||||
"mods": metadata.mods.join(translate(", ")) | |||||
}) + "\n" + | |||||
sprintf(translate("Active: %(mods)s"), { | |||||
"mods": engineInfo.mods.join(translate(", ")) | |||||
}); | |||||
} | } | ||||
message += "\n" + translate("Do you still want to proceed?"); | message += "\n" + translate("Do you still want to proceed?"); | ||||
Done Inline ActionsThe question is ok if there are different mods, since some of them might not change the simstate, but for the engine version we might not ask this. Anyway out of scope. elexis: The question is ok if there are different mods, since some of them might not change the… | |||||
messageBox( | messageBox( | ||||
500, 250, | 500, 250, | ||||
message, | message, | ||||
translate("Warning"), | translate("Warning"), | ||||
[translate("No"), translate("Yes")], | [translate("No"), translate("Yes")], | ||||
[init, function(){ reallyLoadGame(gameId); }] | [init, function(){ reallyLoadGame(gameId); }] | ||||
); | ); | ||||
Show All 28 Lines |
This doesn't work properly anymore since there is a space missing after the comma that separates the mod version from the mod name.
Also that occulted comma should be translated.
Even better would be more than only translating the comma between the mod name and mod version, maybe "Mod Name (Mod Version)".join(", "), or even join with newline.
Also we should split the public mod into a 0ad mod and a pyrogenesis mod, can you add it to this patch?