From ce62b1992fe13725c45191d81530b757f23e6938 Mon Sep 17 00:00:00 2001 From: Alessandro Bruzzese <69127023+Bruzzii@users.noreply.github.com> Date: Tue, 7 May 2024 19:22:35 +0200 Subject: [PATCH] Removed debug code + fixed function casing --- src/data/splash-messages.ts | 4 ++-- src/ui/title-ui-handler.ts | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/data/splash-messages.ts b/src/data/splash-messages.ts index f779c2fe0..3a40429e9 100644 --- a/src/data/splash-messages.ts +++ b/src/data/splash-messages.ts @@ -1,11 +1,11 @@ import i18next from "../plugins/i18n"; -export function getbattleCountSplashMessage(): string { +export function getBattleCountSplashMessage(): string { return `{COUNT} ${i18next.t('splashMessages:battlesWon')}`; } export function getSplashMessages(): string[] { - const splashMessages = Array(10).fill(getbattleCountSplashMessage()); + const splashMessages = Array(10).fill(getBattleCountSplashMessage()); splashMessages.push(...[ i18next.t('splashMessages:joinTheDiscord'), i18next.t('splashMessages:infiniteLevel'), diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index fb5e80432..e888b668e 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -4,7 +4,7 @@ import OptionSelectUiHandler from "./option-select-ui-handler"; import { Mode } from "./ui"; import * as Utils from "../utils"; import { TextStyle, addTextObject } from "./text"; -import { getbattleCountSplashMessage, getSplashMessages } from "../data/splash-messages"; +import { getBattleCountSplashMessage, getSplashMessages } from "../data/splash-messages"; import i18next from "i18next"; export default class TitleUiHandler extends OptionSelectUiHandler { @@ -63,8 +63,8 @@ export default class TitleUiHandler extends OptionSelectUiHandler { .then(request => request.json()) .then(stats => { this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`); - if (this.splashMessage === getbattleCountSplashMessage()) - this.splashMessageText.setText(getbattleCountSplashMessage().replace('{COUNT}', stats.battleCount.toLocaleString('en-US'))); + if (this.splashMessage === getBattleCountSplashMessage()) + this.splashMessageText.setText(getBattleCountSplashMessage().replace('{COUNT}', stats.battleCount.toLocaleString('en-US'))); }) .catch(err => { console.error("Failed to fetch title stats:\n", err); @@ -76,9 +76,6 @@ export default class TitleUiHandler extends OptionSelectUiHandler { if (ret) { this.splashMessage = Utils.randItem(getSplashMessages()); - console.log(getSplashMessages()) - console.log("------") - console.log(this.splashMessage) this.splashMessageText.setText(this.splashMessage.replace('{COUNT}', '?')); const ui = this.getUi();