Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/lobby.js
Show First 20 Lines • Show All 988 Lines • ▼ Show 20 Lines | function updateGameSelection() | ||||
let playersNamesSize = sgPlayersNames.size; | let playersNamesSize = sgPlayersNames.size; | ||||
playersNamesSize.top = game.startTime ? sgGameStartTime.size.bottom : sgNbPlayers.size.bottom; | playersNamesSize.top = game.startTime ? sgGameStartTime.size.bottom : sgNbPlayers.size.bottom; | ||||
playersNamesSize.rtop = game.startTime ? sgGameStartTime.size.rbottom : sgNbPlayers.size.rbottom; | playersNamesSize.rtop = game.startTime ? sgGameStartTime.size.rbottom : sgNbPlayers.size.rbottom; | ||||
sgPlayersNames.size = playersNamesSize; | sgPlayersNames.size = playersNamesSize; | ||||
sgGameStartTime.hidden = !game.startTime; | sgGameStartTime.hidden = !game.startTime; | ||||
if (game.startTime) | if (game.startTime) | ||||
sgGameStartTime.caption = sprintf( | sgGameStartTime.caption = sprintf( | ||||
// Translation: %(time)s is the hour and minute here. | |||||
translate("Game started at %(time)s"), { | translate("Game started at %(time)s"), { | ||||
"time": Engine.FormatMillisecondsIntoDateStringLocal(+game.startTime*1000, translate("HH:mm")) | // Translation: Format of the local start time of a selected game in the lobby. | ||||
// For a list of symbols that you can use, see: | |||||
// https://sites.google.com/site/icuprojectuserguide/formatparse/datetime?pli=1#TOC-Date-Field-Symbol-Table | |||||
"time": Engine.FormatMillisecondsIntoDateStringLocal(game.startTime * 1000, translateWithContext("game start time format", "HH:mm")) | |||||
elexis: Sure startTime is a Number?
Other than that looks correct to me. | |||||
}); | }); | ||||
sgNbPlayers.caption = sprintf( | sgNbPlayers.caption = sprintf( | ||||
translate("Players: %(current)s/%(total)s"), { | translate("Players: %(current)s/%(total)s"), { | ||||
"current": game.nbp, | "current": game.nbp, | ||||
"total": game.maxnbp | "total": game.maxnbp | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | formattedMessage = sprintf(translate("%(sender)s %(message)s"), { | ||||
"message": msg.text | "message": msg.text | ||||
}); | }); | ||||
} | } | ||||
// Add chat message timestamp | // Add chat message timestamp | ||||
if (Engine.ConfigDB_GetValue("user", "chat.timestamp") != "true") | if (Engine.ConfigDB_GetValue("user", "chat.timestamp") != "true") | ||||
return formattedMessage; | return formattedMessage; | ||||
// Translation: Time as shown in the multiplayer lobby (when you enable it in the options page). | |||||
// For a list of symbols that you can use, see: | |||||
// https://sites.google.com/site/icuprojectuserguide/formatparse/datetime?pli=1#TOC-Date-Field-Symbol-Table | |||||
let timeString = Engine.FormatMillisecondsIntoDateStringLocal(msg.time ? msg.time * 1000 : Date.now(), translate("HH:mm")); | |||||
// Translation: Time prefix as shown in the multiplayer lobby (when you enable it in the options page). | |||||
let timePrefixString = sprintf(translate("\\[%(time)s]"), { | |||||
"time": timeString | |||||
}); | |||||
// Translation: IRC message format when there is a time prefix. | // Translation: IRC message format when there is a time prefix. | ||||
return sprintf(translate("%(time)s %(message)s"), { | return sprintf(translate("%(time)s %(message)s"), { | ||||
"time": senderFont(timePrefixString), | "time": senderFont(chatTimestampToString(msg.time ? msg.time * 1000 : Date.now())), | ||||
"message": formattedMessage | "message": formattedMessage | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Generate a (mostly) unique color for this player based on their name. | * Generate a (mostly) unique color for this player based on their name. | ||||
* @see http://stackoverflow.com/questions/3426404/create-a-hexadecimal-colour-based-on-a-string-with-jquery-javascript | * @see http://stackoverflow.com/questions/3426404/create-a-hexadecimal-colour-based-on-a-string-with-jquery-javascript | ||||
* @param {string} playername | * @param {string} playername | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Sure startTime is a Number?
Other than that looks correct to me.