Fix modifier select screen transition issue

This commit is contained in:
Flashfyre 2023-04-22 11:46:52 -04:00
parent 362a94c658
commit 29771cfa8e
3 changed files with 22 additions and 20 deletions

View File

@ -1863,7 +1863,7 @@ export class SelectModifierPhase extends BattlePhase {
} else if (cursor >= typeOptions.length) {
this.scene.ui.setModeWithoutClear(Mode.PARTY, PartyUiMode.MODIFIER_TRANSFER, (fromSlotIndex: integer, itemIndex: integer, toSlotIndex: integer) => {
if (toSlotIndex !== undefined && fromSlotIndex < 6 && toSlotIndex < 6 && fromSlotIndex !== toSlotIndex && itemIndex > -1) {
this.scene.ui.setMode(Mode.MODIFIER_SELECT);
this.scene.ui.setMode(Mode.MODIFIER_SELECT).then(() => {
const itemModifiers = this.scene.findModifiers(m => m instanceof PokemonHeldItemModifier
&& (m as PokemonHeldItemModifier).pokemonId === party[fromSlotIndex].id) as PokemonHeldItemModifier[];
const itemModifier = itemModifiers[itemIndex];
@ -1874,6 +1874,7 @@ export class SelectModifierPhase extends BattlePhase {
} else
this.scene.ui.setMode(Mode.MODIFIER_SELECT, typeOptions, modifierSelectCallback);
});
});
} else
this.scene.ui.setMode(Mode.MODIFIER_SELECT, typeOptions, modifierSelectCallback);
}, PartyUiHandler.FilterItemMaxStacks);
@ -1886,7 +1887,7 @@ export class SelectModifierPhase extends BattlePhase {
const isMoveModifier = modifierType instanceof PokemonMoveModifierType;
this.scene.ui.setModeWithoutClear(Mode.PARTY, !isMoveModifier ? PartyUiMode.MODIFIER : PartyUiMode.MOVE_MODIFIER, (slotIndex: integer, option: PartyOption) => {
if (slotIndex < 6) {
this.scene.ui.setMode(Mode.MODIFIER_SELECT);
this.scene.ui.setMode(Mode.MODIFIER_SELECT).then(() => {
const modifierType = typeOptions[cursor].type;
const modifier = !isMoveModifier
? modifierType.newModifier(party[slotIndex])
@ -1894,6 +1895,7 @@ export class SelectModifierPhase extends BattlePhase {
this.scene.addModifier(modifier, true).then(() => super.end());
this.scene.ui.clearText();
this.scene.ui.setMode(Mode.MESSAGE);
});
} else
this.scene.ui.setMode(Mode.MODIFIER_SELECT, typeOptions, modifierSelectCallback);
}, pokemonModifierType.selectFilter, modifierType instanceof PokemonMoveModifierType ? (modifierType as PokemonMoveModifierType).moveSelectFilter : undefined);

View File

@ -212,7 +212,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
targets: this.options,
scale: 0.01,
duration: 250,
ease: 'Elastic.easeIn',
ease: 'Cubic.easeIn',
onComplete: () => {
this.options.forEach(o => o.destroy());
this.options.splice(0, this.options.length);

View File

@ -14,7 +14,7 @@ import EvolutionSceneHandler from './evolution-scene-handler';
import BiomeSelectUiHandler from './biome-select-ui-handler';
export enum Mode {
MESSAGE = 0,
MESSAGE,
COMMAND,
FIGHT,
BALL,