Changeset View
Standalone View
binaries/data/mods/public/gui/common/functions_utility_loadsave.js
function sortDecreasingDate(a, b) | function sortDecreasingDate(a, b) | ||||
{ | { | ||||
return b.metadata.time - a.metadata.time; | return b.metadata.time - a.metadata.time; | ||||
} | } | ||||
function isCompatibleSavegame(metadata, engineInfo) | function isCompatibleSavegame(metadata, engineInfo) | ||||
{ | { | ||||
return engineInfo && hasSameSavegameVersion(metadata, engineInfo) && | return engineInfo && hasSameSavegameVersion(metadata, engineInfo) && | ||||
hasSameEngineVersion(metadata, engineInfo) & hasSameMods(metadata, engineInfo); | hasSameEngineVersion(metadata, engineInfo) & hasSameMods(metadata, engineInfo); | ||||
} | } | ||||
function generateSavegameDateString(metadata, engineInfo) | function generateSavegameDateString(metadata, engineInfo) | ||||
{ | { | ||||
return compatibilityColor( | return compatibilityColor(datetimeToString(metadata.time * 1000), isCompatibleSavegame(metadata, engineInfo)); | ||||
Engine.FormatMillisecondsIntoDateStringLocal(metadata.time * 1000, translate("yyyy-MM-dd HH:mm:ss")), | |||||
isCompatibleSavegame(metadata, engineInfo)); | |||||
} | } | ||||
elexis: "savegame format" should do | |||||
Not Done Inline ActionsWhat do you think about combining the savegame and replay strings? It seems like they should be the same format, even though currently savegame shows the seconds while replay doesn't. temple: What do you think about combining the savegame and replay strings? It seems like they should be… | |||||
Not Done Inline Actions(It's more realistic to write 2 savegames withing the same minute than starting 2 matches in the same minute.) So unifying the timestamp formats and removing the seconds is good to me. So basically we have a date format where only the time matters and a date format where both time and day matter. l10n.js sounds like a cleaner place to add all these functions (duration format, time of day format, datetime format). Actually I wonder whether it's realistic that people would want to differentiate the chat timestamp from the time-of-the-day timestamp. (HH vs H maybe?) (I don't see a use case where l10n would use FormatMillisecondsIntoDateStringGMT rather than FormatMillisecondsIntoDateStringLocal (GMT only used to avoid applying the timezone difference to durations)). elexis: (It's more realistic to write 2 savegames withing the same minute than starting 2 matches in… | |||||
function generateSavegameLabel(metadata, engineInfo) | function generateSavegameLabel(metadata, engineInfo) | ||||
{ | { | ||||
return sprintf( | return sprintf( | ||||
metadata.description ? | metadata.description ? | ||||
translate("%(dateString)s %(map)s - %(description)s") : | translate("%(dateString)s %(map)s - %(description)s") : | ||||
translate("%(dateString)s %(map)s"), | translate("%(dateString)s %(map)s"), | ||||
{ | { | ||||
"dateString": generateSavegameDateString(metadata, engineInfo), | "dateString": generateSavegameDateString(metadata, engineInfo), | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |
"savegame format" should do