1
0
Fork 0

Fixed character sheet's close button being hovered even when hidden

This commit is contained in:
Michaël Lemaire 2018-07-01 23:38:40 +02:00
parent 7843c291c8
commit f1031390fe

View file

@ -68,6 +68,7 @@ module TK.SpaceTac.UI {
this.xhidden = -this.view.getWidth(); this.xhidden = -this.view.getWidth();
this.container.x = this.xhidden; this.container.x = this.xhidden;
this.container.setVisible(false);
this.image_portrait = this.builder.image("common-transparent", 435, 271, true); this.image_portrait = this.builder.image("common-transparent", 435, 271, true);
@ -369,13 +370,9 @@ module TK.SpaceTac.UI {
this.view.audio.playOnce("ui-dialog-open"); this.view.audio.playOnce("ui-dialog-open");
} }
this.container.setVisible(true);
if (animate) { if (animate) {
this.view.tweens.add({ this.view.animations.addAnimation(this.container, { x: this.xshown }, 400, "Circ.easeOut");
targets: this.container,
x: this.xshown,
duration: 400,
easing: 'Circ.easeInOut'
});
} else { } else {
this.container.x = this.xshown; this.container.x = this.xshown;
} }
@ -384,19 +381,15 @@ module TK.SpaceTac.UI {
/** /**
* Hide the sheet * Hide the sheet
*/ */
hide(animate = true) { async hide(animate = true) {
this.view.audio.playOnce("ui-dialog-close"); this.view.audio.playOnce("ui-dialog-close");
if (animate) { if (animate) {
this.view.tweens.add({ await this.view.animations.addAnimation(this.container, { x: this.xhidden }, 400, "Circ.easeIn");
targets: this.container,
x: this.xhidden,
duration: 400,
ease: 'Circ.easeInOut'
});
} else { } else {
this.container.x = this.xhidden; this.container.x = this.xhidden;
} }
this.container.setVisible(false);
} }
/** /**