[Misc][UI] Default Cursor Positioning for Command / Fight / Party (#4008)
* Cursor Pos. should match mainline * Fixed command mode behavior --------- Co-authored-by: frutescens <info@laptop>
This commit is contained in:
parent
3a6146935c
commit
3242a35341
|
@ -68,7 +68,11 @@ export default class CommandUiHandler extends UiHandler {
|
|||
messageHandler.movesWindowContainer.setVisible(false);
|
||||
messageHandler.message.setWordWrapWidth(1110);
|
||||
messageHandler.showText(i18next.t("commandUiHandler:actionMessage", {pokemonName: getPokemonNameWithAffix(commandPhase.getPokemon())}), 0);
|
||||
this.setCursor(this.getCursor());
|
||||
if (this.getCursor() === Command.POKEMON) {
|
||||
this.setCursor(Command.FIGHT);
|
||||
} else {
|
||||
this.setCursor(this.getCursor());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -85,7 +89,7 @@ export default class CommandUiHandler extends UiHandler {
|
|||
if (button === Button.ACTION) {
|
||||
switch (cursor) {
|
||||
// Fight
|
||||
case 0:
|
||||
case Command.FIGHT:
|
||||
if ((this.scene.getCurrentPhase() as CommandPhase).checkFightOverride()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -93,17 +97,17 @@ export default class CommandUiHandler extends UiHandler {
|
|||
success = true;
|
||||
break;
|
||||
// Ball
|
||||
case 1:
|
||||
case Command.BALL:
|
||||
ui.setModeWithoutClear(Mode.BALL);
|
||||
success = true;
|
||||
break;
|
||||
// Pokemon
|
||||
case 2:
|
||||
case Command.POKEMON:
|
||||
ui.setMode(Mode.PARTY, PartyUiMode.SWITCH, (this.scene.getCurrentPhase() as CommandPhase).getPokemon().getFieldIndex(), null, PartyUiHandler.FilterNonFainted);
|
||||
success = true;
|
||||
break;
|
||||
// Run
|
||||
case 3:
|
||||
case Command.RUN:
|
||||
(this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.RUN, 0);
|
||||
success = true;
|
||||
break;
|
||||
|
|
|
@ -95,9 +95,13 @@ export default class FightUiHandler extends UiHandler {
|
|||
messageHandler.bg.setVisible(false);
|
||||
messageHandler.commandWindow.setVisible(false);
|
||||
messageHandler.movesWindowContainer.setVisible(true);
|
||||
this.setCursor(this.getCursor());
|
||||
const pokemon = (this.scene.getCurrentPhase() as CommandPhase).getPokemon();
|
||||
if (pokemon.battleSummonData.turnCount <= 1) {
|
||||
this.setCursor(0);
|
||||
} else {
|
||||
this.setCursor(this.getCursor());
|
||||
}
|
||||
this.displayMoves();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||
this.partyContainer.setVisible(true);
|
||||
this.partyBg.setTexture(`party_bg${this.scene.currentBattle.double ? "_double" : ""}`);
|
||||
this.populatePartySlots();
|
||||
this.setCursor(this.cursor < 6 ? this.cursor : 0);
|
||||
this.setCursor(0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue