blocking inputs while showing texts to prevent moveing cursor (#2371)
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
335d32e0d7
commit
a41133a55a
|
@ -166,6 +166,8 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||||
|
|
||||||
private iconAnimHandler: PokemonIconAnimHandler;
|
private iconAnimHandler: PokemonIconAnimHandler;
|
||||||
|
|
||||||
|
private blockInput: boolean;
|
||||||
|
|
||||||
private static FilterAll = (_pokemon: PlayerPokemon) => null;
|
private static FilterAll = (_pokemon: PlayerPokemon) => null;
|
||||||
|
|
||||||
public static FilterNonFainted = (pokemon: PlayerPokemon) => {
|
public static FilterNonFainted = (pokemon: PlayerPokemon) => {
|
||||||
|
@ -317,7 +319,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||||
processInput(button: Button): boolean {
|
processInput(button: Button): boolean {
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
|
|
||||||
if (this.pendingPrompt) {
|
if (this.pendingPrompt || this.blockInput) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,7 +487,9 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||||
this.clearOptions();
|
this.clearOptions();
|
||||||
ui.playSelect();
|
ui.playSelect();
|
||||||
if (this.cursor >= this.scene.currentBattle.getBattlerCount() || !pokemon.isAllowedInBattle()) {
|
if (this.cursor >= this.scene.currentBattle.getBattlerCount() || !pokemon.isAllowedInBattle()) {
|
||||||
|
this.blockInput = true;
|
||||||
this.showText(i18next.t("partyUiHandler:releaseConfirmation", { pokemonName: getPokemonNameWithAffix(pokemon) }), null, () => {
|
this.showText(i18next.t("partyUiHandler:releaseConfirmation", { pokemonName: getPokemonNameWithAffix(pokemon) }), null, () => {
|
||||||
|
this.blockInput = false;
|
||||||
ui.setModeWithoutClear(Mode.CONFIRM, () => {
|
ui.setModeWithoutClear(Mode.CONFIRM, () => {
|
||||||
ui.setMode(Mode.PARTY);
|
ui.setMode(Mode.PARTY);
|
||||||
this.doRelease(this.cursor);
|
this.doRelease(this.cursor);
|
||||||
|
|
Loading…
Reference in New Issue