Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/menu.js
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
var g_IsObjectivesOpen = false; | var g_IsObjectivesOpen = false; | ||||
/** | /** | ||||
* Used to disable a specific bribe button for the time we are waiting for the result of the bribe after it was clicked. | * Used to disable a specific bribe button for the time we are waiting for the result of the bribe after it was clicked. | ||||
* It contains an array per viewedPlayer. This array is a list of the players that were bribed. | * It contains an array per viewedPlayer. This array is a list of the players that were bribed. | ||||
*/ | */ | ||||
var g_BribeButtonsWaiting = {}; | var g_BribeButtonsWaiting = {}; | ||||
/** | |||||
* Currently viewed summary panel. | |||||
bb: period | |||||
Not Done Inline Actionscurrently viewed panel elexis: currently viewed panel | |||||
*/ | |||||
var g_SummarySelectedPanel = ""; | |||||
Not Done Inline Actionsg_SelectedSummaryPanel or g_SummarySelectedPanel? elexis: `g_SelectedSummaryPanel` or `g_SummarySelectedPanel`? | |||||
// Redefined every time someone makes a tribute (so we can save some data in a closure). Called in input.js handleInputBeforeGui. | // Redefined every time someone makes a tribute (so we can save some data in a closure). Called in input.js handleInputBeforeGui. | ||||
var g_FlushTributing = function() {}; | var g_FlushTributing = function() {}; | ||||
function initSessionMenuButtons() | function initSessionMenuButtons() | ||||
Not Done Inline Actionsno lets for globals => var bb: no lets for globals => var | |||||
Not Done Inline Actionsone could also ste the jsDocs comments on every decleration bb: one could also ste the jsDocs comments on every decleration | |||||
{ | { | ||||
initMenuPosition(); | initMenuPosition(); | ||||
initGameSpeedControl(); | initGameSpeedControl(); | ||||
resizeDiplomacyDialog(); | resizeDiplomacyDialog(); | ||||
resizeTradeDialog(); | resizeTradeDialog(); | ||||
} | } | ||||
function initMenuPosition() | function initMenuPosition() | ||||
▲ Show 20 Lines • Show All 990 Lines • ▼ Show 20 Lines | "sim": { | ||||
"playerStates":extendedSimState.players.filter((state,player) => | "playerStates":extendedSimState.players.filter((state,player) => | ||||
g_IsObserver || player == 0 || player == g_ViewedPlayer || | g_IsObserver || player == 0 || player == g_ViewedPlayer || | ||||
extendedSimState.players[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer]), | extendedSimState.players[g_ViewedPlayer].hasSharedLos && g_Players[player].isMutualAlly[g_ViewedPlayer]), | ||||
"timeElapsed" : extendedSimState.timeElapsed | "timeElapsed" : extendedSimState.timeElapsed | ||||
}, | }, | ||||
"gui": { | "gui": { | ||||
"isInGame": true | "isInGame": true | ||||
}, | }, | ||||
"callback": "resumeGame" | "selectedPanel": g_SummarySelectedPanel, | ||||
"callback": "resumeGameAndSaveSummarySelectedPanel" | |||||
}); | }); | ||||
} | } | ||||
function openStrucTree() | function openStrucTree() | ||||
{ | { | ||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
pauseGame(); | pauseGame(); | ||||
Show All 31 Lines | function pauseGame(pause = true, explicit = false) | ||||
updatePauseOverlay(); | updatePauseOverlay(); | ||||
} | } | ||||
function resumeGame(explicit = false) | function resumeGame(explicit = false) | ||||
{ | { | ||||
pauseGame(false, explicit); | pauseGame(false, explicit); | ||||
} | } | ||||
function resumeGameAndSaveSummarySelectedPanel(data) | |||||
{ | |||||
g_SummarySelectedPanel = data.selectedPanel; | |||||
resumeGame(data.explicitResume); | |||||
} | |||||
/** | /** | ||||
* Called when the current player toggles a pause button. | * Called when the current player toggles a pause button. | ||||
*/ | */ | ||||
function togglePause() | function togglePause() | ||||
{ | { | ||||
if (!Engine.GetGUIObjectByName("pauseButton").enabled) | if (!Engine.GetGUIObjectByName("pauseButton").enabled) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
period