[Hotfix] fix UI transition causing unusual freezes after egg summary shown (#4126)

* console logs n stuff

* fix bad ui transition for egg summary freeze bug (logs included)

* cleanup egg lapse phase

* touchup

* add back removed whitespace

* remove console logs

---------

Co-authored-by: James Diefenbach <z5421232@ad.unsw.edu.au>
This commit is contained in:
James Diefenbach 2024-09-10 23:23:13 +10:00 committed by GitHub
parent ebb09dda34
commit 7dd1832072
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -43,9 +43,9 @@ export class EggSummaryPhase extends Phase {
} }
end() { end() {
this.eggHatchHandler.clear();
this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {});
this.scene.time.delayedCall(250, () => this.scene.setModifiersVisible(true)); this.scene.time.delayedCall(250, () => this.scene.setModifiersVisible(true));
super.end(); this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {
super.end();
});
} }
} }

View File

@ -97,6 +97,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
this.pokemonIconsContainer.removeAll(true); this.pokemonIconsContainer.removeAll(true);
this.eggHatchBg.setVisible(false); this.eggHatchBg.setVisible(false);
this.getUi().hideTooltip(); this.getUi().hideTooltip();
// Note: Questions on garbage collection go to @frutescens // Note: Questions on garbage collection go to @frutescens
const activeKeys = this.scene.getActiveKeys(); const activeKeys = this.scene.getActiveKeys();
// Removing unnecessary sprites from animation manager // Removing unnecessary sprites from animation manager
@ -117,7 +118,6 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
this.eggHatchData.length = 0; this.eggHatchData.length = 0;
// Removes Pokemon icons in EggSummaryUiHandler // Removes Pokemon icons in EggSummaryUiHandler
this.iconAnimHandler.removeAll(); this.iconAnimHandler.removeAll();
console.log("Egg Summary Handler cleared");
} }
/** /**
@ -256,7 +256,6 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
if (phase instanceof EggSummaryPhase) { if (phase instanceof EggSummaryPhase) {
phase.end(); phase.end();
} }
ui.revertMode();
success = true; success = true;
} else { } else {
const count = this.eggHatchData.length; const count = this.eggHatchData.length;