Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/unit_commands.js
// The number of currently visible buttons (used to optimise showing/hiding) | // The number of currently visible buttons (used to optimise showing/hiding) | ||||
var g_unitPanelButtons = { | var g_unitPanelButtons = { | ||||
"Selection": 0, | "Selection": 0, | ||||
"Queue": 0, | "Queue": 0, | ||||
"Formation": 0, | "Formation": 0, | ||||
"Garrison": 0, | "Garrison": 0, | ||||
"Training": 0, | "Training": 0, | ||||
"Research": 0, | "Research": 0, | ||||
"Alert": 0, | "Alert": 0, | ||||
"Barter": 0, | "Barter": 0, | ||||
"Construction": 0, | "Construction": 0, | ||||
"Command": 0, | "Command": 0, | ||||
"AllyCommand": 0, | "AllyCommand": 0, | ||||
"Stance": 0, | "Stance": 0, | ||||
"Gate": 0, | "Gate": 0, | ||||
"Pack": 0, | "Pack": 0, | ||||
"Upgrade": 0 | "Upgrade": 0, | ||||
"Turrets": 0 | |||||
}; | }; | ||||
/** | /** | ||||
* Set the position of a panel object according to the index, | * Set the position of a panel object according to the index, | ||||
* from left to right, from top to bottom. | * from left to right, from top to bottom. | ||||
* Will wrap around to subsequent rows if the index | * Will wrap around to subsequent rows if the index | ||||
* is larger than rowLength. | * is larger than rowLength. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | function getAllBuildableEntitiesFromSelection() | ||||
if (!g_allBuildableEntities) | if (!g_allBuildableEntities) | ||||
g_allBuildableEntities = getAllBuildableEntities(g_Selection.toList()); | g_allBuildableEntities = getAllBuildableEntities(g_Selection.toList()); | ||||
return g_allBuildableEntities; | return g_allBuildableEntities; | ||||
} | } | ||||
function getNumberOfRightPanelButtons() | function getNumberOfRightPanelButtons() | ||||
{ | { | ||||
var sum = 0; | let sum = 0; | ||||
for (let prop of ["Construction", "Training", "Pack", "Gate", "Upgrade"]) | for (let prop of ["Construction", "Training", "Pack", "Gate", "Upgrade", "Turrets"]) | ||||
if (g_SelectionPanels[prop].used) | if (g_SelectionPanels[prop].used) | ||||
sum += g_unitPanelButtons[prop]; | sum += g_unitPanelButtons[prop]; | ||||
return sum; | return sum; | ||||
} | } |
Wildfire Games · Phabricator