diff --git a/src/locales/de/starter-select-ui-handler.ts b/src/locales/de/starter-select-ui-handler.ts index e8ae4ed201e..eb0d444cbd5 100644 --- a/src/locales/de/starter-select-ui-handler.ts +++ b/src/locales/de/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": Fähigkeit", "cycleNature": ": Wesen", "cycleVariant": ": Seltenheit", + "goFilter": ": Zu den Filtern", "enablePassive": "Passiv-Skill aktivieren", "disablePassive": "Passiv-Skill deaktivieren", "locked": "Gesperrt", diff --git a/src/locales/en/starter-select-ui-handler.ts b/src/locales/en/starter-select-ui-handler.ts index deb4236c8ba..63641479585 100644 --- a/src/locales/en/starter-select-ui-handler.ts +++ b/src/locales/en/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": Ability", "cycleNature": ": Nature", "cycleVariant": ": Variant", + "goFilter": ": Go to filters", "enablePassive": "Enable Passive", "disablePassive": "Disable Passive", "locked": "Locked", diff --git a/src/locales/es/starter-select-ui-handler.ts b/src/locales/es/starter-select-ui-handler.ts index d7c203f49c4..3bb655ddceb 100644 --- a/src/locales/es/starter-select-ui-handler.ts +++ b/src/locales/es/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": Habilidad", "cycleNature": ": Naturaleza", "cycleVariant": ": Variante", + "goFilter": ": Ir a filtros", "enablePassive": "Activar Pasiva", "disablePassive": "Desactivar Pasiva", "locked": "Bloqueado", diff --git a/src/locales/fr/starter-select-ui-handler.ts b/src/locales/fr/starter-select-ui-handler.ts index dbd056cbf2a..fbd407a1450 100644 --- a/src/locales/fr/starter-select-ui-handler.ts +++ b/src/locales/fr/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": Talent", "cycleNature": ": Nature", "cycleVariant": ": Variant", + "goFilter": ": Aller aux filtres", "enablePassive": "Activer Passif", "disablePassive": "Désactiver Passif", "locked": "Verrouillé", diff --git a/src/locales/it/starter-select-ui-handler.ts b/src/locales/it/starter-select-ui-handler.ts index 6f43b9415e0..9ef5ccbe3ee 100644 --- a/src/locales/it/starter-select-ui-handler.ts +++ b/src/locales/it/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": Abilità", "cycleNature": ": Natura", "cycleVariant": ": Variante", + "goFilter": ": Go to filters", "enablePassive": "Attiva passiva", "disablePassive": "Disattiva passiva", "locked": "Bloccato", diff --git a/src/locales/ko/starter-select-ui-handler.ts b/src/locales/ko/starter-select-ui-handler.ts index 25bb006059e..722780807b6 100644 --- a/src/locales/ko/starter-select-ui-handler.ts +++ b/src/locales/ko/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": 특성", "cycleNature": ": 성격", "cycleVariant": ": 색상", + "goFilter": ": 필터로 이동", "enablePassive": "패시브 활성화", "disablePassive": "패시브 비활성화", "locked": "잠김", diff --git a/src/locales/pt_BR/starter-select-ui-handler.ts b/src/locales/pt_BR/starter-select-ui-handler.ts index 660076da413..8bc045f76a9 100644 --- a/src/locales/pt_BR/starter-select-ui-handler.ts +++ b/src/locales/pt_BR/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": » Habilidade", "cycleNature": ": » Natureza", "cycleVariant": ": » Variante", + "goFilter": ": Ir para filtros", "enablePassive": "Ativar Passiva", "disablePassive": "Desativar Passiva", "locked": "Bloqueada", diff --git a/src/locales/zh_CN/starter-select-ui-handler.ts b/src/locales/zh_CN/starter-select-ui-handler.ts index c9c1cf501ef..39bab560eac 100644 --- a/src/locales/zh_CN/starter-select-ui-handler.ts +++ b/src/locales/zh_CN/starter-select-ui-handler.ts @@ -41,6 +41,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": 特性", "cycleNature": ": 性格", "cycleVariant": ": 变种", + "goFilter": ": 转到筛选", "enablePassive": "启用被动", "disablePassive": "禁用被动", "locked": "未解锁", diff --git a/src/locales/zh_TW/starter-select-ui-handler.ts b/src/locales/zh_TW/starter-select-ui-handler.ts index 1202bf45f0e..7aecd459178 100644 --- a/src/locales/zh_TW/starter-select-ui-handler.ts +++ b/src/locales/zh_TW/starter-select-ui-handler.ts @@ -42,6 +42,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = { "cycleAbility": ": 特性", "cycleNature": ": 性格", "cycleVariant": ": 變種", + "goFilter": ": 轉到篩選", "enablePassive": "啟用被動", "disablePassive": "禁用被動", "locked": "未解鎖", diff --git a/src/ui-inputs.ts b/src/ui-inputs.ts index 9288fd35892..d514ddb7823 100644 --- a/src/ui-inputs.ts +++ b/src/ui-inputs.ts @@ -79,7 +79,7 @@ export class UiInputs { [Button.ACTION]: () => this.buttonAb(Button.ACTION), [Button.CANCEL]: () => this.buttonAb(Button.CANCEL), [Button.MENU]: () => this.buttonMenu(), - [Button.STATS]: () => this.buttonStats(true), + [Button.STATS]: () => this.buttonGoToFilter(Button.STATS), [Button.CYCLE_SHINY]: () => this.buttonCycleOption(Button.CYCLE_SHINY), [Button.CYCLE_FORM]: () => this.buttonCycleOption(Button.CYCLE_FORM), [Button.CYCLE_GENDER]: () => this.buttonCycleOption(Button.CYCLE_GENDER), @@ -139,6 +139,17 @@ export class UiInputs { p.toggleStats(pressed); } } + + buttonGoToFilter(button: Button): void { + const whitelist = [StarterSelectUiHandler]; + const uiHandler = this.scene.ui?.getHandler(); + if (whitelist.some(handler => uiHandler instanceof handler)) { + this.scene.ui.processInput(button); + } else { + this.buttonStats(true); + } + } + buttonInfo(pressed: boolean = true): void { if (this.scene.showMovesetFlyout ) { for (const p of this.scene.getField().filter(p => p?.isActive(true))) { diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 5a6271cbc4b..43af8d456c1 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -70,8 +70,9 @@ const languageSettings: { [key: string]: LanguageSetting } = { instructionTextSize: "38px", }, "de":{ - starterInfoTextSize: "56px", + starterInfoTextSize: "48px", instructionTextSize: "35px", + starterInfoXPos: 33, }, "es":{ starterInfoTextSize: "56px", @@ -79,7 +80,7 @@ const languageSettings: { [key: string]: LanguageSetting } = { }, "fr":{ starterInfoTextSize: "54px", - instructionTextSize: "42px", + instructionTextSize: "35px", }, "it":{ starterInfoTextSize: "56px", @@ -91,9 +92,10 @@ const languageSettings: { [key: string]: LanguageSetting } = { starterInfoXPos: 33, }, "zh":{ - starterInfoTextSize: "40px", - instructionTextSize: "42px", - starterInfoYOffset: 2 + starterInfoTextSize: "47px", + instructionTextSize: "38px", + starterInfoYOffset: 1, + starterInfoXPos: 24, }, "pt":{ starterInfoTextSize: "48px", @@ -258,18 +260,21 @@ export default class StarterSelectUiHandler extends MessageUiHandler { private pokemonShinyIcon: Phaser.GameObjects.Sprite; private instructionsContainer: Phaser.GameObjects.Container; + private filterInstructionsContainer: Phaser.GameObjects.Container; private shinyIconElement: Phaser.GameObjects.Sprite; private formIconElement: Phaser.GameObjects.Sprite; private abilityIconElement: Phaser.GameObjects.Sprite; private genderIconElement: Phaser.GameObjects.Sprite; private natureIconElement: Phaser.GameObjects.Sprite; private variantIconElement: Phaser.GameObjects.Sprite; + private goFilterIconElement: Phaser.GameObjects.Sprite; private shinyLabel: Phaser.GameObjects.Text; private formLabel: Phaser.GameObjects.Text; private genderLabel: Phaser.GameObjects.Text; private abilityLabel: Phaser.GameObjects.Text; private natureLabel: Phaser.GameObjects.Text; private variantLabel: Phaser.GameObjects.Text; + private goFilterLabel: Phaser.GameObjects.Text; private starterSelectMessageBox: Phaser.GameObjects.NineSlice; private starterSelectMessageBoxContainer: Phaser.GameObjects.Container; @@ -329,7 +334,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler { //variables to keep track of the dynamically rendered list of instruction prompts for starter select private instructionRowX = 0; private instructionRowY = 0; - private instructionRowTextOffset = 12; + private instructionRowTextOffset = 9; + private filterInstructionRowX = 0; + private filterInstructionRowY = 0; private starterSelectCallback: StarterSelectCallback | null; @@ -825,8 +832,19 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.variantLabel = addTextObject(this.scene, this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:cycleVariant"), TextStyle.PARTY, { fontSize: instructionTextSize }); this.variantLabel.setName("text-variant-label"); + this.goFilterIconElement = new Phaser.GameObjects.Sprite(this.scene, this.filterInstructionRowX, this.filterInstructionRowY, "keyboard", "C.png"); + this.goFilterIconElement.setName("sprite-goFilter-icon-element"); + this.goFilterIconElement.setScale(0.675); + this.goFilterIconElement.setOrigin(0.0, 0.0); + this.goFilterLabel = addTextObject(this.scene, this.filterInstructionRowX + this.instructionRowTextOffset, this.filterInstructionRowY, i18next.t("starterSelectUiHandler:goFilter"), TextStyle.PARTY, { fontSize: instructionTextSize }); + this.goFilterLabel.setName("text-goFilter-label"); + this.hideInstructions(); + this.filterInstructionsContainer = this.scene.add.container(50, 5); + this.filterInstructionsContainer.setVisible(true); + this.starterSelectContainer.add(this.filterInstructionsContainer); + this.starterSelectMessageBoxContainer = this.scene.add.container(0, this.scene.game.canvas.height / 6); this.starterSelectMessageBoxContainer.setVisible(false); this.starterSelectContainer.add(this.starterSelectMessageBoxContainer); @@ -1175,6 +1193,16 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.tryExit(); success = true; } + } else if (button === Button.STATS) { + // if stats button is pressed, go to filter directly + if (!this.filterMode) { + this.startCursorObj.setVisible(false); + this.starterIconsCursorObj.setVisible(false); + this.setSpecies(null); + this.filterBarCursor = 0; + this.setFilterMode(true); + this.filterBar.toggleDropDown(this.filterBarCursor); + } } else if (this.startCursorObj.visible) { // this checks to see if the start button is selected switch (button) { case Button.ACTION: @@ -2026,6 +2054,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler { case SettingKeyboard.Button_Cycle_Variant: iconPath = "V.png"; break; + case SettingKeyboard.Button_Stats: + iconPath = "C.png"; + break; default: break; } @@ -2045,11 +2076,36 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } } + updateFilterButtonIcon(iconSetting, gamepadType, iconElement, controlLabel): void { + let iconPath; + // touch controls cannot be rebound as is, and are just emulating a keyboard event. + // Additionally, since keyboard controls can be rebound (and will be displayed when they are), we need to have special handling for the touch controls + if (gamepadType === "touch") { + gamepadType = "keyboard"; + iconPath = "C.png"; + } else { + iconPath = this.scene.inputController?.getIconForLatestInputRecorded(iconSetting); + } + iconElement.setTexture(gamepadType, iconPath); + iconElement.setPosition(this.filterInstructionRowX, this.filterInstructionRowY); + controlLabel.setPosition(this.filterInstructionRowX + this.instructionRowTextOffset, this.filterInstructionRowY); + iconElement.setVisible(true); + controlLabel.setVisible(true); + this.filterInstructionsContainer.add([iconElement, controlLabel]); + this.filterInstructionRowY += 8; + if (this.filterInstructionRowY >= 24) { + this.filterInstructionRowY = 0; + this.filterInstructionRowX += 50; + } + } updateInstructions(): void { this.instructionRowX = 0; this.instructionRowY = 0; + this.filterInstructionRowX = 0; + this.filterInstructionRowY = 0; this.hideInstructions(); this.instructionsContainer.removeAll(); + this.filterInstructionsContainer.removeAll(); let gamepadType; if (this.scene.inputMethod === "gamepad") { gamepadType = this.scene.inputController.getConfig(this.scene.inputController.selectedDevice[Device.GAMEPAD]).padType; @@ -2057,6 +2113,10 @@ export default class StarterSelectUiHandler extends MessageUiHandler { gamepadType = this.scene.inputMethod; } + if (!gamepadType) { + return; + } + if (this.speciesStarterDexEntry?.caughtAttr) { if (this.canCycleShiny) { this.updateButtonIcon(SettingKeyboard.Button_Cycle_Shiny, gamepadType, this.shinyIconElement, this.shinyLabel); @@ -2077,6 +2137,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.updateButtonIcon(SettingKeyboard.Button_Cycle_Variant, gamepadType, this.variantIconElement, this.variantLabel); } } + + // if filter mode is inactivated and gamepadType is not undefined, update the button icons + if (!this.filterMode) { + this.updateFilterButtonIcon(SettingKeyboard.Button_Stats, gamepadType, this.goFilterIconElement, this.goFilterLabel); + } + } getValueLimit(): integer { @@ -2398,6 +2464,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.setCursor(filterMode ? this.filterBarCursor : this.cursor); if (filterMode) { this.setSpecies(null); + this.updateInstructions(); } return true; @@ -3260,6 +3327,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.natureLabel.setVisible(false); this.variantIconElement.setVisible(false); this.variantLabel.setVisible(false); + this.goFilterIconElement.setVisible(false); + this.goFilterLabel.setVisible(false); } clear(): void {