1
0
Fork 0

Added keybord shortcut for tactical mode

This commit is contained in:
Michaël Lemaire 2017-05-17 01:31:23 +02:00
parent a8d0369292
commit 3b18a6beff
7 changed files with 30 additions and 6 deletions

View file

@ -136,3 +136,18 @@ They are small and cannot be the direct target of weapons.
*Not done yet :* They are not affected by area effects,
except for area damage and area effects specifically designed for drones.
## Keyboard shortcuts
### Global
* S - Quick save
* L - Quick load
* M - Toggle sound
* F - Toggle fullscreen
### Battle (arena)
* 1,2,3...0 - Select action
* Space - End current ship's turn
* T - Tactical mode for 5 seconds

View file

@ -41,7 +41,7 @@ module TS.SpaceTac {
* Check the number of uses before overheating
*/
getRemainingUses(): number {
return this.overheat - this.uses;
return (this.heat > 0) ? 0 : (this.overheat - this.uses);
}
/**

View file

@ -51,7 +51,9 @@ module TS.SpaceTac.UI {
uses_message += ` (for ${cooldown.cooling} turn${cooldown.cooling ? "s" : ""})`;
}
}
filler.addText(150, 90, uses_message, "#c9604c", 20);
if (uses_message) {
filler.addText(150, 90, uses_message, "#c9604c", 20);
}
}
let description = action.getEffectsDescription();

View file

@ -211,9 +211,9 @@ module TS.SpaceTac.UI {
}
/**
* Set the HUD mode (shows information on all ships)
* Switch the tactical mode (shows information on all ships, and fades background)
*/
setHUDMode(active: boolean): void {
setTacticalMode(active: boolean): void {
this.ship_sprites.forEach(sprite => sprite.setHovered(active));
if (this.battleview.background) {
this.battleview.animations.setVisible(this.battleview.background, !active, 200);

View file

@ -104,6 +104,10 @@ module TS.SpaceTac.UI {
this.gameui.audio.startMusic("full-on");
// Key mapping
this.inputs.bind("t", "Show tactical view", () => {
this.arena.setTacticalMode(true);
this.timer.schedule(5000, () => this.arena.setTacticalMode(false));
});
this.inputs.bindCheat("w", "Win current battle", () => {
iforeach(this.battle.iships(), ship => {
if (ship.fleet.player != this.player) {

View file

@ -28,7 +28,10 @@ module TS.SpaceTac.UI {
this.info_button = new Phaser.Button(this.game, 0, 0, "battle-shiplist-info-button");
this.info_button.position.set(0, this.height - this.info_button.height);
UITools.setHoverClick(this.info_button, () => this.battleview.arena.setHUDMode(true), () => this.battleview.arena.setHUDMode(false), () => null);
UITools.setHoverClick(this.info_button,
() => this.battleview.arena.setTacticalMode(true),
() => this.battleview.arena.setTacticalMode(false),
() => null);
this.addChild(this.info_button);
battleview.layer_borders.add(this);

View file

@ -140,7 +140,7 @@ module TS.SpaceTac.UI {
static moveInSpace(obj: PhaserGraphics, x: number, y: number, angle: number, rotated_obj = obj): number {
if (x == obj.x && y == obj.y) {
let tween = obj.game.tweens.create(rotated_obj);
let duration = Animations.rotationTween(tween, angle, 0.3);
let duration = Animations.rotationTween(tween, angle, 0.5);
tween.start();
return duration;
} else {