Fixed ship tooltip/hover being triggered over a dialog
This commit is contained in:
parent
7315be6be1
commit
56a85333f5
1
TODO.md
1
TODO.md
|
@ -36,7 +36,6 @@ Character sheet
|
|||
Battle
|
||||
------
|
||||
|
||||
* Fix arena's ship hovering happening even when the character sheet (or a dialog) is open on top
|
||||
* Add a voluntary retreat option
|
||||
* Add scroll buttons when there are too many actions
|
||||
* Toggle bar/text display in power section of action bar
|
||||
|
|
|
@ -105,7 +105,11 @@ module TK.SpaceTac.UI {
|
|||
|
||||
// Watch mouse move to capture hovering over background
|
||||
this.input_callback = this.view.input.addMoveCallback((pointer: Phaser.Pointer) => {
|
||||
var point = new Phaser.Point();
|
||||
if (this.view.dialogs_opened.length > 0 || this.view.character_sheet.isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let point = new Phaser.Point();
|
||||
if (view.input.hitTest(background, pointer, point)) {
|
||||
let location = new ArenaLocation(point.x * background.scale.x, point.y * background.scale.y);
|
||||
let ship = this.getShip(location);
|
||||
|
|
|
@ -195,6 +195,13 @@ module TK.SpaceTac.UI {
|
|||
this.portraits.y = 80 + 160 * this.portraits.scale.x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the sheet is shown
|
||||
*/
|
||||
isOpened(): boolean {
|
||||
return this.x != this.xhidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the sheet for a given ship
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,7 @@ module TK.SpaceTac.UI {
|
|||
* Main menu (first interactive screen)
|
||||
*/
|
||||
export class MainMenu extends BaseView {
|
||||
static returned = false
|
||||
layer_stars: Phaser.Group
|
||||
layer_presents: Phaser.Group
|
||||
layer_title: Phaser.Group
|
||||
|
@ -72,12 +73,18 @@ module TK.SpaceTac.UI {
|
|||
let fading = this.timer.schedule(5000, () => {
|
||||
this.animations.show(this.layer_title, 1000);
|
||||
this.animations.hide(this.layer_presents, 300);
|
||||
})
|
||||
this.input.onTap.addOnce(() => {
|
||||
});
|
||||
let pass = () => {
|
||||
this.timer.cancel(fading);
|
||||
this.animations.show(this.layer_title, 0);
|
||||
this.animations.hide(this.layer_presents, 0);
|
||||
});
|
||||
};
|
||||
if (MainMenu.returned) {
|
||||
pass();
|
||||
} else {
|
||||
this.input.onTap.addOnce(pass);
|
||||
MainMenu.returned = true;
|
||||
}
|
||||
|
||||
this.gameui.audio.startMusic("supernatural");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue