Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/menu.js
Show All 19 Lines | |||||
var MENU_SPEED = 1.2; | var MENU_SPEED = 1.2; | ||||
// Trade menu: step for probability changes | // Trade menu: step for probability changes | ||||
var STEP = 5; | var STEP = 5; | ||||
// Shown in the trade dialog. | // Shown in the trade dialog. | ||||
var g_IdleTraderTextColor = "orange"; | var g_IdleTraderTextColor = "orange"; | ||||
/** | /** | ||||
s0600204Unsubmitted Not Done Inline Actionss0600204: /** | |||||
* Store civilization code and page (structree or history) opened in civilization info. | |||||
*/ | |||||
var g_CivInfo = { | |||||
"code": "", | |||||
"page": "page_structree.xml" | |||||
}; | |||||
/** | |||||
* The barter constants should match with the simulation | * The barter constants should match with the simulation | ||||
* Quantity of goods to sell per click. | * Quantity of goods to sell per click. | ||||
*/ | */ | ||||
const g_BarterResourceSellQuantity = 100; | const g_BarterResourceSellQuantity = 100; | ||||
/** | /** | ||||
* Multiplier to be applied when holding the massbarter hotkey. | * Multiplier to be applied when holding the massbarter hotkey. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,066 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
function openStrucTree() | function openStrucTree() | ||||
{ | { | ||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
pauseGame(); | pauseGame(); | ||||
// TODO add info about researched techs and unlocked entities | // TODO add info about researched techs and unlocked entities | ||||
Engine.PushGuiPage("page_structree.xml", { | |||||
"civ": g_Players[g_ViewedPlayer].civ, | Engine.PushGuiPage(g_CivInfo.page, { | ||||
"callback": "resumeGame", | "civ": g_CivInfo.code || g_Players[g_ViewedPlayer].civ, | ||||
"callback": "storeCivInfoPage" | |||||
}); | }); | ||||
Not Done Inline ActionsLayout code as before please. s0600204: Layout code as before please. | |||||
} | } | ||||
function storeCivInfoPage(data) | |||||
{ | |||||
g_CivInfo.code = data.civ; | |||||
Not Done Inline ActionsAnd again, is there any time that this function is called and data is not defined? s0600204: And again, is there any time that this function is called and `data` is not defined? | |||||
Not Done Inline Actionssame about the civ elexis: same about the civ | |||||
Not Done Inline ActionsYes, sorry. :( ffffffff: Yes, sorry. :( | |||||
g_CivInfo.page = data.page; | |||||
resumeGame(); | |||||
} | |||||
/** | /** | ||||
* Pause or resume the game. | * Pause or resume the game. | ||||
* | * | ||||
* @param explicit - true if the player explicitly wants to pause or resume. | * @param explicit - true if the player explicitly wants to pause or resume. | ||||
* If this argument isn't set, a multiplayer game won't be paused and the pause overlay | * If this argument isn't set, a multiplayer game won't be paused and the pause overlay | ||||
* won't be shown in single player. | * won't be shown in single player. | ||||
*/ | */ | ||||
function pauseGame(pause = true, explicit = false) | function pauseGame(pause = true, explicit = false) | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator