diff --git a/resources/maps/BlackSea.png b/resources/maps/BlackSea.png index 04c05449e..6b8517303 100644 Binary files a/resources/maps/BlackSea.png and b/resources/maps/BlackSea.png differ diff --git a/resources/maps/NorthAmerica.png b/resources/maps/NorthAmerica.png index 3011a3a44..a5f2db738 100644 Binary files a/resources/maps/NorthAmerica.png and b/resources/maps/NorthAmerica.png differ diff --git a/resources/maps/Oceania.png b/resources/maps/Oceania.png index 209d29745..438089e84 100644 Binary files a/resources/maps/Oceania.png and b/resources/maps/Oceania.png differ diff --git a/src/client/PublicLobby.ts b/src/client/PublicLobby.ts index da4dfe658..bba66273e 100644 --- a/src/client/PublicLobby.ts +++ b/src/client/PublicLobby.ts @@ -3,6 +3,7 @@ import { customElement, state } from "lit/decorators.js"; import { Lobby } from "../core/Schemas"; import { Difficulty, GameMapType, GameType } from "../core/game/Game"; import { consolex } from "../core/Consolex"; +import { getMapsImage } from "./utilities/Maps"; @customElement("public-lobby") export class PublicLobby extends LitElement { @@ -80,23 +81,33 @@ export class PublicLobby extends LitElement { : "bg-gradient-to-r from-blue-600 to-blue-500"} text-white font-medium rounded-xl transition-opacity duration-200 hover:opacity-90" >
Next Game
-
-
-
- ${lobby.gameConfig.gameMap} +
+ ${lobby.gameConfig.gameMap} +
+
+
+ ${lobby.gameConfig.gameMap} +
-
-
-
- ${lobby.numClients} - ${lobby.numClients === 1 ? "Player" : "Players"} waiting +
+
+ ${lobby.numClients} + ${lobby.numClients === 1 ? "Player" : "Players"} waiting +
-
-
-
- ${timeDisplay} +
+
+ ${timeDisplay} +
diff --git a/src/client/components/Maps.ts b/src/client/components/Maps.ts index 37cff8552..d7adaede0 100644 --- a/src/client/components/Maps.ts +++ b/src/client/components/Maps.ts @@ -1,6 +1,7 @@ import { LitElement, html, css } from "lit"; import { customElement, property } from "lit/decorators.js"; import { GameMapType } from "../../core/game/Game"; +import { getMapsImage } from "../utilities/Maps"; // Add map descriptions export const MapDescription: Record = { @@ -12,13 +13,6 @@ export const MapDescription: Record = { BlackSea: "Black Sea", }; -import world from "../../../resources/maps/WorldMap.png"; -import oceania from "../../../resources/maps/Oceania.png"; -import europe from "../../../resources/maps/Europe.png"; -import mena from "../../../resources/maps/Mena.png"; -import northAmerica from "../../../resources/maps/NorthAmerica.png"; -import blackSea from "../../../resources/maps/BlackSea.png"; - @customElement("map-display") export class MapDisplay extends LitElement { @property({ type: String }) mapKey = ""; @@ -73,33 +67,14 @@ export class MapDisplay extends LitElement { } `; - private getMapsImage(map: GameMapType): string { - switch (map) { - case GameMapType.World: - return world; - case GameMapType.Oceania: - return oceania; - case GameMapType.Europe: - return europe; - case GameMapType.Mena: - return mena; - case GameMapType.NorthAmerica: - return northAmerica; - case GameMapType.BlackSea: - return blackSea; - default: - return ""; - } - } - render() { const mapValue = GameMapType[this.mapKey as keyof typeof GameMapType]; return html`
- ${this.getMapsImage(mapValue) + ${getMapsImage(mapValue) ? html`${this.mapKey}` diff --git a/src/client/index.html b/src/client/index.html index 375c8a83b..8f608969a 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -167,7 +167,7 @@
-
+
diff --git a/src/client/utilities/Maps.ts b/src/client/utilities/Maps.ts new file mode 100644 index 000000000..3c242c358 --- /dev/null +++ b/src/client/utilities/Maps.ts @@ -0,0 +1,26 @@ +import world from "../../../resources/maps/WorldMap.png"; +import oceania from "../../../resources/maps/Oceania.png"; +import europe from "../../../resources/maps/Europe.png"; +import mena from "../../../resources/maps/Mena.png"; +import northAmerica from "../../../resources/maps/NorthAmerica.png"; +import blackSea from "../../../resources/maps/BlackSea.png"; +import { GameMapType } from "../../core/game/Game"; + +export function getMapsImage(map: GameMapType): string { + switch (map) { + case GameMapType.World: + return world; + case GameMapType.Oceania: + return oceania; + case GameMapType.Europe: + return europe; + case GameMapType.Mena: + return mena; + case GameMapType.NorthAmerica: + return northAmerica; + case GameMapType.BlackSea: + return blackSea; + default: + return ""; + } +}