import { LitElement, html } from "lit"; import { customElement, state } from "lit/decorators.js"; import { GameView } from "../../../core/game/GameView"; import { Layer } from "./Layer"; @customElement("heads-up-message") export class HeadsUpMessage extends LitElement implements Layer { public game: GameView; @state() private isVisible = false; createRenderRoot() { return this; } init() { this.isVisible = true; this.requestUpdate(); } tick() { if (!this.game.inSpawnPhase()) { this.isVisible = false; this.requestUpdate(); } } render() { if (!this.isVisible) { return html``; } return html`
e.preventDefault()} > Choose a starting location
`; } }