[Localization] Localization arena flyout (Active Battle Effects) (#2932)

* localizing Active Battle Effects (working)

* Localize Active Battle Effects

* Change return value

* Modify arena terrain desc

* Update src/locales/zh_CN/arena-flyout.ts

Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>

* Update src/locales/de/arena-flyout.ts

Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>

* Update src/locales/fr/arena-flyout.ts

Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>

* Update arena-flyout.ts (IT)

* Update src/locales/pt_BR/arena-flyout.ts

Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>

* Update src/locales/es/arena-flyout.ts

Co-authored-by: Arxxer <javiptn7@gmail.com>

* Change util function name

---------

Co-authored-by: 송지원 <jiwsong@gmarket.com>
Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>
Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
Co-authored-by: Lugiad' <adrien.grivel@hotmail.fr>
Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com>
Co-authored-by: José Ricardo Fleury Oliveira <josefleury@discente.ufg.br>
Co-authored-by: Arxxer <javiptn7@gmail.com>
This commit is contained in:
Enoch 2024-07-12 00:28:51 +09:00 committed by GitHub
parent 74941bd7f8
commit 2f550ea933
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 490 additions and 16 deletions

View File

@ -53,7 +53,7 @@ import * as Overrides from "./overrides";
import {InputsController} from "./inputs-controller";
import {UiInputs} from "./ui-inputs";
import { NewArenaEvent } from "./events/battle-scene";
import ArenaFlyout from "./ui/arena-flyout";
import { ArenaFlyout } from "./ui/arena-flyout";
import { EaseType } from "#enums/ease-type";
import { Abilities } from "#enums/abilities";
import { BattleSpec } from "#enums/battle-spec";

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "Aktive Kampfeffekte",
"player": "Spieler",
"neutral": "Neutral",
"enemy": "Gegner",
// WeatherType
"sunny": "Sonne",
"rain": "Regen",
"sandstorm": "Sandsturm",
"hail": "Hagelsturm",
"snow": "Schneesturm",
"fog": "Nebel",
"heavyRain": "Strömender Regen",
"harshSun": "Sehr starker Sonnenschein",
"strongWinds": "Luftströmungen",
// TerrainType
"misty": "Nebelfeld",
"electric": "Elektrofeld",
"grassy": "Grasfeld",
"psychic": "Psychofeld",
// ArenaTagType
"mudSport": "Lehmsuhler",
"waterSport": "Nassmacher",
"spikes": "Stachler",
"toxicSpikes": "Giftspitzen",
"mist": "Weißnebel",
"futureSight": "Seher",
"doomDesire": "Kismetwunsch",
"wish": "Wunschtraum",
"stealthRock": "Tarnsteine",
"stickyWeb": "Klebenetz",
"trickRoom": "Bizarroraum",
"gravity": "Erdanziehung",
"reflect": "Reflektor",
"lightScreen": "Lichtschild",
"auroraVeil": "Auroraschleier",
"quickGuard": "Rapidschutz",
"wideGuard": "Rundumschutz",
"matBlock": "Tatami-Schild",
"craftyShield": "Trickschutz",
"tailwind": "Rückenwind",
"happyHour": "Goldene Zeiten",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const deConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "Active Battle Effects",
"player": "Player",
"neutral": "Neutral",
"enemy": "Enemy",
// WeatherType
"sunny": "Sunny",
"rain": "Rain",
"sandstorm": "Sandstorm",
"hail": "Hail",
"snow": "Snow",
"fog": "Fog",
"heavyRain": "Heavy Rain",
"harshSun": "Harsh Sun",
"strongWinds": "Strong Winds",
// TerrainType
"misty": "Misty Terrain",
"electric": "Electric Terrain",
"grassy": "Grassy Terrain",
"psychic": "Psychic Terrain",
// ArenaTagType
"mudSport": "Mud Sport",
"waterSport": "Water Sport",
"spikes": "Spikes",
"toxicSpikes": "Toxic Spikes",
"mist": "Mist",
"futureSight": "Future Sight",
"doomDesire": "Doom Desire",
"wish": "Wish",
"stealthRock": "Stealth Rock",
"stickyWeb": "Sticky Web",
"trickRoom": "Trick Room",
"gravity": "Gravity",
"reflect": "Reflect",
"lightScreen": "Light Screen",
"auroraVeil": "Aurora Veil",
"quickGuard": "Quick Guard",
"wideGuard": "Wide Guard",
"matBlock": "Mat Block",
"craftyShield": "Crafty Shield",
"tailwind": "Tailwind",
"happyHour": "Happy Hour",
};

View File

@ -2,6 +2,7 @@ import { common } from "./common.js";
import { settings } from "./settings.js";
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const enConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "Efectos de Terreno Activos",
"player": "Jugador",
"neutral": "Neutral",
"enemy": "Enemigo",
// WeatherType
"sunny": "Sol",
"rain": "Lluvia",
"sandstorm": "Tormenta de Arena",
"hail": "Granizo",
"snow": "Nieve",
"fog": "Niebla",
"heavyRain": "Diluvio",
"harshSun": "Sol Abrasador",
"strongWinds": "Turbulencias",
// TerrainType
"misty": "Campo de Niebla",
"electric": "Campo Eléctrico",
"grassy": "Campo de Hierba",
"psychic": "Campo Psíquico",
// ArenaTagType
"mudSport": "Chapoteo Lodo",
"waterSport": "Hidrochorro",
"spikes": "Púas",
"toxicSpikes": "Púas Tóxicas",
"mist": "Neblina",
"futureSight": "Premonición",
"doomDesire": "Deseo Oculto",
"wish": "Deseo",
"stealthRock": "Trampa Rocas",
"stickyWeb": "Red Vidcosa",
"trickRoom": "Espacio Raro",
"gravity": "Gravedad",
"reflect": "Reflejo",
"lightScreen": "Pantalla de Luz",
"auroraVeil": "Velo Aurora",
"quickGuard": "Anticipo",
"wideGuard": "Vasta Guardia",
"matBlock": "Escudo Tatami",
"craftyShield": "Truco Defensa",
"tailwind": "Viento Afín",
"happyHour": "Paga Extra",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const esConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "Effets Actifs",
"player": "Vous",
"neutral": "Neutre",
"enemy": "Ennemi",
// WeatherType
"sunny": "Soleil",
"rain": "Pluie",
"sandstorm": "Tempête de Sable",
"hail": "Grêle",
"snow": "Neige",
"fog": "Brouillard",
"heavyRain": "Pluie Battante",
"harshSun": "Soleil Brulant",
"strongWinds": "Vent Mystérieux",
// TerrainType
"misty": "Champ Brumeux",
"electric": "Champ Électrifié",
"grassy": "Champ Herbu",
"psychic": "Champ Psychique",
// ArenaTagType
"mudSport": "Lance-Boue",
"waterSport": "Tourniquet",
"spikes": "Picots",
"toxicSpikes": "Pics Toxik",
"mist": "Brume",
"futureSight": "Prescience",
"doomDesire": "Vœu Destructeur",
"wish": "Vœu",
"stealthRock": "Piège de Roc",
"stickyWeb": "Toile Gluante",
"trickRoom": "Distorsion",
"gravity": "Gravité",
"reflect": "Protection",
"lightScreen": "Mur Lumière",
"auroraVeil": "Voile Aurore",
"quickGuard": "Prévention",
"wideGuard": "Garde Large",
"matBlock": "Tatamigaeshi",
"craftyShield": "Vigilance",
"tailwind": "Vent Arrière",
"happyHour": "Étrennes",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const frConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "Effetti attivi in campo",
"player": "Giocatore",
"neutral": "Neutrali",
"enemy": "Nemico",
// WeatherType
"sunny": "Sole",
"rain": "Pioggia",
"sandstorm": "Tempesta di sabbia",
"hail": "Grandine",
"snow": "Neve",
"fog": "Nebbia",
"heavyRain": "Acquazzone",
"harshSun": "Luce accecante",
"strongWinds": "Corrente d'aria misteriosa",
// TerrainType
"misty": "Campo Nebbioso",
"electric": "Campo Elettrico",
"grassy": "Campo Erboso",
"psychic": "Campo Psichico",
// ArenaTagType
"mudSport": "Fangata",
"waterSport": "Docciascudo",
"spikes": "Punte",
"toxicSpikes": "Fielepunte",
"mist": "Nebbia",
"futureSight": "Divinazione",
"doomDesire": "Desiderio Fatale",
"wish": "Desiderio",
"stealthRock": "Levitoroccia",
"stickyWeb": "Rete Vischiosa",
"trickRoom": "Distortozona",
"gravity": "Gravità",
"reflect": "Riflesso",
"lightScreen": "Schermoluce",
"auroraVeil": "Velaurora",
"quickGuard": "Anticipo",
"wideGuard": "Bodyguard",
"matBlock": "Ribaltappeto",
"craftyShield": "Truccodifesa",
"tailwind": "Ventoincoda",
"happyHour": "Cuccagna",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const itConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "배틀 효과 상태",
"player": "플레이어",
"neutral": "공통",
"enemy": "상대",
// WeatherType
"sunny": "쾌청",
"rain": "비",
"sandstorm": "모래바람",
"hail": "싸라기눈",
"snow": "눈",
"fog": "안개",
"heavyRain": "강한 비",
"harshSun": "강한 쾌청",
"strongWinds": "난기류",
// TerrainType
"misty": "미스트필드",
"electric": "일렉트릭필드",
"grassy": "그래스필드",
"psychic": "사이코필드",
// ArenaTagType
"mudSport": "흙놀이",
"waterSport": "물놀이",
"spikes": "압정",
"toxicSpikes": "독압정",
"mist": "흰안개",
"futureSight": "미래예지",
"doomDesire": "파멸의소원",
"wish": "희망사항",
"stealthRock": "스텔스록",
"stickyWeb": "끈적끈적네트",
"trickRoom": "트릭룸",
"gravity": "중력",
"reflect": "리플렉터",
"lightScreen": "빛의장막",
"auroraVeil": "오로라베일",
"quickGuard": "패스트가드",
"wideGuard": "와이드가드",
"matBlock": "마룻바닥세워막기",
"craftyShield": "트릭가드",
"tailwind": "순풍",
"happyHour": "해피타임",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const koConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "Efeitos de Batalha Ativos",
"player": "Jogador",
"neutral": "Neutro",
"enemy": "Inimigo",
// WeatherType
"sunny": "Ensolarado",
"rain": "Chuva",
"sandstorm": "Tempestade de Areia",
"hail": "Granizo",
"snow": "Neve",
"fog": "Névoa",
"heavyRain": "Chuva Forte",
"harshSun": "Sol Forte",
"strongWinds": "Ventos Fortes",
// TerrainType
"misty": "Terreno Enevoado",
"electric": "Terreno Elétrico",
"grassy": "Terreno de Planta",
"psychic": "Terreno Psíquico",
// ArenaTagType
"mudSport": "Mud Sport",
"waterSport": "Water Sport",
"spikes": "Spikes",
"toxicSpikes": "Toxic Spikes",
"mist": "Mist",
"futureSight": "Future Sight",
"doomDesire": "Doom Desire",
"wish": "Wish",
"stealthRock": "Stealth Rock",
"stickyWeb": "Sticky Web",
"trickRoom": "Trick Room",
"gravity": "Gravity",
"reflect": "Reflect",
"lightScreen": "Light Screen",
"auroraVeil": "Aurora Veil",
"quickGuard": "Quick Guard",
"wideGuard": "Wide Guard",
"matBlock": "Mat Block",
"craftyShield": "Crafty Shield",
"tailwind": "Tailwind",
"happyHour": "Happy Hour",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const ptBrConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "当前战斗效果",
"player": "我方",
"neutral": "全局",
"enemy": "敌方",
// WeatherType
"sunny": "大晴天",
"rain": "下雨",
"sandstorm": "沙暴",
"hail": "冰雹",
"snow": "下雪",
"fog": "起雾",
"heavyRain": "大雨",
"harshSun": "大日照",
"strongWinds": "乱流",
// TerrainType
"misty": "薄雾场地",
"electric": "电气场地",
"grassy": "青草场地",
"psychic": "精神场地",
// ArenaTagType
"mudSport": "玩泥巴",
"waterSport": "玩水",
"spikes": "撒菱",
"toxicSpikes": "毒菱",
"mist": "白雾",
"futureSight": "预知未来",
"doomDesire": "破灭之愿",
"wish": "祈愿",
"stealthRock": "隐形岩",
"stickyWeb": "黏黏网",
"trickRoom": "戏法空间",
"gravity": "重力",
"reflect": "反射壁",
"lightScreen": "光墙",
"auroraVeil": "极光幕",
"quickGuard": "快速防守",
"wideGuard": "广域防守",
"matBlock": "掀榻榻米",
"craftyShield": "戏法防守",
"tailwind": "顺风",
"happyHour": "快乐时光",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const zhCnConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -0,0 +1,49 @@
import { SimpleTranslationEntries } from "#app/interfaces/locales";
export const arenaFlyout: SimpleTranslationEntries = {
// Title
"activeBattleEffects": "Active Battle Effects",
"player": "Player",
"neutral": "Neutral",
"enemy": "Enemy",
// WeatherType
"sunny": "Sunny",
"rain": "Rain",
"sandstorm": "Sandstorm",
"hail": "Hail",
"snow": "Snow",
"fog": "Fog",
"heavyRain": "Heavy Rain",
"harshSun": "Harsh Sun",
"strongWinds": "Strong Winds",
// TerrainType
"misty": "Misty Terrain",
"electric": "Electric Terrain",
"grassy": "Grassy Terrain",
"psychic": "Psychic Terrain",
// ArenaTagType
"mudSport": "Mud Sport",
"waterSport": "Water Sport",
"spikes": "Spikes",
"toxicSpikes": "Toxic Spikes",
"mist": "Mist",
"futureSight": "Future Sight",
"doomDesire": "Doom Desire",
"wish": "Wish",
"stealthRock": "Stealth Rock",
"stickyWeb": "Sticky Web",
"trickRoom": "Trick Room",
"gravity": "Gravity",
"reflect": "Reflect",
"lightScreen": "Light Screen",
"auroraVeil": "Aurora Veil",
"quickGuard": "Quick Guard",
"wideGuard": "Wide Guard",
"matBlock": "Mat Block",
"craftyShield": "Crafty Shield",
"tailwind": "Tailwind",
"happyHour": "Happy Hour",
};

View File

@ -1,5 +1,6 @@
import { ability } from "./ability";
import { abilityTriggers } from "./ability-trigger";
import { arenaFlyout } from "./arena-flyout";
import { PGFachv, PGMachv } from "./achv";
import { battle } from "./battle";
import { battleMessageUiHandler } from "./battle-message-ui-handler";
@ -50,6 +51,7 @@ import { modifierSelectUiHandler } from "./modifier-select-ui-handler";
export const zhTwConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
arenaFlyout: arenaFlyout,
battle: battle,
battleMessageUiHandler: battleMessageUiHandler,
berry: berry,

View File

@ -9,6 +9,7 @@ import { BattleSceneEventType, TurnEndEvent } from "../events/battle-scene";
import { ArenaTagType } from "#enums/arena-tag-type";
import TimeOfDayWidget from "./time-of-day-widget";
import * as Utils from "../utils";
import i18next, {ParseKeys} from "i18next";
/** Enum used to differentiate {@linkcode Arena} effects */
enum ArenaEffectType {
@ -33,7 +34,17 @@ interface ArenaEffectInfo {
tagType?: ArenaTagType;
}
export default class ArenaFlyout extends Phaser.GameObjects.Container {
export function getFieldEffectText(arenaTagType: string): string {
if (!arenaTagType || arenaTagType === ArenaTagType.NONE) {
return arenaTagType;
}
const effectName = Utils.toCamelCaseString(arenaTagType);
const i18nKey = `arenaFlyout:${effectName}` as ParseKeys;
const resultName = i18next.t(i18nKey);
return (!resultName || resultName === i18nKey) ? Utils.formatText(arenaTagType) : resultName;
}
export class ArenaFlyout extends Phaser.GameObjects.Container {
/** An alias for the scene typecast to a {@linkcode BattleScene} */
private battleScene: BattleScene;
@ -111,7 +122,7 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container {
this.flyoutContainer.add(this.flyoutWindowHeader);
this.flyoutTextHeader = addTextObject(this.scene, this.flyoutWidth / 2, 0, "Active Battle Effects", TextStyle.BATTLE_INFO);
this.flyoutTextHeader = addTextObject(this.scene, this.flyoutWidth / 2, 0, i18next.t("arenaFlyout:activeBattleEffects"), TextStyle.BATTLE_INFO);
this.flyoutTextHeader.setFontSize(54);
this.flyoutTextHeader.setAlign("center");
this.flyoutTextHeader.setOrigin();
@ -121,21 +132,21 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container {
this.timeOfDayWidget = new TimeOfDayWidget(this.scene, (this.flyoutWidth / 2) + (this.flyoutWindowHeader.displayWidth / 2));
this.flyoutContainer.add(this.timeOfDayWidget);
this.flyoutTextHeaderPlayer = addTextObject(this.scene, 6, 5, "Player", TextStyle.SUMMARY_BLUE);
this.flyoutTextHeaderPlayer = addTextObject(this.scene, 6, 5, i18next.t("arenaFlyout:player"), TextStyle.SUMMARY_BLUE);
this.flyoutTextHeaderPlayer.setFontSize(54);
this.flyoutTextHeaderPlayer.setAlign("left");
this.flyoutTextHeaderPlayer.setOrigin(0, 0);
this.flyoutContainer.add(this.flyoutTextHeaderPlayer);
this.flyoutTextHeaderField = addTextObject(this.scene, this.flyoutWidth / 2, 5, "Neutral", TextStyle.SUMMARY_GREEN);
this.flyoutTextHeaderField = addTextObject(this.scene, this.flyoutWidth / 2, 5, i18next.t("arenaFlyout:neutral"), TextStyle.SUMMARY_GREEN);
this.flyoutTextHeaderField.setFontSize(54);
this.flyoutTextHeaderField.setAlign("center");
this.flyoutTextHeaderField.setOrigin(0.5, 0);
this.flyoutContainer.add(this.flyoutTextHeaderField);
this.flyoutTextHeaderEnemy = addTextObject(this.scene, this.flyoutWidth - 6, 5, "Enemy", TextStyle.SUMMARY_RED);
this.flyoutTextHeaderEnemy = addTextObject(this.scene, this.flyoutWidth - 6, 5, i18next.t("arenaFlyout:enemy"), TextStyle.SUMMARY_RED);
this.flyoutTextHeaderEnemy.setFontSize(54);
this.flyoutTextHeaderEnemy.setAlign("right");
this.flyoutTextHeaderEnemy.setOrigin(1, 0);
@ -221,10 +232,7 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container {
break;
}
textObject.text += Utils.formatText(fieldEffectInfo.name);
if (fieldEffectInfo.effecType === ArenaEffectType.TERRAIN) {
textObject.text += " Terrain"; // Adds 'Terrain' since the enum does not contain it
}
textObject.text += fieldEffectInfo.name;
if (fieldEffectInfo.maxDuration !== 0) {
textObject.text += " " + fieldEffectInfo.duration + "/" + fieldEffectInfo.maxDuration;
@ -260,7 +268,7 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container {
}
const existingTrapTagIndex = isArenaTrapTag ? this.fieldEffectInfo.findIndex(e => tagAddedEvent.arenaTagType === e.tagType && arenaEffectType === e.effecType) : -1;
let name: string = ArenaTagType[tagAddedEvent.arenaTagType];
let name: string = getFieldEffectText(ArenaTagType[tagAddedEvent.arenaTagType]);
if (isArenaTrapTag) {
if (existingTrapTagIndex !== -1) {
@ -295,15 +303,15 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container {
// Stores the old Weather/Terrain name in case it's in the array already
const oldName =
fieldEffectChangedEvent instanceof WeatherChangedEvent
? WeatherType[fieldEffectChangedEvent.oldWeatherType]
: TerrainType[fieldEffectChangedEvent.oldTerrainType];
getFieldEffectText(fieldEffectChangedEvent instanceof WeatherChangedEvent
? WeatherType[fieldEffectChangedEvent.oldWeatherType]
: TerrainType[fieldEffectChangedEvent.oldTerrainType]);
// Stores the new Weather/Terrain info
const newInfo = {
name:
fieldEffectChangedEvent instanceof WeatherChangedEvent
getFieldEffectText(fieldEffectChangedEvent instanceof WeatherChangedEvent
? WeatherType[fieldEffectChangedEvent.newWeatherType]
: TerrainType[fieldEffectChangedEvent.newTerrainType],
: TerrainType[fieldEffectChangedEvent.newTerrainType]),
effecType: fieldEffectChangedEvent instanceof WeatherChangedEvent
? ArenaEffectType.WEATHER
: ArenaEffectType.TERRAIN,

View File

@ -409,6 +409,13 @@ export function formatText(unformattedText: string): string {
return text.join(" ");
}
export function toCamelCaseString(unformattedText: string): string {
if (!unformattedText) {
return "";
}
return unformattedText.split(/[_ ]/).filter(f => f).map((f, i) => i ? `${f[0].toUpperCase()}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join("");
}
export function rgbToHsv(r: integer, g: integer, b: integer) {
const v = Math.max(r, g, b);
const c = v - Math.min(r, g, b);