fixed CN affixes inversion (double inversion…)

(cherry picked from commit 22a030675a)
This commit is contained in:
Amatsune 2024-06-25 03:44:50 +08:00 committed by mercurius-00
parent f885a54be4
commit 521c23401b
2 changed files with 23 additions and 4 deletions

View File

@ -53,15 +53,34 @@ export function getPokemonSpeciesForm(species: Species, formIndex: integer): Pok
export function getFusedSpeciesName(speciesA: PokemonSpecies, speciesB: PokemonSpecies): string {
let firstKey = "fusionPrefix";
let secondKey = "fusionSuffix";
const shouldReverse = i18next.t("fusionAffixes:shouldReverse");
console.log(`shouldReverse: ${shouldReverse}`); // logs the value of shouldReverse
if (i18next.t("fusionAffixes:shouldReverse") === "true") {
firstKey = "fusionSuffix";
secondKey = "fusionPrefix";
console.log(`firstKey: ${firstKey}, secondKey: ${secondKey}`); // logs the values of firstKey and secondKey
}
const prefix = i18next.t(`fusionAffixes:${Species[speciesA.speciesId].toLowerCase()}.${firstKey}`);
const suffix = i18next.t(`fusionAffixes:${Species[speciesB.speciesId].toLowerCase()}.${secondKey}`);
const radKey = i18next.t(`fusionAffixes:${Species[speciesA.speciesId].toLowerCase()}.${firstKey}`);
const desKey = i18next.t(`fusionAffixes:${Species[speciesB.speciesId].toLowerCase()}.${secondKey}`);
return `${prefix}${suffix}`;
let prefix = radKey;
let suffix = desKey;
if (i18next.t("fusionAffixes:shouldReverse") === "true") {
prefix = desKey;
suffix = radKey;
}
console.log(`prefix: ${prefix}, suffix: ${suffix}`); // logs the values of prefix and suffix
const fusedName =`${prefix}${suffix}`;
return fusedName;
}
export type PokemonSpeciesFilter = (species: PokemonSpecies) => boolean;

View File

@ -10,7 +10,7 @@ export interface SimpleTranslationEntries {
}
export interface FusionTranslationEntries {
shouldReverse: string,
shouldReverse?: string,
[key: string]: FusionTranslationEntry | string,
}