battle: Updated "space" and "return" key bindings
This commit is contained in:
parent
2e344c498e
commit
a42d9e77aa
1
TODO.md
1
TODO.md
|
@ -59,6 +59,7 @@ Battle
|
|||
* Fix "toggle action" targetting with simulated move not activating the action after the move
|
||||
* Add shorcut to perform only the "move" part of a move+fire simulation
|
||||
* Fix delay of shield/hull impact effects (should depend on weapon animation, and ship location)
|
||||
* Indicate visually the power gain of "end turn"
|
||||
|
||||
Ships models and equipments
|
||||
---------------------------
|
||||
|
|
|
@ -61,10 +61,6 @@ module TK.SpaceTac.UI {
|
|||
let button = battleview.add.button(0, 0, "battle-actionbar-button-menu", () => battleview.showOptions(), null, 1, 0, 0, 1, this);
|
||||
battleview.tooltip.bindStaticText(button, "Game options");
|
||||
|
||||
// Key bindings
|
||||
battleview.inputs.bind("Escape", "Cancel action", () => this.actionEnded());
|
||||
battleview.inputs.bind(" ", "End turn", () => this.keyActionPressed(-1));
|
||||
|
||||
// Log processing
|
||||
battleview.log_processor.register(event => {
|
||||
if (event instanceof ShipChangeEvent) {
|
||||
|
|
|
@ -117,7 +117,9 @@ module TK.SpaceTac.UI {
|
|||
|
||||
// Key mapping
|
||||
this.inputs.bind("t", "Show tactical view", () => this.toggle_tactical_mode.manipulate("keyboard")(3000));
|
||||
this.inputs.bind("Enter", "Validate action", () => this.targetting.validate());
|
||||
this.inputs.bind("Enter", "Validate action", () => this.validationPressed());
|
||||
this.inputs.bind(" ", "Validate action", () => this.validationPressed());
|
||||
this.inputs.bind("Escape", "Cancel action", () => this.action_bar.actionEnded());
|
||||
range(10).forEach(i => this.inputs.bind(`Numpad${i % 10}`, `Action/target ${i}`, () => this.numberPressed(i)));
|
||||
range(10).forEach(i => this.inputs.bind(`Digit${i % 10}`, `Action/target ${i}`, () => this.numberPressed(i)));
|
||||
this.inputs.bindCheat("w", "Win current battle", () => this.battle.cheats.win());
|
||||
|
@ -181,6 +183,17 @@ module TK.SpaceTac.UI {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the pression of a validation key (enter or space)
|
||||
*/
|
||||
validationPressed(): void {
|
||||
if (this.targetting.active) {
|
||||
this.targetting.validate();
|
||||
} else {
|
||||
this.action_bar.keyActionPressed(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when the arena cursor is hovered
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue