1
0
Fork 0

arena: Increase drone size in tactical mode

This commit is contained in:
Michaël Lemaire 2017-05-21 18:39:02 +02:00
parent 5fe4043479
commit 03fd66de4c
5 changed files with 30 additions and 4 deletions

1
TODO
View file

@ -19,6 +19,7 @@
* Arena: add power indicator in ship hover information
* Arena: display effects description instead of attribute changes
* Arena: add auto-move to attack
* Arena: fix effects originating from real ship location instead of current sprite (when AI fires then moves)
* Actions: separate overheat and cooldown display
* Actions: show power usage/recovery in power bar, on action hover
* Actions: fix targetting not resetting when using keyboard shortcuts

View file

@ -246,6 +246,7 @@ module TS.SpaceTac.UI {
*/
setTacticalMode(active: boolean): void {
this.ship_sprites.forEach(sprite => sprite.setHovered(active));
this.drone_sprites.forEach(drone => drone.setTacticalMode(active));
this.battleview.animations.setVisible(this.layer_garbage, !active, 200);
if (this.battleview.background) {
this.battleview.animations.setVisible(this.battleview.background, !active, 200);

View file

@ -85,5 +85,13 @@ module TS.SpaceTac.UI {
});
tween.start();
}
/**
* Set the tactical mode display
*/
setTacticalMode(active: boolean) {
this.sprite.rotation = active ? -this.rotation : 0;
this.sprite.scale.set(active ? 0.3 : 0.1);
}
}
}

View file

@ -51,6 +51,9 @@ module TS.SpaceTac.UI {
// True if player interaction is allowed
interacting: boolean;
// Tactical mode toggle
toggle_tactical_mode: Toggle;
// Init the view, binding it to a specific battle
init(player: Player, battle: Battle) {
super.init();
@ -64,6 +67,11 @@ module TS.SpaceTac.UI {
this.battle.timer = this.timer;
this.log_processor = new LogProcessor(this);
this.toggle_tactical_mode = new Toggle(
() => this.arena.setTacticalMode(true),
() => this.arena.setTacticalMode(false)
);
}
// Create view graphics
@ -104,10 +112,7 @@ 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.bind("t", "Show tactical view", () => this.toggle_tactical_mode.switch(3000));
this.inputs.bindCheat("w", "Win current battle", () => {
iforeach(this.battle.iships(), ship => {
if (ship.fleet.player != this.player) {

View file

@ -46,5 +46,16 @@ module TS.SpaceTac {
}
}
}
/**
* Switch between on and off status
*/
switch(duration = 0, hard = false) {
if (this.status) {
this.stop(hard);
} else {
this.start(duration, hard);
}
}
}
}