diff --git a/src/client/graphics/layers/OptionsMenu.ts b/src/client/graphics/layers/OptionsMenu.ts index e452d29b8..9e1050356 100644 --- a/src/client/graphics/layers/OptionsMenu.ts +++ b/src/client/graphics/layers/OptionsMenu.ts @@ -1,11 +1,10 @@ -import { LitElement, html, css } from 'lit'; +import { LitElement, html } from 'lit'; import { customElement, property, state } from 'lit/decorators.js'; import { EventBus } from '../../../core/EventBus'; import { PauseGameEvent } from '../../Transport'; import { GameType } from '../../../core/game/Game'; import { GameView } from '../../../core/game/GameView'; import { Layer } from './Layer'; -import { ThreadMemberFlagsBitField } from 'discord.js'; import { GameUpdateType } from '../../../core/game/GameUpdates'; @customElement('options-menu') @@ -24,30 +23,34 @@ export class OptionsMenu extends LitElement implements Layer { private isVisible = false; - private hasWinner = false + private hasWinner = false; private onExitButtonClick() { window.location.reload(); } + createRenderRoot() { + return this; + } + private onPauseButtonClick() { this.isPaused = !this.isPaused; this.eventBus.emit(new PauseGameEvent(this.isPaused)); } init() { - console.log('init called from OptionsMenu') + console.log('init called from OptionsMenu'); this.showPauseButton = this.game.config().gameConfig().gameType == GameType.Singleplayer; this.isVisible = true; this.requestUpdate(); } tick() { - this.hasWinner = this.hasWinner || this.game.updatesSinceLastTick()[GameUpdateType.WinUpdate].length > 0 + this.hasWinner = this.hasWinner || this.game.updatesSinceLastTick()[GameUpdateType.WinUpdate].length > 0; if (this.game.inSpawnPhase()) { - this.timer = 0 + this.timer = 0; } else if (!this.hasWinner && this.game.ticks() % 10 == 0) { - this.timer++ + this.timer++; } this.isVisible = true; this.requestUpdate(); @@ -57,108 +60,42 @@ export class OptionsMenu extends LitElement implements Layer { if (!this.isVisible) { return html``; } - return html` -