Hide leaderboard and daily runs in offline mode
parent
20a09c2b92
commit
cb59b970ca
|
@ -3,6 +3,7 @@ import { DailyRunScoreboard } from "./daily-run-scoreboard";
|
||||||
import OptionSelectUiHandler from "./option-select-ui-handler";
|
import OptionSelectUiHandler from "./option-select-ui-handler";
|
||||||
import { Mode } from "./ui";
|
import { Mode } from "./ui";
|
||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
|
import { isLocal } from "../utils";
|
||||||
import { TextStyle, addTextObject } from "./text";
|
import { TextStyle, addTextObject } from "./text";
|
||||||
import { battleCountSplashMessage, splashMessages } from "../data/splash-messages";
|
import { battleCountSplashMessage, splashMessages } from "../data/splash-messages";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
@ -33,6 +34,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||||
logo.setOrigin(0.5, 0);
|
logo.setOrigin(0.5, 0);
|
||||||
this.titleContainer.add(logo);
|
this.titleContainer.add(logo);
|
||||||
|
|
||||||
|
if (!isLocal) {
|
||||||
this.dailyRunScoreboard = new DailyRunScoreboard(this.scene, 1, 44);
|
this.dailyRunScoreboard = new DailyRunScoreboard(this.scene, 1, 44);
|
||||||
this.dailyRunScoreboard.setup();
|
this.dailyRunScoreboard.setup();
|
||||||
|
|
||||||
|
@ -41,6 +43,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||||
this.playerCountLabel = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - 90, `? ${i18next.t("menu:playersOnline")}`, TextStyle.MESSAGE, { fontSize: '54px' });
|
this.playerCountLabel = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - 90, `? ${i18next.t("menu:playersOnline")}`, TextStyle.MESSAGE, { fontSize: '54px' });
|
||||||
this.playerCountLabel.setOrigin(1, 0);
|
this.playerCountLabel.setOrigin(1, 0);
|
||||||
this.titleContainer.add(this.playerCountLabel);
|
this.titleContainer.add(this.playerCountLabel);
|
||||||
|
}
|
||||||
|
|
||||||
this.splashMessageText = addTextObject(this.scene, logo.x + 64, logo.y + logo.displayHeight - 8, '', TextStyle.MONEY, { fontSize: '54px' });
|
this.splashMessageText = addTextObject(this.scene, logo.x + 64, logo.y + logo.displayHeight - 8, '', TextStyle.MONEY, { fontSize: '54px' });
|
||||||
this.splashMessageText.setOrigin(0.5, 0.5);
|
this.splashMessageText.setOrigin(0.5, 0.5);
|
||||||
|
@ -80,11 +83,13 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||||
|
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
|
|
||||||
|
if (!isLocal) {
|
||||||
this.dailyRunScoreboard.update();
|
this.dailyRunScoreboard.update();
|
||||||
|
|
||||||
this.updateTitleStats();
|
this.updateTitleStats();
|
||||||
|
|
||||||
this.titleStatsTimer = setInterval(() => this.updateTitleStats(), 60000);
|
this.titleStatsTimer = setInterval(() => this.updateTitleStats(), 60000);
|
||||||
|
}
|
||||||
|
|
||||||
this.scene.tweens.add({
|
this.scene.tweens.add({
|
||||||
targets: [ this.titleContainer, ui.getMessageHandler().bg ],
|
targets: [ this.titleContainer, ui.getMessageHandler().bg ],
|
||||||
|
@ -102,8 +107,10 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||||
|
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
|
|
||||||
|
if (!isLocal) {
|
||||||
clearInterval(this.titleStatsTimer);
|
clearInterval(this.titleStatsTimer);
|
||||||
this.titleStatsTimer = null;
|
this.titleStatsTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.scene.tweens.add({
|
this.scene.tweens.add({
|
||||||
targets: [ this.titleContainer, ui.getMessageHandler().bg ],
|
targets: [ this.titleContainer, ui.getMessageHandler().bg ],
|
||||||
|
|
Loading…
Reference in New Issue