Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/session.js
Show First 20 Lines • Show All 1,376 Lines • ▼ Show 20 Lines | function appendSessionCounters(counters) | ||||
let simState = GetSimState(); | let simState = GetSimState(); | ||||
if (Engine.ConfigDB_GetValue("user", "gui.session.timeelapsedcounter") === "true") | if (Engine.ConfigDB_GetValue("user", "gui.session.timeelapsedcounter") === "true") | ||||
{ | { | ||||
let currentSpeed = Engine.GetSimRate(); | let currentSpeed = Engine.GetSimRate(); | ||||
if (currentSpeed != 1.0) | if (currentSpeed != 1.0) | ||||
// Translation: The "x" means "times", with the mathematical meaning of multiplication. | // Translation: The "x" means "times", with the mathematical meaning of multiplication. | ||||
counters.push(sprintf(translate("%(time)s (%(speed)sx)"), { | counters.push(sprintf(translate("%(time)s (%(speed)sx)"), { | ||||
"time": timeToString(simState.timeElapsed), | "time": durationToString(simState.timeElapsed), | ||||
"speed": Engine.FormatDecimalNumberIntoString(currentSpeed) | "speed": Engine.FormatDecimalNumberIntoString(currentSpeed) | ||||
})); | })); | ||||
else | else | ||||
counters.push(timeToString(simState.timeElapsed)); | counters.push(durationToString(simState.timeElapsed)); | ||||
} | } | ||||
if (simState.ceasefireActive && Engine.ConfigDB_GetValue("user", "gui.session.ceasefirecounter") === "true") | if (simState.ceasefireActive && Engine.ConfigDB_GetValue("user", "gui.session.ceasefirecounter") === "true") | ||||
counters.push(timeToString(simState.ceasefireTimeRemaining)); | counters.push(durationToString(simState.ceasefireTimeRemaining)); | ||||
g_ResearchListTop = 4 + 14 * counters.length; | g_ResearchListTop = 4 + 14 * counters.length; | ||||
} | } | ||||
/** | /** | ||||
* Send the current list of players, teams, AIs, observers and defeated/won and offline states to the lobby. | * Send the current list of players, teams, AIs, observers and defeated/won and offline states to the lobby. | ||||
* The playerData format from g_GameAttributes is kept to reuse the GUI function presenting the data. | * The playerData format from g_GameAttributes is kept to reuse the GUI function presenting the data. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator