Differential D1398 Diff 11381 binaries/data/mods/public/gui/session/minimap/MiniMapIdleWorkerButton.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/minimap/MiniMapIdleWorkerButton.js
/** | /** | ||||
* If the button that this class manages is pressed, an idle unit having one of the given classes is selected. | * If the button that this class manages is pressed, an idle unit having one of the given classes is selected. | ||||
*/ | */ | ||||
class MiniMapIdleWorkerButton | class MiniMapIdleWorkerButton | ||||
{ | { | ||||
constructor(playerViewControl, idleClasses) | constructor(playerViewControl, idleClasses) | ||||
{ | { | ||||
this.idleWorkerButton = Engine.GetGUIObjectByName("idleWorkerButton"); | this.idleWorkerButton = Engine.GetGUIObjectByName("idleWorkerButton"); | ||||
this.idleWorkerButton.onPress = this.onPress.bind(this); | this.idleWorkerButton.onKeyDown = this.onPress.bind(this); | ||||
this.idleWorkerButton.onMouseLeftPress = this.onPress.bind(this); | |||||
Stan: Might want to rename it onKeyDown ? | |||||
this.idleClasses = idleClasses; | this.idleClasses = idleClasses; | ||||
Done Inline ActionsFeeling unhappy about this addition. The cpp code change in this revision only adds the keyDown for hotkey events, maybe we should also add it for other events (like clicking a button) bb: Feeling unhappy about this addition. The cpp code change in this revision only adds the keyDown… | |||||
registerHotkeyChangeHandler(this.onHotkeyChange.bind(this)); | registerHotkeyChangeHandler(this.onHotkeyChange.bind(this)); | ||||
registerSimulationUpdateHandler(this.rebuild.bind(this)); | registerSimulationUpdateHandler(this.rebuild.bind(this)); | ||||
playerViewControl.registerViewedPlayerChangeHandler(this.rebuild.bind(this)); | playerViewControl.registerViewedPlayerChangeHandler(this.rebuild.bind(this)); | ||||
} | } | ||||
onHotkeyChange() | onHotkeyChange() | ||||
{ | { | ||||
Show All 21 Lines |
Wildfire Games · Phabricator
Might want to rename it onKeyDown ?