mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-19 18:57:37 +00:00
[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.movesWindowContainer.setVisible(false);
|
||||||
messageHandler.message.setWordWrapWidth(1110);
|
messageHandler.message.setWordWrapWidth(1110);
|
||||||
messageHandler.showText(i18next.t("commandUiHandler:actionMessage", {pokemonName: getPokemonNameWithAffix(commandPhase.getPokemon())}), 0);
|
messageHandler.showText(i18next.t("commandUiHandler:actionMessage", {pokemonName: getPokemonNameWithAffix(commandPhase.getPokemon())}), 0);
|
||||||
|
if (this.getCursor() === Command.POKEMON) {
|
||||||
|
this.setCursor(Command.FIGHT);
|
||||||
|
} else {
|
||||||
this.setCursor(this.getCursor());
|
this.setCursor(this.getCursor());
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -85,7 +89,7 @@ export default class CommandUiHandler extends UiHandler {
|
|||||||
if (button === Button.ACTION) {
|
if (button === Button.ACTION) {
|
||||||
switch (cursor) {
|
switch (cursor) {
|
||||||
// Fight
|
// Fight
|
||||||
case 0:
|
case Command.FIGHT:
|
||||||
if ((this.scene.getCurrentPhase() as CommandPhase).checkFightOverride()) {
|
if ((this.scene.getCurrentPhase() as CommandPhase).checkFightOverride()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -93,17 +97,17 @@ export default class CommandUiHandler extends UiHandler {
|
|||||||
success = true;
|
success = true;
|
||||||
break;
|
break;
|
||||||
// Ball
|
// Ball
|
||||||
case 1:
|
case Command.BALL:
|
||||||
ui.setModeWithoutClear(Mode.BALL);
|
ui.setModeWithoutClear(Mode.BALL);
|
||||||
success = true;
|
success = true;
|
||||||
break;
|
break;
|
||||||
// Pokemon
|
// Pokemon
|
||||||
case 2:
|
case Command.POKEMON:
|
||||||
ui.setMode(Mode.PARTY, PartyUiMode.SWITCH, (this.scene.getCurrentPhase() as CommandPhase).getPokemon().getFieldIndex(), null, PartyUiHandler.FilterNonFainted);
|
ui.setMode(Mode.PARTY, PartyUiMode.SWITCH, (this.scene.getCurrentPhase() as CommandPhase).getPokemon().getFieldIndex(), null, PartyUiHandler.FilterNonFainted);
|
||||||
success = true;
|
success = true;
|
||||||
break;
|
break;
|
||||||
// Run
|
// Run
|
||||||
case 3:
|
case Command.RUN:
|
||||||
(this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.RUN, 0);
|
(this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.RUN, 0);
|
||||||
success = true;
|
success = true;
|
||||||
break;
|
break;
|
||||||
|
@ -95,9 +95,13 @@ export default class FightUiHandler extends UiHandler {
|
|||||||
messageHandler.bg.setVisible(false);
|
messageHandler.bg.setVisible(false);
|
||||||
messageHandler.commandWindow.setVisible(false);
|
messageHandler.commandWindow.setVisible(false);
|
||||||
messageHandler.movesWindowContainer.setVisible(true);
|
messageHandler.movesWindowContainer.setVisible(true);
|
||||||
|
const pokemon = (this.scene.getCurrentPhase() as CommandPhase).getPokemon();
|
||||||
|
if (pokemon.battleSummonData.turnCount <= 1) {
|
||||||
|
this.setCursor(0);
|
||||||
|
} else {
|
||||||
this.setCursor(this.getCursor());
|
this.setCursor(this.getCursor());
|
||||||
|
}
|
||||||
this.displayMoves();
|
this.displayMoves();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||||||
this.partyContainer.setVisible(true);
|
this.partyContainer.setVisible(true);
|
||||||
this.partyBg.setTexture(`party_bg${this.scene.currentBattle.double ? "_double" : ""}`);
|
this.partyBg.setTexture(`party_bg${this.scene.currentBattle.double ? "_double" : ""}`);
|
||||||
this.populatePartySlots();
|
this.populatePartySlots();
|
||||||
this.setCursor(this.cursor < 6 ? this.cursor : 0);
|
this.setCursor(0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user