From 732ce1c330bf29ef83f8b9f17d2473b4d3bc8ad0 Mon Sep 17 00:00:00 2001 From: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> Date: Sat, 6 Jul 2024 02:38:27 +0900 Subject: [PATCH 1/4] [Localization] update korean translation on learning move UI (#2810) --- src/locales/ko/party-ui-handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/ko/party-ui-handler.ts b/src/locales/ko/party-ui-handler.ts index 842f10209..f00758093 100644 --- a/src/locales/ko/party-ui-handler.ts +++ b/src/locales/ko/party-ui-handler.ts @@ -35,8 +35,8 @@ export const partyUiHandler: SimpleTranslationEntries = { "cancel": "그만둔다", // Slot TM text - "able": "배울 수 있다", - "notAble": "배울 수 없다", + "able": "배운다!", + "notAble": "배우지 못함", "learned": "알고 있다", // Releasing messages From 759e4d0288700445d532d519d3d9f291d867fecb Mon Sep 17 00:00:00 2001 From: Mumble Date: Fri, 5 Jul 2024 10:46:36 -0700 Subject: [PATCH 2/4] [QoL] Summary option when new Pokemon caught and party is full (#2242) * Option to view Summary before adding new Pokemon to party * Fixed issues described by HopsWas * Adjusted makeRoomForConfirmUi to improve window spacing * Fixed ESLint issue + addressed OrangeRed review * Fixed Github pages issue * Removed duplicate unshiftPhase * Fixed phase order --------- Co-authored-by: Frutescens --- src/phases.ts | 17 +++++++++---- src/ui/confirm-ui-handler.ts | 41 ++++++++++++++++++++++++++++++-- src/ui/pokemon-info-container.ts | 5 ++-- src/ui/summary-ui-handler.ts | 11 +++++++-- 4 files changed, 64 insertions(+), 10 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index df7314e62..40a2683b0 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -4890,7 +4890,10 @@ export class AttemptCapturePhase extends PokemonPhase { }); } }, - onComplete: () => this.catch() + onComplete: () => { + this.scene.gameData.setPokemonCaught(pokemon); + this.catch(); + } }); }; @@ -4931,7 +4934,6 @@ export class AttemptCapturePhase extends PokemonPhase { catch() { const pokemon = this.getPokemon() as EnemyPokemon; - this.scene.unshiftPhase(new VictoryPhase(this.scene, this.battlerIndex)); const speciesForm = !pokemon.fusionSpecies ? pokemon.getSpeciesForm() : pokemon.getFusionSpeciesForm(); @@ -4957,6 +4959,7 @@ export class AttemptCapturePhase extends PokemonPhase { this.scene.ui.showText(i18next.t("battle:pokemonCaught", { pokemonName: pokemon.name }), null, () => { const end = () => { + this.scene.unshiftPhase(new VictoryPhase(this.scene, this.battlerIndex)); this.scene.pokemonInfoContainer.hide(); this.removePb(); this.end(); @@ -4985,12 +4988,18 @@ export class AttemptCapturePhase extends PokemonPhase { } }); }; - Promise.all([pokemon.hideInfo(), this.scene.gameData.setPokemonCaught(pokemon)]).then(() => { + Promise.all([pokemon.hideInfo()]).then(() => { if (this.scene.getParty().length === 6) { const promptRelease = () => { this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.name }), null, () => { - this.scene.pokemonInfoContainer.makeRoomForConfirmUi(); + this.scene.pokemonInfoContainer.makeRoomForConfirmUi(1, true); this.scene.ui.setMode(Mode.CONFIRM, () => { + const newPokemon = this.scene.addPlayerPokemon(pokemon.species, pokemon.level, pokemon.abilityIndex, pokemon.formIndex, pokemon.gender, pokemon.shiny, pokemon.variant, pokemon.ivs, pokemon.nature, pokemon); + this.scene.ui.setMode(Mode.SUMMARY, newPokemon).then(() => { + this.catch(); + return; + }); + }, () => { this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => { this.scene.ui.setMode(Mode.MESSAGE).then(() => { if (slotIndex < 6) { diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index 953ed4972..49c4782a8 100644 --- a/src/ui/confirm-ui-handler.ts +++ b/src/ui/confirm-ui-handler.ts @@ -20,7 +20,45 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler { } show(args: any[]): boolean { - if (args.length >= 2 && args[0] instanceof Function && args[1] instanceof Function) { + if (args.length === 3 && args[0].toString().includes("newPokemon")) { + const config: OptionSelectConfig = { + options: [ + { + label: i18next.t("partyUiHandler:SUMMARY"), + handler: () => { + args[0](); + return false; + }, + }, { + label: i18next.t("menu:yes"), + handler: () => { + args[1](); + return true; + } + }, { + label: i18next.t("menu:no"), + handler: () => { + args[2](); + return true; + } + } + ], + delay: args.length >= 7 && args[6] !== null ? args[6] as integer : 0 + }; + + super.show([ config ]); + + this.switchCheck = args.length >= 4 && args[3] !== null && args[3] as boolean; + + const xOffset = (args.length >= 5 && args[4] !== null ? args[4] as number : 0); + const yOffset = (args.length >= 6 && args[5] !== null ? args[5] as number : 0); + + this.optionSelectContainer.setPosition((this.scene.game.canvas.width / 6) - 1 + xOffset, -48 + yOffset); + + this.setCursor(this.switchCheck ? this.switchCheckCursor : 0); + + return true; + } else if (args.length >= 2 && args[0] instanceof Function && args[1] instanceof Function) { const config: OptionSelectConfig = { options: [ { @@ -54,7 +92,6 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler { return true; } - return false; } diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 9f4df2b20..1e958ae53 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -364,13 +364,14 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { }); } - makeRoomForConfirmUi(speedMultiplier: number = 1): Promise { + makeRoomForConfirmUi(speedMultiplier: number = 1, fromCatch: boolean = false): Promise { + const xPosition = fromCatch ? this.initialX - this.infoWindowWidth - 65 : this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth; return new Promise(resolve => { this.scene.tweens.add({ targets: this, duration: Utils.fixedInt(Math.floor(150 / speedMultiplier)), ease: "Cubic.easeInOut", - x: this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth, + x: xPosition, onComplete: () => { resolve(); } diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index ae94951bc..33a74c549 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -397,7 +397,7 @@ export default class SummaryUiHandler extends UiHandler { } const ui = this.getUi(); - + const fromPartyMode = ui.handlers[Mode.PARTY].active; let success = false; let error = false; @@ -485,7 +485,12 @@ export default class SummaryUiHandler extends UiHandler { if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) { this.hideMoveSelect(); } else { - ui.setMode(Mode.PARTY); + + if (!fromPartyMode) { + ui.setMode(Mode.MESSAGE); + } else { + ui.setMode(Mode.PARTY); + } } success = true; } else { @@ -495,6 +500,8 @@ export default class SummaryUiHandler extends UiHandler { case Button.DOWN: if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) { break; + } else if (!fromPartyMode) { + break; } const isDown = button === Button.DOWN; const party = this.scene.getParty(); From 10dd16fa1e20a9fdd60fb864a22bc4a505d89a25 Mon Sep 17 00:00:00 2001 From: EmberCM Date: Fri, 5 Jul 2024 12:50:19 -0500 Subject: [PATCH 3/4] [QoL] Add red color to the quantity if the item is at it's held limit (#2221) * Add red color to the quantity if the item is at it's held limit * Add shadow back to option text * Attempt to fix transfer item crash and add tests for transferring items * remove .js file extensions from test file imports * Fix import paths for transfer-item.test --- src/test/ui/transfer-item.test.ts | 100 ++++++++++++++++++++++++++++++ src/ui/party-ui-handler.ts | 47 +++++++++----- 2 files changed, 132 insertions(+), 15 deletions(-) create mode 100644 src/test/ui/transfer-item.test.ts diff --git a/src/test/ui/transfer-item.test.ts b/src/test/ui/transfer-item.test.ts new file mode 100644 index 000000000..336e5bccd --- /dev/null +++ b/src/test/ui/transfer-item.test.ts @@ -0,0 +1,100 @@ +import { BerryType } from "#app/enums/berry-type"; +import { Moves } from "#app/enums/moves"; +import { Species } from "#app/enums/species"; +import { Button } from "#app/enums/buttons"; +import * as overrides from "#app/overrides"; +import { + BattleEndPhase, + SelectModifierPhase +} from "#app/phases"; +import GameManager from "#app/test/utils/gameManager"; +import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; +import PartyUiHandler, { PartyUiMode } from "#app/ui/party-ui-handler"; +import { Mode } from "#app/ui/ui"; +import Phaser from "phaser"; +import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { getMovePosition } from "../utils/gameManagerUtils"; + + +describe("UI - Transfer Items", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(async () => { + game = new GameManager(phaserGame); + vi.spyOn(overrides, "SINGLE_BATTLE_OVERRIDE", "get").mockReturnValue(true); + vi.spyOn(overrides, "STARTING_LEVEL_OVERRIDE", "get").mockReturnValue(100); + vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(1); + vi.spyOn(overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue([ + { name: "BERRY", count: 1, type: BerryType.SITRUS }, + { name: "BERRY", count: 2, type: BerryType.APICOT }, + { name: "BERRY", count: 2, type: BerryType.LUM }, + ]); + vi.spyOn(overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.DRAGON_CLAW]); + vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MAGIKARP); + vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH]); + + await game.startBattle([Species.RAYQUAZA, Species.RAYQUAZA, Species.RAYQUAZA]); + + game.doAttack(getMovePosition(game.scene, 0, Moves.DRAGON_CLAW)); + + game.onNextPrompt("SelectModifierPhase", Mode.MODIFIER_SELECT, () => { + expect(game.scene.ui.getHandler()).toBeInstanceOf(ModifierSelectUiHandler); + + const handler = game.scene.ui.getHandler() as ModifierSelectUiHandler; + handler.setCursor(1); + handler.processInput(Button.ACTION); + + game.scene.ui.setModeWithoutClear(Mode.PARTY, PartyUiMode.MODIFIER_TRANSFER); + }); + + await game.phaseInterceptor.to(BattleEndPhase); + }); + + it("check red tint for held item limit in transfer menu", async () => { + game.onNextPrompt("SelectModifierPhase", Mode.PARTY, () => { + expect(game.scene.ui.getHandler()).toBeInstanceOf(PartyUiHandler); + + const handler = game.scene.ui.getHandler() as PartyUiHandler; + handler.processInput(Button.ACTION); + + expect(handler.optionsContainer.list.some((option) => (option as BBCodeText).text?.includes("Sitrus Berry"))).toBe(true); + expect(handler.optionsContainer.list.some((option) => (option as BBCodeText).text?.includes("Apicot Berry (2)"))).toBe(true); + expect(handler.optionsContainer.list.some((option) => RegExp(/Lum Berry\[color.*(2)/).exec((option as BBCodeText).text))).toBe(true); + + game.phaseInterceptor.unlock(); + }); + + await game.phaseInterceptor.to(SelectModifierPhase); + }, 20000); + + it("check transfer option for pokemon to transfer to", async () => { + game.onNextPrompt("SelectModifierPhase", Mode.PARTY, () => { + expect(game.scene.ui.getHandler()).toBeInstanceOf(PartyUiHandler); + + const handler = game.scene.ui.getHandler() as PartyUiHandler; + handler.processInput(Button.ACTION); // select Pokemon + handler.processInput(Button.ACTION); // select held item (Sitrus Berry) + + handler.setCursor(1); // move to other Pokemon + handler.processInput(Button.ACTION); // select Pokemon + + expect(handler.optionsContainer.list.some((option) => (option as BBCodeText).text?.includes("Transfer"))).toBe(true); + + game.phaseInterceptor.unlock(); + }); + + await game.phaseInterceptor.to(SelectModifierPhase); + }, 20000); +}); diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 7ddadf99a..e820c8cb0 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -1,12 +1,12 @@ import { CommandPhase, SelectModifierPhase } from "../phases"; import BattleScene from "../battle-scene"; import { PlayerPokemon, PokemonMove } from "../field/pokemon"; -import { addTextObject, TextStyle } from "./text"; +import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "./text"; import { Command } from "./command-ui-handler"; import MessageUiHandler from "./message-ui-handler"; import { Mode } from "./ui"; import * as Utils from "../utils"; -import { PokemonFormChangeItemModifier, PokemonHeldItemModifier, SwitchEffectTransferModifier } from "../modifier/modifier"; +import { PokemonBaseStatModifier, PokemonFormChangeItemModifier, PokemonHeldItemModifier, SwitchEffectTransferModifier } from "../modifier/modifier"; import { allMoves } from "../data/move"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { StatusEffect } from "../data/status-effect"; @@ -19,6 +19,7 @@ import {Button} from "#enums/buttons"; import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; import MoveInfoOverlay from "./move-info-overlay"; import i18next from "i18next"; +import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import { Moves } from "#enums/moves"; const defaultMessage = i18next.t("partyUiHandler:choosePokemon"); @@ -85,7 +86,8 @@ export default class PartyUiHandler extends MessageUiHandler { private optionsCursor: integer = 0; private optionsScrollCursor: integer = 0; private optionsScrollTotal: integer = 0; - private optionsContainer: Phaser.GameObjects.Container; + /** This is only public for test/ui/transfer-item.test.ts */ + public optionsContainer: Phaser.GameObjects.Container; private optionsBg: Phaser.GameObjects.NineSlice; private optionsCursorObj: Phaser.GameObjects.Image; private options: integer[]; @@ -819,7 +821,7 @@ export default class PartyUiHandler extends MessageUiHandler { optionEndIndex = this.options.length; let widestOptionWidth = 0; - const optionTexts: Phaser.GameObjects.Text[] = []; + const optionTexts: BBCodeText[] = []; for (let o = optionStartIndex; o < optionEndIndex; o++) { const option = this.options[this.options.length - (o + 1)]; @@ -861,27 +863,42 @@ export default class PartyUiHandler extends MessageUiHandler { const move = learnableLevelMoves[option]; optionName = allMoves[move].name; altText = !pokemon.getSpeciesForm().getLevelMoves().find(plm => plm[1] === move); + } else if (option === PartyOption.ALL) { + optionName = i18next.t("partyUiHandler:ALL"); } else { - if (option === PartyOption.ALL) { - optionName = i18next.t("partyUiHandler:ALL"); - } else { - const itemModifier = itemModifiers[option]; - optionName = itemModifier.type.name; - /** For every item that has stack bigger than 1, display the current quantity selection */ - if (this.transferQuantitiesMax[option] > 1) { - optionName += ` (${this.transferQuantities[option]})`; - } - } + const itemModifier = itemModifiers[option]; + optionName = itemModifier.type.name; } const yCoord = -6 - 16 * o; - const optionText = addTextObject(this.scene, 0, yCoord - 16, optionName, TextStyle.WINDOW); + const optionText = addBBCodeTextObject(this.scene, 0, yCoord - 16, optionName, TextStyle.WINDOW, { maxLines: 1 }); if (altText) { optionText.setColor("#40c8f8"); optionText.setShadowColor("#006090"); } optionText.setOrigin(0, 0); + /** For every item that has stack bigger than 1, display the current quantity selection */ + if (this.partyUiMode === PartyUiMode.MODIFIER_TRANSFER && this.transferQuantitiesMax[option] > 1) { + const itemModifier = itemModifiers[option]; + + /** Not sure why getMaxHeldItemCount had an error, but it only checks the Pokemon parameter if the modifier is PokemonBaseStatModifier */ + if (itemModifier === undefined || itemModifier instanceof PokemonBaseStatModifier) { + continue; + } + + let amountText = ` (${this.transferQuantities[option]})`; + + /** If the amount held is the maximum, display the count in red */ + if (this.transferQuantitiesMax[option] === itemModifier.getMaxHeldItemCount(undefined)) { + amountText = `[color=${getTextColor(TextStyle.SUMMARY_RED)}]${amountText}[/color]`; + } + + optionText.setText(optionName + amountText); + } + + optionText.setText(`[shadow]${optionText.text}[/shadow]`); + optionTexts.push(optionText); widestOptionWidth = Math.max(optionText.displayWidth, widestOptionWidth); From 160a5ce5aad73f399f6aaf5c9b6f47d3012e945e Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:01:11 -0700 Subject: [PATCH 4/4] Revert "[QoL] Summary option when new Pokemon caught and party is full (#2242)" (#2816) This reverts commit 759e4d0288700445d532d519d3d9f291d867fecb. --- src/phases.ts | 17 ++++--------- src/ui/confirm-ui-handler.ts | 41 ++------------------------------ src/ui/pokemon-info-container.ts | 5 ++-- src/ui/summary-ui-handler.ts | 11 ++------- 4 files changed, 10 insertions(+), 64 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index 40a2683b0..df7314e62 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -4890,10 +4890,7 @@ export class AttemptCapturePhase extends PokemonPhase { }); } }, - onComplete: () => { - this.scene.gameData.setPokemonCaught(pokemon); - this.catch(); - } + onComplete: () => this.catch() }); }; @@ -4934,6 +4931,7 @@ export class AttemptCapturePhase extends PokemonPhase { catch() { const pokemon = this.getPokemon() as EnemyPokemon; + this.scene.unshiftPhase(new VictoryPhase(this.scene, this.battlerIndex)); const speciesForm = !pokemon.fusionSpecies ? pokemon.getSpeciesForm() : pokemon.getFusionSpeciesForm(); @@ -4959,7 +4957,6 @@ export class AttemptCapturePhase extends PokemonPhase { this.scene.ui.showText(i18next.t("battle:pokemonCaught", { pokemonName: pokemon.name }), null, () => { const end = () => { - this.scene.unshiftPhase(new VictoryPhase(this.scene, this.battlerIndex)); this.scene.pokemonInfoContainer.hide(); this.removePb(); this.end(); @@ -4988,18 +4985,12 @@ export class AttemptCapturePhase extends PokemonPhase { } }); }; - Promise.all([pokemon.hideInfo()]).then(() => { + Promise.all([pokemon.hideInfo(), this.scene.gameData.setPokemonCaught(pokemon)]).then(() => { if (this.scene.getParty().length === 6) { const promptRelease = () => { this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.name }), null, () => { - this.scene.pokemonInfoContainer.makeRoomForConfirmUi(1, true); + this.scene.pokemonInfoContainer.makeRoomForConfirmUi(); this.scene.ui.setMode(Mode.CONFIRM, () => { - const newPokemon = this.scene.addPlayerPokemon(pokemon.species, pokemon.level, pokemon.abilityIndex, pokemon.formIndex, pokemon.gender, pokemon.shiny, pokemon.variant, pokemon.ivs, pokemon.nature, pokemon); - this.scene.ui.setMode(Mode.SUMMARY, newPokemon).then(() => { - this.catch(); - return; - }); - }, () => { this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => { this.scene.ui.setMode(Mode.MESSAGE).then(() => { if (slotIndex < 6) { diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index 49c4782a8..953ed4972 100644 --- a/src/ui/confirm-ui-handler.ts +++ b/src/ui/confirm-ui-handler.ts @@ -20,45 +20,7 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler { } show(args: any[]): boolean { - if (args.length === 3 && args[0].toString().includes("newPokemon")) { - const config: OptionSelectConfig = { - options: [ - { - label: i18next.t("partyUiHandler:SUMMARY"), - handler: () => { - args[0](); - return false; - }, - }, { - label: i18next.t("menu:yes"), - handler: () => { - args[1](); - return true; - } - }, { - label: i18next.t("menu:no"), - handler: () => { - args[2](); - return true; - } - } - ], - delay: args.length >= 7 && args[6] !== null ? args[6] as integer : 0 - }; - - super.show([ config ]); - - this.switchCheck = args.length >= 4 && args[3] !== null && args[3] as boolean; - - const xOffset = (args.length >= 5 && args[4] !== null ? args[4] as number : 0); - const yOffset = (args.length >= 6 && args[5] !== null ? args[5] as number : 0); - - this.optionSelectContainer.setPosition((this.scene.game.canvas.width / 6) - 1 + xOffset, -48 + yOffset); - - this.setCursor(this.switchCheck ? this.switchCheckCursor : 0); - - return true; - } else if (args.length >= 2 && args[0] instanceof Function && args[1] instanceof Function) { + if (args.length >= 2 && args[0] instanceof Function && args[1] instanceof Function) { const config: OptionSelectConfig = { options: [ { @@ -92,6 +54,7 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler { return true; } + return false; } diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 1e958ae53..9f4df2b20 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -364,14 +364,13 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { }); } - makeRoomForConfirmUi(speedMultiplier: number = 1, fromCatch: boolean = false): Promise { - const xPosition = fromCatch ? this.initialX - this.infoWindowWidth - 65 : this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth; + makeRoomForConfirmUi(speedMultiplier: number = 1): Promise { return new Promise(resolve => { this.scene.tweens.add({ targets: this, duration: Utils.fixedInt(Math.floor(150 / speedMultiplier)), ease: "Cubic.easeInOut", - x: xPosition, + x: this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth, onComplete: () => { resolve(); } diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 33a74c549..ae94951bc 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -397,7 +397,7 @@ export default class SummaryUiHandler extends UiHandler { } const ui = this.getUi(); - const fromPartyMode = ui.handlers[Mode.PARTY].active; + let success = false; let error = false; @@ -485,12 +485,7 @@ export default class SummaryUiHandler extends UiHandler { if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) { this.hideMoveSelect(); } else { - - if (!fromPartyMode) { - ui.setMode(Mode.MESSAGE); - } else { - ui.setMode(Mode.PARTY); - } + ui.setMode(Mode.PARTY); } success = true; } else { @@ -500,8 +495,6 @@ export default class SummaryUiHandler extends UiHandler { case Button.DOWN: if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) { break; - } else if (!fromPartyMode) { - break; } const isDown = button === Button.DOWN; const party = this.scene.getParty();