Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/replaymenu/replay_menu.js
Show First 20 Lines • Show All 265 Lines • ▼ Show 20 Lines | function displayReplayDetails() | ||||
let replay = g_ReplaysFiltered[selected]; | let replay = g_ReplaysFiltered[selected]; | ||||
Engine.GetGUIObjectByName("sgMapName").caption = translate(replay.attribs.settings.Name); | Engine.GetGUIObjectByName("sgMapName").caption = translate(replay.attribs.settings.Name); | ||||
Engine.GetGUIObjectByName("sgMapSize").caption = translateMapSize(replay.attribs.settings.Size); | Engine.GetGUIObjectByName("sgMapSize").caption = translateMapSize(replay.attribs.settings.Size); | ||||
Engine.GetGUIObjectByName("sgMapType").caption = translateMapType(replay.attribs.settings.mapType); | Engine.GetGUIObjectByName("sgMapType").caption = translateMapType(replay.attribs.settings.mapType); | ||||
Engine.GetGUIObjectByName("sgVictory").caption = translateVictoryCondition(replay.attribs.settings.GameType); | Engine.GetGUIObjectByName("sgVictory").caption = translateVictoryCondition(replay.attribs.settings.GameType); | ||||
Engine.GetGUIObjectByName("sgNbPlayers").caption = sprintf(translate("Players: %(numberOfPlayers)s"), | Engine.GetGUIObjectByName("sgNbPlayers").caption = sprintf(translate("Players: %(numberOfPlayers)s"), | ||||
{ "numberOfPlayers": replay.attribs.settings.PlayerData.length }); | { "numberOfPlayers": replay.attribs.settings.PlayerData.length }); | ||||
Engine.GetGUIObjectByName("replayFilename").caption = escapeText(Engine.GetReplayDirectoryName(replay.directory)); | Engine.GetGUIObjectByName("replayFilename").caption = Engine.GetReplayDirectoryName(replay.directory); | ||||
elexis: Why was `escapeText` removed?
As far as I know it's required for windows path separators, see… | |||||
Not Done Inline ActionsAccording to Stan it works on windows without the escapeText: E:\Users\dolci\Documents\My Games\0ad\replays\0.0.23\2017-08-08_0001 As discussed on irc with Vladislav, removing the escapeText from the "text" elements doesn't work. So the change is correct and complete. elexis: According to Stan it works on windows without the `escapeText`:
`E:\Users\dolci\Documents\My… | |||||
Not Done Inline ActionsIt's tested and it works. Because the input shows the raw string as is. vladislavbelov: It's tested and it works. Because the input shows the raw string as is. | |||||
let metadata = Engine.GetReplayMetadata(replay.directory); | let metadata = Engine.GetReplayMetadata(replay.directory); | ||||
Engine.GetGUIObjectByName("sgPlayersNames").caption = | Engine.GetGUIObjectByName("sgPlayersNames").caption = | ||||
formatPlayerInfo( | formatPlayerInfo( | ||||
replay.attribs.settings.PlayerData, | replay.attribs.settings.PlayerData, | ||||
Engine.GetGUIObjectByName("showSpoiler").checked && | Engine.GetGUIObjectByName("showSpoiler").checked && | ||||
metadata && | metadata && | ||||
metadata.playerStates && | metadata.playerStates && | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Why was escapeText removed?
As far as I know it's required for windows path separators, see rP17134.
This was converted to JS escapeText with r19491, so rP19650 used it as well.
Setting caption = "foo\bar" shows an unprintable character here, with and without escapeText.
Should be tested on windows.