[Localization] Ability Bar can now be localized. In a way that pokemonName abilityNa… (#1921)

* Ability Bar can now be localized. In a way that pokemonName abilityName and passive string can be ordered freely

* Update src/locales/ko/fight-ui-handler.ts

Co-authored-by: returntoice <dieandbecome@gmail.com>

* Update src/locales/de/fight-ui-handler.ts

* Update src/locales/de/fight-ui-handler.ts

---------

Co-authored-by: returntoice <dieandbecome@gmail.com>
This commit is contained in:
Jannik Tappert 2024-06-12 15:45:20 +02:00 committed by GitHub
parent 124ef7065f
commit 6e52bc7980
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 26 additions and 12 deletions

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "AP",
"power": "Stärke",
"accuracy": "Genauigkeit",
"abilityFlyInText": "{{passive}}{{abilityName}} von {{pokemonName}} wirkt!",
"passive": "Passive Fähigkeit ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Power",
"accuracy": "Accuracy",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Potencia",
"accuracy": "Precisión",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Puissance",
"accuracy": "Précision",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Potenza",
"accuracy": "Precisione",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "위력",
"accuracy": "명중률",
"abilityFlyInText": " {{pokemonName}}의 {{passive}}{{abilityName}}",
"passive": "패시브 ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "Poder",
"accuracy": "Precisão",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "威力",
"accuracy": "命中",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ", // The space at the end is important
} as const;

View File

@ -4,4 +4,6 @@ export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "威力",
"accuracy": "命中率",
"abilityFlyInText": " {{pokemonName}}'s {{passive}}{{abilityName}}",
"passive": "Passive ", // The space at the end is important
} as const;

View File

@ -1,6 +1,7 @@
import BattleScene from "../battle-scene";
import Pokemon from "../field/pokemon";
import { TextStyle, addTextObject } from "./text";
import i18next from "i18next";
const hiddenX = -118;
const shownX = 0;
@ -8,8 +9,7 @@ const baseY = -116;
export default class AbilityBar extends Phaser.GameObjects.Container {
private bg: Phaser.GameObjects.Image;
private pokemonNameText: Phaser.GameObjects.Text;
private abilityNameText: Phaser.GameObjects.Text;
private abilityBarText: Phaser.GameObjects.Text;
private tween: Phaser.Tweens.Tween;
private autoHideTimer: NodeJS.Timeout;
@ -26,21 +26,17 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
this.add(this.bg);
this.pokemonNameText = addTextObject(this.scene, 15, 3, "", TextStyle.MESSAGE, { fontSize: "72px" });
this.pokemonNameText.setOrigin(0, 0);
this.add(this.pokemonNameText);
this.abilityNameText = addTextObject(this.scene, 97, 16, "", TextStyle.WINDOW, { fontSize: "72px" });
this.abilityNameText.setOrigin(1, 0);
this.add(this.abilityNameText);
this.abilityBarText = addTextObject(this.scene, 15, 3, "", TextStyle.MESSAGE, { fontSize: "72px" });
this.abilityBarText.setOrigin(0, 0);
this.abilityBarText.setWordWrapWidth(600, true);
this.add(this.abilityBarText);
this.setVisible(false);
this.shown = false;
}
showAbility(pokemon: Pokemon, passive: boolean = false): void {
this.pokemonNameText.setText(`${pokemon.name}'s${passive ? " Passive" : ""}`);
this.abilityNameText.setText((!passive ? pokemon.getAbility() : pokemon.getPassiveAbility()).name);
this.abilityBarText.setText(`${i18next.t("fightUiHandler:abilityFlyInText", { pokemonName: pokemon.name, passive: passive ? i18next.t("fightUiHandler:passive") : "", abilityName: !passive ? pokemon.getAbility().name : pokemon.getPassiveAbility().name })}`);
if (this.shown) {
return;