From 39f91167c7a72ee348527a563f76b14674e45b70 Mon Sep 17 00:00:00 2001 From: ImperialSympathizer Date: Fri, 12 Jul 2024 15:57:12 -0400 Subject: [PATCH] PR cleanup and commit suggestions --- src/data/mystery-encounters/mystery-encounter-utils.ts | 8 -------- src/data/mystery-encounters/mystery-encounter.ts | 4 ++-- src/locales/en/mystery-encounter.ts | 1 + 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/data/mystery-encounters/mystery-encounter-utils.ts b/src/data/mystery-encounters/mystery-encounter-utils.ts index 20022bdca30..5c6e7eefa8d 100644 --- a/src/data/mystery-encounters/mystery-encounter-utils.ts +++ b/src/data/mystery-encounters/mystery-encounter-utils.ts @@ -181,14 +181,6 @@ function getTextWithDialogueTokens(scene: BattleScene, textKey: TemplateStringsA return null; } - // Apply dialogue tokens - // const dialogueTokens = scene.currentBattle?.mysteryEncounter?.dialogueTokens; - // if (dialogueTokens) { - // dialogueTokens.forEach((value) => { - // textString = textString.replace(value[0], value[1]); - // }); - // } - return i18next.t(textKey, scene.currentBattle?.mysteryEncounter?.dialogueTokens); } diff --git a/src/data/mystery-encounters/mystery-encounter.ts b/src/data/mystery-encounters/mystery-encounter.ts index b54d0f17665..e02639939b8 100644 --- a/src/data/mystery-encounters/mystery-encounter.ts +++ b/src/data/mystery-encounters/mystery-encounter.ts @@ -95,7 +95,7 @@ export default interface IMysteryEncounter { * Can be set for uses programatic dialogue during an encounter (storing the name of one of the party's pokemon, etc.) * Example use: see MYSTERIOUS_CHEST */ - dialogueTokens?: { [key: string]: string; }; + dialogueTokens?: Record; /** * Should be set depending upon option selected as part of an encounter * For example, if there is no battle as part of the encounter/selected option, should be set to NO_BATTLE @@ -350,7 +350,7 @@ export class MysteryEncounterBuilder implements Partial { primaryPokemonRequirements?: EncounterPokemonRequirement[] = []; secondaryPokemonRequirements ?: EncounterPokemonRequirement[] = []; excludePrimaryFromSupportRequirements?: boolean; - dialogueTokens?: { [key: string]: string; }; + dialogueTokens?: Record; doEncounterExp?: (scene: BattleScene) => boolean; doEncounterRewards?: (scene: BattleScene) => boolean; onInit?: (scene: BattleScene) => boolean; diff --git a/src/locales/en/mystery-encounter.ts b/src/locales/en/mystery-encounter.ts index d68848e4a37..9101b22d520 100644 --- a/src/locales/en/mystery-encounter.ts +++ b/src/locales/en/mystery-encounter.ts @@ -6,6 +6,7 @@ import { SimpleTranslationEntries } from "#app/interfaces/locales"; * '@d{}' will add a time delay to text animation for Message and Dialogue strings * * '{{}}' will auto-inject the matching token value for the specified Encounter that is stored in dialogueTokens + * (see [i18next interpolations](https://www.i18next.com/translation-function/interpolation)) * * '@[]{}' will auto-color the given text to a specified TextStyle (e.g. TextStyle.SUMMARY_GREEN) *