mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +02:00
Fix poor logic in toggleInfo
This commit is contained in:
parent
7022b8501b
commit
cefa1ebace
@ -205,21 +205,26 @@ export default class FightUiHandler extends UiHandler implements InfoToggle {
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adjust the visibility of move names and the cursor icon when the info overlay is toggled
|
||||||
|
* @param visible - The visibility of the info overlay; the move names and cursor's visibility will be set to the opposite
|
||||||
|
*/
|
||||||
toggleInfo(visible: boolean): void {
|
toggleInfo(visible: boolean): void {
|
||||||
|
// The info overlay will already fade in, so we should hide the move name text and cursor immediately
|
||||||
|
// rather than adjusting alpha via a tween.
|
||||||
if (visible) {
|
if (visible) {
|
||||||
this.movesContainer.setVisible(false);
|
this.movesContainer.setVisible(false).setAlpha(0);
|
||||||
this.cursorObj?.setVisible(false);
|
this.cursorObj?.setVisible(false).setAlpha(0);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
globalScene.tweens.add({
|
globalScene.tweens.add({
|
||||||
targets: [this.movesContainer, this.cursorObj],
|
targets: [this.movesContainer, this.cursorObj],
|
||||||
duration: fixedInt(125),
|
duration: fixedInt(125),
|
||||||
ease: "Sine.easeInOut",
|
ease: "Sine.easeInOut",
|
||||||
alpha: visible ? 0 : 1,
|
alpha: 1,
|
||||||
});
|
});
|
||||||
if (!visible) {
|
this.movesContainer.setVisible(true);
|
||||||
this.movesContainer.setVisible(true);
|
this.cursorObj?.setVisible(true);
|
||||||
this.cursorObj?.setVisible(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive(): boolean {
|
isActive(): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user