[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.", "selectMoveSwapWith": "Wähle die gewünschte Attacke.",
"unlockPassive": "Passiv-Skill freischalten", "unlockPassive": "Passiv-Skill freischalten",
"reduceCost": "Preis reduzieren", "reduceCost": "Preis reduzieren",
"cycleShiny": "R: Schillernd Ja/Nein", "cycleShiny": ": Schillernd",
"cycleForm": "F: Form ändern", "cycleForm": ": Form",
"cycleGender": "G: Geschlecht ändern", "cycleGender": ": Geschlecht",
"cycleAbility": "E: Fähigkeit ändern", "cycleAbility": ": Fähigkeit",
"cycleNature": "N: Wesen Ändern", "cycleNature": ": Wesen",
"cycleVariant": "V: Seltenheit ändern", "cycleVariant": ": Seltenheit",
"enablePassive": "Passiv-Skill aktivieren", "enablePassive": "Passiv-Skill aktivieren",
"disablePassive": "Passiv-Skill deaktivieren", "disablePassive": "Passiv-Skill deaktivieren",
"locked": "Gesperrt", "locked": "Gesperrt",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -156,15 +156,27 @@ export default class EggGachaUiHandler extends MessageUiHandler {
this.eggGachaOptionSelectBg.setOrigin(1, 1); this.eggGachaOptionSelectBg.setOrigin(1, 1);
this.eggGachaOptionsContainer.add(this.eggGachaOptionSelectBg); this.eggGachaOptionsContainer.add(this.eggGachaOptionSelectBg);
const multiplierOne = "x1";
const multiplierTen = "x10";
const pullOptions = [ const pullOptions = [
{ multiplier: "x1", description: `1 ${i18next.t("egg:pull")}` }, { multiplier: multiplierOne, description: `1 ${i18next.t("egg:pull")}`, icon: getVoucherTypeIcon(VoucherType.REGULAR) },
{ multiplier: "x10", description: `10 ${i18next.t("egg:pulls")}` }, { multiplier: multiplierTen, description: `10 ${i18next.t("egg:pulls")}`, icon: getVoucherTypeIcon(VoucherType.REGULAR) },
{ multiplier: "x1", description: `5 ${i18next.t("egg:pulls")}` }, { multiplier: multiplierOne, description: `5 ${i18next.t("egg:pulls")}`, icon: getVoucherTypeIcon(VoucherType.PLUS) },
{ multiplier: "x1", description: `10 ${i18next.t("egg:pulls")}` }, { multiplier: multiplierOne, description: `10 ${i18next.t("egg:pulls")}`, icon: getVoucherTypeIcon(VoucherType.PREMIUM) },
{ multiplier: "x1", description: `25 ${i18next.t("egg:pulls")}` } { 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( const optionText = addTextObject(
this.scene, this.scene,
@ -181,9 +193,8 @@ export default class EggGachaUiHandler extends MessageUiHandler {
optionText.setPositionRelative(this.eggGachaOptionSelectBg, 16, 9); optionText.setPositionRelative(this.eggGachaOptionSelectBg, 16, 9);
new Array(5).fill(null).map((_, i) => { pullOptions.forEach((option, 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", option.icon);
const icon = this.scene.add.sprite(0, 0, "items", getVoucherTypeIcon(voucherType));
icon.setScale(0.5); icon.setScale(0.5);
icon.setPositionRelative(this.eggGachaOptionSelectBg, 20, 17 + i * 16); icon.setPositionRelative(this.eggGachaOptionSelectBg, 20, 17 + i * 16);
this.eggGachaOptionsContainer.add(icon); this.eggGachaOptionsContainer.add(icon);
@ -396,7 +407,8 @@ export default class EggGachaUiHandler extends MessageUiHandler {
const timestamp = new Date().getTime(); const timestamp = new Date().getTime();
for (const tier of tiers) { 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()) { if (egg.isManaphyEgg()) {
this.scene.gameData.gameStats.manaphyEggsPulled++; this.scene.gameData.gameStats.manaphyEggsPulled++;
egg.hatchWaves = getEggTierDefaultHatchWaves(EggTier.ULTRA); egg.hatchWaves = getEggTierDefaultHatchWaves(EggTier.ULTRA);

View File

@ -98,13 +98,6 @@ export default class EggListUiHandler extends MessageUiHandler {
let e = 0; 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) { for (const egg of this.scene.gameData.eggs) {
const x = (e % 11) * 18; const x = (e % 11) * 18;
const y = Math.floor(e / 11) * 18; const y = Math.floor(e / 11) * 18;