Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/MenuButtons.js
Show All 14 Lines | constructor(button, pauseControl) | ||||
this.button.caption = translate(translate("Manual")); | this.button.caption = translate(translate("Manual")); | ||||
this.pauseControl = pauseControl; | this.pauseControl = pauseControl; | ||||
} | } | ||||
onPress() | onPress() | ||||
{ | { | ||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
this.pauseControl.implicitPause(); | this.pauseControl.implicitPause(); | ||||
g_OverlayCounterManager.hide(true); | |||||
Engine.PushGuiPage("page_manual.xml", {}, resumeGame); | Engine.PushGuiPage("page_manual.xml", {}, resumeGame); | ||||
} | } | ||||
}; | }; | ||||
MenuButtons.prototype.Chat = class | MenuButtons.prototype.Chat = class | ||||
{ | { | ||||
constructor(button, pauseControl, playerViewControl, chat) | constructor(button, pauseControl, playerViewControl, chat) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | MenuButtons.prototype.Summary = class | ||||
onPress() | onPress() | ||||
{ | { | ||||
if (Engine.IsAtlasRunning()) | if (Engine.IsAtlasRunning()) | ||||
return; | return; | ||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
this.pauseControl.implicitPause(); | this.pauseControl.implicitPause(); | ||||
g_OverlayCounterManager.hide(true); | |||||
// 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_InitAttributes.settings, | "mapSettings": g_InitAttributes.settings, | ||||
"playerStates": simState.players.filter((state, player) => | "playerStates": simState.players.filter((state, player) => | ||||
Show All 33 Lines | rebuild() | ||||
}); | }); | ||||
} | } | ||||
onPress() | onPress() | ||||
{ | { | ||||
if (!Engine.HasXmppClient()) | if (!Engine.HasXmppClient()) | ||||
return; | return; | ||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
g_OverlayCounterManager.hide(true); | |||||
Engine.PushGuiPage("page_lobby.xml", { "dialog": true }); | Engine.PushGuiPage("page_lobby.xml", { "dialog": true }); | ||||
} | } | ||||
}; | }; | ||||
MenuButtons.prototype.Options = class | MenuButtons.prototype.Options = class | ||||
{ | { | ||||
constructor(button, pauseControl) | constructor(button, pauseControl) | ||||
{ | { | ||||
this.button = button; | this.button = button; | ||||
this.button.caption = translate("Options"); | this.button.caption = translate("Options"); | ||||
this.pauseControl = pauseControl; | this.pauseControl = pauseControl; | ||||
} | } | ||||
onPress() | onPress() | ||||
{ | { | ||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
this.pauseControl.implicitPause(); | this.pauseControl.implicitPause(); | ||||
g_OverlayCounterManager.hide(true); | |||||
Engine.PushGuiPage( | Engine.PushGuiPage( | ||||
"page_options.xml", | "page_options.xml", | ||||
{}, | {}, | ||||
changes => { | changes => { | ||||
fireConfigChangeHandlers(changes); | fireConfigChangeHandlers(changes); | ||||
resumeGame(); | resumeGame(); | ||||
}); | }); | ||||
} | } | ||||
}; | }; | ||||
MenuButtons.prototype.Hotkeys = class | MenuButtons.prototype.Hotkeys = class | ||||
{ | { | ||||
constructor(button, pauseControl) | constructor(button, pauseControl) | ||||
{ | { | ||||
this.button = button; | this.button = button; | ||||
this.button.caption = translate("Hotkeys"); | this.button.caption = translate("Hotkeys"); | ||||
this.pauseControl = pauseControl; | this.pauseControl = pauseControl; | ||||
} | } | ||||
onPress() | onPress() | ||||
{ | { | ||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
this.pauseControl.implicitPause(); | this.pauseControl.implicitPause(); | ||||
g_OverlayCounterManager.hide(true); | |||||
Engine.PushGuiPage( | Engine.PushGuiPage( "hotkeys/page_hotkeys.xml", {}, resumeGame); | ||||
"hotkeys/page_hotkeys.xml", | |||||
{}, | |||||
() => { resumeGame(); }); | |||||
} | } | ||||
}; | }; | ||||
MenuButtons.prototype.Pause = class | MenuButtons.prototype.Pause = class | ||||
{ | { | ||||
constructor(button, pauseControl, playerViewControl) | constructor(button, pauseControl, playerViewControl) | ||||
{ | { | ||||
this.button = button; | this.button = button; | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator