Fix some bugs

This commit is contained in:
Flashfyre committed 2023-04-30 00:51:33 -04:00
1 parent fc4f98b203
commit c6d9816318
5 files changed
+36 -19

No files matched your search

+5 -4
View File
@@ -66,10 +66,11 @@ export default class BallUiHandler extends UiHandler {
success = true;
if (button === Button.ACTION && this.cursor < pokeballTypeCount) {
if (this.scene.pokeballCounts[this.cursor]) {
(this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.BALL, this.cursor);
this.scene.ui.setMode(Mode.COMMAND);
this.scene.ui.setMode(Mode.MESSAGE);
success = true;
if ((this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.BALL, this.cursor)) {
this.scene.ui.setMode(Mode.COMMAND);
this.scene.ui.setMode(Mode.MESSAGE);
success = true;
}
} else
ui.playError();
} else {
+2 -2
View File
@@ -113,14 +113,14 @@ export default class CommandUiHandler extends UiHandler {
return ret;
}
clear() {
clear(): void {
super.clear();
this.commandsContainer.setVisible(false);
this.getUi().getMessageHandler().clearText();
this.eraseCursor();
}
eraseCursor() {
eraseCursor(): void {
if (this.cursorObj)
this.cursorObj.destroy();
this.cursorObj = null;