Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/input.js
Context not available. | |||||
return; | return; | ||||
} | } | ||||
// Select a building from the construction panel given the current unit selected | |||||
function selectBuildingByPosition(position) | |||||
{ | |||||
let playerState = GetSimState().players[Engine.GetPlayerID()]; | |||||
let selection = g_Selection.toList(); | |||||
if (!playerState || !selection.length || Engine.GetGUIObjectByName("unitConstructionPanel").hidden) | |||||
return; | |||||
let unitConstructionButton = Engine.GetGUIObjectByName("unitConstructionButton["+position+"]"); | |||||
if( unitConstructionButton.hidden || !unitConstructionButton.enabled || !unitConstructionButton.onPress) | |||||
return; | |||||
unitConstructionButton.onPress(); | |||||
return; | |||||
} | |||||
// Set construction panel hotkeys visibility | |||||
function hideBuildingsShortcuts(hidden) | |||||
{ | |||||
if( hideBuildingsShortcuts.hidden === undefined) | |||||
hideBuildingsShortcuts.hidden = !hidden; | |||||
if( hideBuildingsShortcuts.hidden === hidden ) | |||||
return; | |||||
let i = 0; | |||||
let unitConstructionShortcutKeyContainer; | |||||
while( (unitConstructionShortcutKeyContainer = Engine.GetGUIObjectByName("unitConstructionShortcutKeyContainer[" + i + "]") ) !== undefined) | |||||
{ | |||||
unitConstructionShortcutKeyContainer.hidden = hidden; | |||||
++i; | |||||
} | |||||
hideBuildingsShortcuts.hidden = hidden; | |||||
} | |||||
// Called by GUI when user clicks training button | // Called by GUI when user clicks training button | ||||
function addTrainingToQueue(selection, trainEntType, playerState) | function addTrainingToQueue(selection, trainEntType, playerState) | ||||
{ | { | ||||
Context not available. |
Wildfire Games · Phabricator