Fixed actionbar interactive status
This commit is contained in:
parent
9d2f3d6c4d
commit
3310440ff9
|
@ -224,7 +224,6 @@ module TK.SpaceTac.UI {
|
|||
}
|
||||
|
||||
this.updatePower();
|
||||
this.setInteractive(this.ship != null);
|
||||
}
|
||||
|
||||
// Called by an action icon when the action is selected
|
||||
|
|
|
@ -169,6 +169,10 @@ module TK.SpaceTac.UI {
|
|||
* If the AI is already playing, do nothing
|
||||
*/
|
||||
playAI(): void {
|
||||
if (this.session.spectator) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.actual_battle.playAI()) {
|
||||
if (this.interacting) {
|
||||
this.action_bar.setShip(new Ship());
|
||||
|
@ -181,6 +185,10 @@ module TK.SpaceTac.UI {
|
|||
* Apply an action to the actual battle
|
||||
*/
|
||||
applyAction(action: BaseAction, target?: Target): boolean {
|
||||
if (this.session.spectator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let ship = this.actual_battle.playing_ship;
|
||||
if (ship) {
|
||||
let ship_action = first(ship.getAvailableActions(), ac => ac.is(action));
|
||||
|
|
|
@ -44,9 +44,14 @@ module TK.SpaceTac.UI {
|
|||
start() {
|
||||
if (!this.view.gameui.headless) {
|
||||
this.log.play(async diff => {
|
||||
while (this.view.game.paused) {
|
||||
await this.view.timer.sleep(500);
|
||||
}
|
||||
|
||||
await this.processBattleDiff(diff);
|
||||
this.transferControl();
|
||||
});
|
||||
|
||||
this.transferControl();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue