battle: Wait for the splash screen to end
This commit is contained in:
parent
98e75c67c8
commit
f962f52b97
|
@ -86,6 +86,7 @@ module TS.SpaceTac.UI.Specs {
|
|||
export function setupBattleview(): TestGame {
|
||||
return setupSingleView(testgame => {
|
||||
testgame.battleview = new BattleView();
|
||||
testgame.battleview.splash = false;
|
||||
|
||||
let battle = Battle.newQuickRandom();
|
||||
let player = battle.playing_ship ? battle.playing_ship.getPlayer() : new Player();
|
||||
|
|
|
@ -53,6 +53,9 @@ module TS.SpaceTac.UI {
|
|||
// Tactical mode toggle
|
||||
toggle_tactical_mode: Toggle
|
||||
|
||||
// Toggle for the splash screen display
|
||||
splash = true
|
||||
|
||||
// Init the view, binding it to a specific battle
|
||||
init(player: Player, battle: Battle) {
|
||||
super.init();
|
||||
|
@ -105,9 +108,6 @@ module TS.SpaceTac.UI {
|
|||
this.targetting = new Targetting(this, this.action_bar);
|
||||
this.targetting.moveToLayer(this.arena.layer_targetting);
|
||||
|
||||
// "Battle" animation
|
||||
this.showSplash();
|
||||
|
||||
// BGM
|
||||
this.gameui.audio.startMusic("mechanolith", 0.2);
|
||||
|
||||
|
@ -117,8 +117,14 @@ module TS.SpaceTac.UI {
|
|||
this.inputs.bindCheat("x", "Lose current battle", () => this.battle.cheats.lose());
|
||||
this.inputs.bindCheat("a", "Use AI to play", () => this.playAI());
|
||||
|
||||
// Start processing the log
|
||||
this.log_processor.start();
|
||||
// "Battle" animation, then start processing the log
|
||||
if (this.splash) {
|
||||
this.showSplash().then(() => {
|
||||
this.log_processor.start();
|
||||
});
|
||||
} else {
|
||||
this.log_processor.start();
|
||||
}
|
||||
|
||||
// If we are on a remote session, start the exchange
|
||||
if (!this.session.primary && this.gameui.session_token) {
|
||||
|
@ -142,12 +148,12 @@ module TS.SpaceTac.UI {
|
|||
}
|
||||
|
||||
/**
|
||||
* Display the splash screen at the star of battle
|
||||
* Display the splash screen at the start of battle
|
||||
*/
|
||||
showSplash(): void {
|
||||
showSplash(): Promise<void> {
|
||||
let splash = new BattleSplash(this, this.battle.fleets[0], this.battle.fleets[1]);
|
||||
splash.moveToLayer(this.layer_overlay);
|
||||
splash.start();
|
||||
return splash.start();
|
||||
}
|
||||
|
||||
// Method called when cursor starts hovering over a ship (or its icon)
|
||||
|
|
Loading…
Reference in a new issue