[P3][UI] Fix tooltip bugs in Starter Select screen (#4641)

* [UI] Fix candy friendship tooltip bug in Starter Select

* [UI] remove tooltip when exiting starter select screen
This commit is contained in:
MokaStitcher 2024-10-11 21:46:00 +02:00 committed by GitHub
parent 70b9a43c8b
commit 89d7e7ea65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 2 deletions

View File

@ -2963,8 +2963,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.natureCursor = -1;
if (this.activeTooltip === "CANDY") {
const { currentFriendship, friendshipCap } = this.getFriendship(this.lastSpecies.speciesId);
this.scene.ui.editTooltip("", `${currentFriendship}/${friendshipCap}`);
if (this.lastSpecies) {
const { currentFriendship, friendshipCap } = this.getFriendship(this.lastSpecies.speciesId);
this.scene.ui.editTooltip("", `${currentFriendship}/${friendshipCap}`);
} else {
this.scene.ui.hideTooltip();
}
}
if (species?.forms?.find(f => f.formKey === "female")) {
@ -3655,6 +3659,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
StarterPrefs.save(this.starterPreferences);
this.cursor = -1;
this.hideInstructions();
this.activeTooltip = undefined;
this.scene.ui.hideTooltip();
this.starterSelectContainer.setVisible(false);
this.blockInput = false;