Added keybord shortcut for tactical mode
This commit is contained in:
parent
a8d0369292
commit
3b18a6beff
15
README.md
15
README.md
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue