[UI] egg and starter formatting (#2043)

* egg and starter formatting

* localization update

* localization update

* fix local voucher test

* pr comments

* pr comments

* account for new font
This commit is contained in:
Matthew 2024-06-10 21:58:01 -04:00 committed by GitHub
parent f6a6c2da1b
commit 8d75670a81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 63 additions and 58 deletions

View File

@ -30,12 +30,12 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"selectMoveSwapWith": "Wähle die gewünschte Attacke.",
"unlockPassive": "Passiv-Skill freischalten",
"reduceCost": "Preis reduzieren",
"cycleShiny": "R: Schillernd Ja/Nein",
"cycleForm": "F: Form ändern",
"cycleGender": "G: Geschlecht ändern",
"cycleAbility": "E: Fähigkeit ändern",
"cycleNature": "N: Wesen Ändern",
"cycleVariant": "V: Seltenheit ändern",
"cycleShiny": ": Schillernd",
"cycleForm": ": Form",
"cycleGender": ": Geschlecht",
"cycleAbility": ": Fähigkeit",
"cycleNature": ": Wesen",
"cycleVariant": ": Seltenheit",
"enablePassive": "Passiv-Skill aktivieren",
"disablePassive": "Passiv-Skill deaktivieren",
"locked": "Gesperrt",

View File

@ -30,12 +30,12 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"selectMoveSwapWith": "Select a move to swap with",
"unlockPassive": "Unlock Passive",
"reduceCost": "Reduce Cost",
"cycleShiny": ": Cycle Shiny",
"cycleForm": ": Cycle Form",
"cycleGender": ": Cycle Gender",
"cycleAbility": ": Cycle Ability",
"cycleNature": ": Cycle Nature",
"cycleVariant": ": Cycle Variant",
"cycleShiny": ": Shiny",
"cycleForm": ": Form",
"cycleGender": ": Gender",
"cycleAbility": ": Ability",
"cycleNature": ": Nature",
"cycleVariant": ": Variant",
"enablePassive": "Enable Passive",
"disablePassive": "Disable Passive",
"locked": "Locked",

View File

@ -30,12 +30,12 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"selectMoveSwapWith": "Elige el movimiento que sustituirá a",
"unlockPassive": "Añadir Pasiva",
"reduceCost": "Reducir Coste",
"cycleShiny": ": Cambiar Shiny",
"cycleForm": ": Cambiar Forma",
"cycleGender": ": Cambiar Género",
"cycleAbility": ": Cambiar Habilidad",
"cycleNature": ": Cambiar Naturaleza",
"cycleVariant": ": Cambiar Variante",
"cycleShiny": ": Shiny",
"cycleForm": ": Forma",
"cycleGender": ": Género",
"cycleAbility": ": Habilidad",
"cycleNature": ": Naturaleza",
"cycleVariant": ": Variante",
"enablePassive": "Activar Pasiva",
"disablePassive": "Desactivar Pasiva",
"locked": "Bloqueado",

View File

@ -30,12 +30,12 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"selectMoveSwapWith": "Seleziona una mossa da scambiare con",
"unlockPassive": "Sblocca Passiva",
"reduceCost": "Riduci Costo",
"cycleShiny": ": Alterna Shiny",
"cycleForm": ": Alterna Forma",
"cycleGender": ": Alterna Sesso",
"cycleAbility": ": Alterna Abilità",
"cycleNature": ": Alterna Natura",
"cycleVariant": ": Alterna Variante",
"cycleShiny": ": Shiny",
"cycleForm": ": Forma",
"cycleGender": ": Sesso",
"cycleAbility": ": Abilità",
"cycleNature": ": Natura",
"cycleVariant": ": Variante",
"enablePassive": "Attiva Passiva",
"disablePassive": "Disattiva Passiva",
"locked": "Bloccato",

View File

@ -31,11 +31,11 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"unlockPassive": "패시브 해금",
"reduceCost": "코스트 줄이기",
"cycleShiny": ": 특별한 색",
"cycleForm": ": 폼 체인지",
"cycleGender": ": 암수 전환",
"cycleAbility": ": 특성 전환",
"cycleNature": ": 성격 전환",
"cycleVariant": ": 색상 전환",
"cycleForm": ": 폼",
"cycleGender": ": 암수",
"cycleAbility": ": 특성",
"cycleNature": ": 성격",
"cycleVariant": ": 색상",
"enablePassive": "패시브 활성화",
"disablePassive": "패시브 비활성화",
"locked": "잠김",

View File

@ -30,12 +30,12 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"selectMoveSwapWith": "选择要替换成的招式",
"unlockPassive": "解锁被动",
"reduceCost": "降低花费",
"cycleShiny": ": 切换闪光",
"cycleForm": ": 切换形态",
"cycleGender": ": 切换性别",
"cycleAbility": ": 切换特性",
"cycleNature": ": 切换性格",
"cycleVariant": ": 切换变种",
"cycleShiny": ": 闪光",
"cycleForm": ": 形态",
"cycleGender": ": 性别",
"cycleAbility": ": 特性",
"cycleNature": ": 性格",
"cycleVariant": ": 变种",
"enablePassive": "启用被动",
"disablePassive": "禁用被动",
"locked": "未解锁",

View File

@ -30,12 +30,12 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"selectMoveSwapWith": "選擇想要替換成的招式",
"unlockPassive": "解鎖被動",
"reduceCost": "降低花費",
"cycleShiny": ": 切換閃光",
"cycleForm": ": 切換形態",
"cycleGender": ": 切換性別",
"cycleAbility": ": 切換特性",
"cycleNature": ": 切換性格",
"cycleVariant": ": 切換變種",
"cycleShiny": ": 閃光",
"cycleForm": ": 形態",
"cycleGender": ": 性別",
"cycleAbility": ": 特性",
"cycleNature": ": 性格",
"cycleVariant": ": 變種",
"enablePassive": "啟用被動",
"disablePassive": "禁用被動",
"locked": "未解鎖",

View File

@ -156,15 +156,27 @@ export default class EggGachaUiHandler extends MessageUiHandler {
this.eggGachaOptionSelectBg.setOrigin(1, 1);
this.eggGachaOptionsContainer.add(this.eggGachaOptionSelectBg);
const multiplierOne = "x1";
const multiplierTen = "x10";
const pullOptions = [
{ multiplier: "x1", description: `1 ${i18next.t("egg:pull")}` },
{ multiplier: "x10", description: `10 ${i18next.t("egg:pulls")}` },
{ multiplier: "x1", description: `5 ${i18next.t("egg:pulls")}` },
{ multiplier: "x1", description: `10 ${i18next.t("egg:pulls")}` },
{ multiplier: "x1", description: `25 ${i18next.t("egg:pulls")}` }
{ multiplier: multiplierOne, description: `1 ${i18next.t("egg:pull")}`, icon: getVoucherTypeIcon(VoucherType.REGULAR) },
{ multiplier: multiplierTen, description: `10 ${i18next.t("egg:pulls")}`, icon: getVoucherTypeIcon(VoucherType.REGULAR) },
{ multiplier: multiplierOne, description: `5 ${i18next.t("egg:pulls")}`, icon: getVoucherTypeIcon(VoucherType.PLUS) },
{ multiplier: multiplierOne, description: `10 ${i18next.t("egg:pulls")}`, icon: getVoucherTypeIcon(VoucherType.PREMIUM) },
{ multiplier: multiplierOne, description: `25 ${i18next.t("egg:pulls")}`, icon: getVoucherTypeIcon(VoucherType.GOLDEN) }
];
const pullOptionsText = pullOptions.map(option => ` ${option.multiplier.padEnd(4)} ${option.description}`).join("\n");
const { resolvedLanguage } = i18next;
const pullOptionsText = pullOptions.map(option =>{
const desc = option.description.split(" ");
if (desc[0].length < 2) {
desc[0] += ["zh", "ko"].includes(resolvedLanguage.substring(0,2)) ? " " : " ";
}
if (option.multiplier === multiplierOne) {
desc[0] = " " + desc[0];
}
return ` ${option.multiplier.padEnd(5)}${desc.join(" ")}`;
}).join("\n");
const optionText = addTextObject(
this.scene,
@ -181,9 +193,8 @@ export default class EggGachaUiHandler extends MessageUiHandler {
optionText.setPositionRelative(this.eggGachaOptionSelectBg, 16, 9);
new Array(5).fill(null).map((_, i) => {
const voucherType = i < 2 ? VoucherType.REGULAR : i === 2 ? VoucherType.PLUS : i === 3 ? VoucherType.PREMIUM : VoucherType.GOLDEN;
const icon = this.scene.add.sprite(0, 0, "items", getVoucherTypeIcon(voucherType));
pullOptions.forEach((option, i) => {
const icon = this.scene.add.sprite(0, 0, "items", option.icon);
icon.setScale(0.5);
icon.setPositionRelative(this.eggGachaOptionSelectBg, 20, 17 + i * 16);
this.eggGachaOptionsContainer.add(icon);
@ -396,7 +407,8 @@ export default class EggGachaUiHandler extends MessageUiHandler {
const timestamp = new Date().getTime();
for (const tier of tiers) {
const egg = new Egg(Utils.randInt(EGG_SEED, EGG_SEED * tier), this.gachaCursor, getEggTierDefaultHatchWaves(tier), timestamp);
const eggId = Utils.randInt(EGG_SEED, EGG_SEED * tier);
const egg = new Egg(eggId, this.gachaCursor, getEggTierDefaultHatchWaves(tier), timestamp);
if (egg.isManaphyEgg()) {
this.scene.gameData.gameStats.manaphyEggsPulled++;
egg.hatchWaves = getEggTierDefaultHatchWaves(EggTier.ULTRA);

View File

@ -98,13 +98,6 @@ export default class EggListUiHandler extends MessageUiHandler {
let e = 0;
/*this.scene.gameData.eggs = [
new Egg(1, 1, 5, new Date().getTime()),
new Egg(1 + EGG_SEED, 1, 15, new Date().getTime()),
new Egg(1 + EGG_SEED * 2, 1, 50, new Date().getTime()),
new Egg(1 + EGG_SEED * 3, GachaType.LEGENDARY, 100, new Date().getTime())
];*/
for (const egg of this.scene.gameData.eggs) {
const x = (e % 11) * 18;
const y = Math.floor(e / 11) * 18;