Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/summary/summary.js
Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | for (let i = 0; i < g_PlayerCount; ++i) | ||||
updateCountersPlayer(playerState, panelInfo.counters, panelInfo.headings, playerCounterValue, index); | updateCountersPlayer(playerState, panelInfo.counters, panelInfo.headings, playerCounterValue, index); | ||||
} | } | ||||
let teamCounterFn = panelInfo.teamCounterFn; | let teamCounterFn = panelInfo.teamCounterFn; | ||||
if (g_Teams && teamCounterFn) | if (g_Teams && teamCounterFn) | ||||
updateCountersTeam(teamCounterFn, panelInfo.counters, panelInfo.headings, index); | updateCountersTeam(teamCounterFn, panelInfo.counters, panelInfo.headings, index); | ||||
} | } | ||||
function confirmStartReplay() | |||||
{ | |||||
if (Engine.HasXmppClient()) | |||||
messageBox( | |||||
400, 200, | |||||
translate("Are you sure you want to quit the lobby?"), | |||||
translate("Confirmation"), | |||||
[translate("No"), translate("Yes")], | |||||
[null, startReplay] | |||||
); | |||||
else | |||||
startReplay(); | |||||
} | |||||
function continueButton() | function continueButton() | ||||
{ | { | ||||
let summarySelectedData = { | let summarySelectedData = { | ||||
"panel": g_SelectedPanel, | "panel": g_SelectedPanel, | ||||
"charts": g_SelectedChart | "charts": g_SelectedChart | ||||
}; | }; | ||||
if (g_GameData.gui.isInGame) | if (g_GameData.gui.isInGame) | ||||
Engine.PopGuiPageCB({ | Engine.PopGuiPageCB({ | ||||
"explicitResume": 0, | "explicitResume": 0, | ||||
"summarySelectedData": summarySelectedData | "summarySelectedData": summarySelectedData | ||||
}); | }); | ||||
else if (g_GameData.gui.isReplay) | else if (g_GameData.gui.isReplay) | ||||
Engine.SwitchGuiPage("page_replaymenu.xml", { | Engine.SwitchGuiPage("page_replaymenu.xml", { | ||||
"replaySelectionData": g_GameData.gui.replaySelectionData, | "replaySelectionData": g_GameData.gui.replaySelectionData, | ||||
"summarySelectedData": summarySelectedData | "summarySelectedData": summarySelectedData | ||||
}); | }); | ||||
else if (Engine.HasXmppClient()) | else if (Engine.HasXmppClient()) | ||||
Engine.SwitchGuiPage("page_lobby.xml"); | Engine.SwitchGuiPage("page_lobby.xml"); | ||||
else | else | ||||
Engine.SwitchGuiPage("page_pregame.xml"); | Engine.SwitchGuiPage("page_pregame.xml"); | ||||
} | } | ||||
function startReplay() | function startReplay() | ||||
{ | { | ||||
if (Engine.HasXmppClient()) | |||||
Engine.StopXmppClient(); | |||||
if (!Engine.StartVisualReplay(g_GameData.gui.replayDirectory)) | if (!Engine.StartVisualReplay(g_GameData.gui.replayDirectory)) | ||||
{ | { | ||||
warn("Replay file not found!"); | warn("Replay file not found!"); | ||||
return; | return; | ||||
} | } | ||||
Engine.SwitchGuiPage("page_loading.xml", { | Engine.SwitchGuiPage("page_loading.xml", { | ||||
"attribs": Engine.GetReplayAttributes(g_GameData.gui.replayDirectory), | "attribs": Engine.GetReplayAttributes(g_GameData.gui.replayDirectory), | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator