Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/MenuButtons.js
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
MenuButtons.prototype.Summary = class | MenuButtons.prototype.Summary = class | ||||
{ | { | ||||
constructor(button, pauseControl) | constructor(button, pauseControl) | ||||
{ | { | ||||
this.button = button; | this.button = button; | ||||
this.button.caption = translate("Summary"); | this.button.caption = translate("Summary"); | ||||
this.button.hotkey = "summary"; | this.button.hotkey = "summary"; | ||||
// TODO: Atlas should pass g_GameAttributes.settings | // TODO: Atlas should pass g_InitAttributes.settings | ||||
this.button.enabled = !Engine.IsAtlasRunning(); | this.button.enabled = !Engine.IsAtlasRunning(); | ||||
this.pauseControl = pauseControl; | this.pauseControl = pauseControl; | ||||
this.selectedData = undefined; | this.selectedData = undefined; | ||||
registerHotkeyChangeHandler(this.rebuild.bind(this)); | registerHotkeyChangeHandler(this.rebuild.bind(this)); | ||||
} | } | ||||
Show All 13 Lines | onPress() | ||||
this.pauseControl.implicitPause(); | this.pauseControl.implicitPause(); | ||||
// Allows players to see their own summary. | // Allows players to see their own summary. | ||||
// If they have shared ally vision researched, they are able to see the summary of there allies too. | // If they have shared ally vision researched, they are able to see the summary of there allies too. | ||||
let simState = Engine.GuiInterfaceCall("GetExtendedSimulationState"); | let simState = Engine.GuiInterfaceCall("GetExtendedSimulationState"); | ||||
Engine.PushGuiPage( | Engine.PushGuiPage( | ||||
"page_summary.xml", | "page_summary.xml", | ||||
{ | { | ||||
"sim": { | "sim": { | ||||
"mapSettings": g_GameAttributes.settings, | "mapSettings": g_InitAttributes.settings, | ||||
"playerStates": simState.players.filter((state, player) => | "playerStates": simState.players.filter((state, player) => | ||||
g_IsObserver || g_ViewedPlayer == 0 || player == 0 || player == g_ViewedPlayer || | g_IsObserver || g_ViewedPlayer == 0 || player == 0 || player == g_ViewedPlayer || | ||||
simState.players[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer]), | simState.players[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer]), | ||||
"timeElapsed": simState.timeElapsed | "timeElapsed": simState.timeElapsed | ||||
}, | }, | ||||
"gui": { | "gui": { | ||||
"dialog": true, | "dialog": true, | ||||
"isInGame": true, | "isInGame": true, | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator