From 6946abadb8e25f7a4e73c7bd07e0afa22741360c Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Mon, 30 Dec 2024 16:35:45 +0100 Subject: [PATCH 1/2] [UI/UX] Add cursor memory option (#5028) * Adding a new key determining whether the command cursor resets at the beginning of each new battle. * Allowing user to toggle commandCursorReset on and off. * Changing option name to commandCursorMemory * Fixed caps in settings.ts * Moved Command_Cursor_Memory from Display settings to General settings --- src/battle-scene.ts | 1 + src/phases/command-phase.ts | 8 +++++++- src/system/settings/settings.ts | 11 +++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c430a12ae3e..11950f0a47f 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -147,6 +147,7 @@ export default class BattleScene extends SceneBase { public damageNumbersMode: integer = 0; public reroll: boolean = false; public shopCursorTarget: number = ShopCursorTarget.REWARDS; + public commandCursorMemory: boolean = false; public showMovesetFlyout: boolean = true; public showArenaFlyout: boolean = true; public showTimeOfDayWidget: boolean = true; diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index eab76282908..fa85f2427e5 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -35,8 +35,14 @@ export class CommandPhase extends FieldPhase { this.scene.updateGameInfo(); const commandUiHandler = this.scene.ui.handlers[Mode.COMMAND]; + + // If one of these conditions is true, we always reset the cursor to Command.FIGHT + const cursorResetEvent = this.scene.currentBattle.battleType === BattleType.MYSTERY_ENCOUNTER || + this.scene.currentBattle.battleType === BattleType.TRAINER || + this.scene.arena.biomeType === Biome.END; + if (commandUiHandler) { - if (this.scene.currentBattle.turn === 1 || commandUiHandler.getCursor() === Command.POKEMON) { + if ((this.scene.currentBattle.turn === 1 && (!this.scene.commandCursorMemory || cursorResetEvent)) || commandUiHandler.getCursor() === Command.POKEMON) { commandUiHandler.setCursor(Command.FIGHT); } else { commandUiHandler.setCursor(commandUiHandler.getCursor()); diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index 64ddfdae5cf..ebdcad1c4f9 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -157,6 +157,7 @@ export const SettingKeys = { Move_Animations: "MOVE_ANIMATIONS", Show_Stats_on_Level_Up: "SHOW_LEVEL_UP_STATS", Shop_Cursor_Target: "SHOP_CURSOR_TARGET", + Command_Cursor_Memory: "COMMAND_CURSOR_MEMORY", Candy_Upgrade_Notification: "CANDY_UPGRADE_NOTIFICATION", Candy_Upgrade_Display: "CANDY_UPGRADE_DISPLAY", Move_Info: "MOVE_INFO", @@ -339,6 +340,13 @@ export const Setting: Array = [ default: 0, type: SettingType.GENERAL }, + { + key: SettingKeys.Command_Cursor_Memory, + label: i18next.t("settings:commandCursorMemory"), + options: OFF_ON, + default: 0, + type: SettingType.GENERAL + }, { key: SettingKeys.Enable_Retries, label: i18next.t("settings:enableRetries"), @@ -827,6 +835,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer): const selectedValue = shopCursorTargetIndexMap[value]; scene.shopCursorTarget = selectedValue; break; + case SettingKeys.Command_Cursor_Memory: + scene.commandCursorMemory = Setting[index].options[value].value === "On"; + break; case SettingKeys.EXP_Gains_Speed: scene.expGainsSpeed = value; break; From 1b6374f4697c2cdb77c30eca694acf4a43ece8e9 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:55:28 -0800 Subject: [PATCH 2/2] [UI/UX] Change label for music settings (#5053) Changes from "Consistent/Mixed" to "Gen V + PMD"/"All Gens" Update `MusicPreferences` enum * Update locales submodule --- public/locales | 2 +- src/battle-scene.ts | 2 +- src/battle.ts | 6 +++--- .../encounters/global-trade-system-encounter.ts | 2 +- src/system/settings/settings.ts | 14 +++++++------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/public/locales b/public/locales index 6c6f0af398a..b28ba1255c8 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit 6c6f0af398ae11f8d96c6ac064f171d927812c85 +Subproject commit b28ba1255c8db12cb07947f88635cb6be0143a15 diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 11950f0a47f..327ab1cc926 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -174,7 +174,7 @@ export default class BattleScene extends SceneBase { public uiTheme: UiTheme = UiTheme.DEFAULT; public windowType: integer = 0; public experimentalSprites: boolean = false; - public musicPreference: number = MusicPreference.MIXED; + public musicPreference: number = MusicPreference.ALLGENS; public moveAnimations: boolean = true; public expGainsSpeed: ExpGainsSpeed = ExpGainsSpeed.DEFAULT; public skipSeenDialogues: boolean = false; diff --git a/src/battle.ts b/src/battle.ts index 75f0dff2534..38ee7b5eae0 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -222,7 +222,7 @@ export default class Battle { if (!this.started && this.trainer?.config.encounterBgm && this.trainer?.getEncounterMessages()?.length) { return `encounter_${this.trainer?.getEncounterBgm()}`; } - if (scene.musicPreference === MusicPreference.CONSISTENT) { + if (scene.musicPreference === MusicPreference.GENFIVE) { return this.trainer?.getBattleBgm() ?? null; } else { return this.trainer?.getMixedBattleBgm() ?? null; @@ -239,7 +239,7 @@ export default class Battle { return "battle_final_encounter"; } if (pokemon.species.legendary || pokemon.species.subLegendary || pokemon.species.mythical) { - if (scene.musicPreference === MusicPreference.CONSISTENT) { + if (scene.musicPreference === MusicPreference.GENFIVE) { switch (pokemon.species.speciesId) { case Species.REGIROCK: case Species.REGICE: @@ -256,7 +256,7 @@ export default class Battle { } return "battle_legendary_unova"; } - } else if (scene.musicPreference === MusicPreference.MIXED) { + } else if (scene.musicPreference === MusicPreference.ALLGENS) { switch (pokemon.species.speciesId) { case Species.ARTICUNO: case Species.ZAPDOS: diff --git a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts index fa445d75d4f..b7376c2bfd2 100644 --- a/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts +++ b/src/data/mystery-encounters/encounters/global-trade-system-encounter.ts @@ -107,7 +107,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = // Load bgm let bgmKey: string; - if (scene.musicPreference === MusicPreference.CONSISTENT) { + if (scene.musicPreference === MusicPreference.GENFIVE) { bgmKey = "mystery_encounter_gen_5_gts"; scene.loadBgm(bgmKey, `${bgmKey}.mp3`); } else { diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index ebdcad1c4f9..0a11648c171 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -181,8 +181,8 @@ export const SettingKeys = { }; export enum MusicPreference { - CONSISTENT, - MIXED + GENFIVE, + ALLGENS } /** @@ -670,15 +670,15 @@ export const Setting: Array = [ label: i18next.t("settings:musicPreference"), options: [ { - value: "Consistent", - label: i18next.t("settings:consistent") + value: "Gen V + PMD", + label: i18next.t("settings:musicGenFive") }, { - value: "Mixed", - label: i18next.t("settings:mixed") + value: "All Gens", + label: i18next.t("settings:musicAllGens") } ], - default: MusicPreference.MIXED, + default: MusicPreference.ALLGENS, type: SettingType.AUDIO, requireReload: true },