Fix Poke Ball localization
This commit is contained in:
parent
3c90427361
commit
87c1f5e50f
|
@ -17,7 +17,7 @@ import { TextStyle, addTextObject } from './ui/text';
|
||||||
import { Moves } from "./data/enums/moves";
|
import { Moves } from "./data/enums/moves";
|
||||||
import { allMoves } from "./data/move";
|
import { allMoves } from "./data/move";
|
||||||
import { initMoves } from './data/move';
|
import { initMoves } from './data/move';
|
||||||
import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesForWave } from './modifier/modifier-type';
|
import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesForWave, getModifierPoolForType } from './modifier/modifier-type';
|
||||||
import AbilityBar from './ui/ability-bar';
|
import AbilityBar from './ui/ability-bar';
|
||||||
import { BlockItemTheftAbAttr, DoubleBattleChanceAbAttr, IncrementMovePriorityAbAttr, applyAbAttrs, initAbilities } from './data/ability';
|
import { BlockItemTheftAbAttr, DoubleBattleChanceAbAttr, IncrementMovePriorityAbAttr, applyAbAttrs, initAbilities } from './data/ability';
|
||||||
import { Abilities } from "./data/enums/abilities";
|
import { Abilities } from "./data/enums/abilities";
|
||||||
|
@ -795,7 +795,10 @@ export default class BattleScene extends SceneBase {
|
||||||
this.trainer.setVisible(true);
|
this.trainer.setVisible(true);
|
||||||
|
|
||||||
if (reloadI18n) {
|
if (reloadI18n) {
|
||||||
const localizable: Localizable[] = [ ...allMoves ];
|
const localizable: Localizable[] = [
|
||||||
|
...allMoves,
|
||||||
|
...Utils.getEnumValues(ModifierPoolType).map(mpt => getModifierPoolForType(mpt)).map(mp => Object.values(mp).flat().map(mt => mt.modifierType).filter(mt => 'localize' in mt).map(lpb => lpb as unknown as Localizable)).flat()
|
||||||
|
];
|
||||||
for (let item of localizable)
|
for (let item of localizable)
|
||||||
item.localize();
|
item.localize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { VoucherType, getVoucherTypeIcon, getVoucherTypeName } from '../system/v
|
||||||
import { FormChangeItem, SpeciesFormChangeItemTrigger, pokemonFormChanges } from '../data/pokemon-forms';
|
import { FormChangeItem, SpeciesFormChangeItemTrigger, pokemonFormChanges } from '../data/pokemon-forms';
|
||||||
import { ModifierTier } from './modifier-tier';
|
import { ModifierTier } from './modifier-tier';
|
||||||
import { Nature, getNatureName, getNatureStatMultiplier } from '#app/data/nature';
|
import { Nature, getNatureName, getNatureStatMultiplier } from '#app/data/nature';
|
||||||
|
import { Localizable } from '#app/plugins/i18n';
|
||||||
|
|
||||||
const outputModifierData = false;
|
const outputModifierData = false;
|
||||||
const useMaxWeightForOutput = false;
|
const useMaxWeightForOutput = false;
|
||||||
|
@ -131,10 +132,19 @@ export interface GeneratedPersistentModifierType {
|
||||||
getPregenArgs(): any[];
|
getPregenArgs(): any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
class AddPokeballModifierType extends ModifierType {
|
class AddPokeballModifierType extends ModifierType implements Localizable {
|
||||||
|
private pokeballType: PokeballType;
|
||||||
|
private count: integer;
|
||||||
|
|
||||||
constructor(pokeballType: PokeballType, count: integer, iconImage?: string) {
|
constructor(pokeballType: PokeballType, count: integer, iconImage?: string) {
|
||||||
super(`${count}x ${getPokeballName(pokeballType)}`, `Receive ${getPokeballName(pokeballType)} x${count}\nCatch Rate: ${getPokeballCatchMultiplier(pokeballType) > -1 ? `${getPokeballCatchMultiplier(pokeballType)}x` : 'Certain'}`,
|
super('', '', (_type, _args) => new Modifiers.AddPokeballModifier(this, pokeballType, count), iconImage, 'pb', 'pb_bounce_1');
|
||||||
(_type, _args) => new Modifiers.AddPokeballModifier(this, pokeballType, count), iconImage, 'pb', 'pb_bounce_1');
|
this.pokeballType = pokeballType;
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
localize() {
|
||||||
|
this.name = `${this.count}x ${getPokeballName(this.pokeballType)}`;
|
||||||
|
this.description = `Receive ${getPokeballName(this.pokeballType)} x${this.count}\nCatch Rate: ${getPokeballCatchMultiplier(this.pokeballType) > -1 ? `${getPokeballCatchMultiplier(this.pokeballType)}x` : 'Certain'}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue