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; | |||||
} | |||||
// 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