Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/menu.js
Show All 17 Lines | |||||
// Number of pixels per millisecond to move | // Number of pixels per millisecond to move | ||||
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_IdleTraderTextTag = { "color": "orange" }; | ||||
/** | /** | ||||
* Store civilization code and page (structree or history) opened in civilization info. | * Store civilization code and page (structree or history) opened in civilization info. | ||||
*/ | */ | ||||
var g_CivInfo = { | var g_CivInfo = { | ||||
"civ": "", | "civ": "", | ||||
"page": "page_structree.xml" | "page": "page_structree.xml" | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 897 Lines • ▼ Show 20 Lines | active || inactive ? | ||||
), | ), | ||||
{ "numberGarrisoned": garrisoned } | { "numberGarrisoned": garrisoned } | ||||
); | ); | ||||
return sprintf(message, { | return sprintf(message, { | ||||
"openingTradingString": activeString, | "openingTradingString": activeString, | ||||
"openingGarrisonedString": garrisonedString, | "openingGarrisonedString": garrisonedString, | ||||
"garrisonedString": garrisonedString, | "garrisonedString": garrisonedString, | ||||
"inactiveString": coloredText(inactiveString, g_IdleTraderTextColor) | "inactiveString": setStringTags(inactiveString, g_IdleTraderTextTag) | ||||
}); | }); | ||||
} | } | ||||
function getIdleShipTradersText(traderNumber) | function getIdleShipTradersText(traderNumber) | ||||
{ | { | ||||
let active = traderNumber.shipTrader.trading; | let active = traderNumber.shipTrader.trading; | ||||
let inactive = traderNumber.shipTrader.total - active; | let inactive = traderNumber.shipTrader.total - active; | ||||
Show All 31 Lines | active ? | ||||
"%(numberOfShipTraders)s merchant ships inactive", | "%(numberOfShipTraders)s merchant ships inactive", | ||||
inactive | inactive | ||||
), | ), | ||||
{ "numberOfShipTraders": inactive } | { "numberOfShipTraders": inactive } | ||||
); | ); | ||||
return sprintf(message, { | return sprintf(message, { | ||||
"openingTradingString": activeString, | "openingTradingString": activeString, | ||||
"inactiveString": coloredText(inactiveString, g_IdleTraderTextColor) | "inactiveString": setStringTags(inactiveString, g_IdleTraderTextTag) | ||||
}); | }); | ||||
} | } | ||||
function closeTrade() | function closeTrade() | ||||
{ | { | ||||
g_IsTradeOpen = false; | g_IsTradeOpen = false; | ||||
Engine.GetGUIObjectByName("tradeDialogPanel").hidden = true; | Engine.GetGUIObjectByName("tradeDialogPanel").hidden = true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 250 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator