From 162773a79bb60bce8deba298d2841d548f8827a5 Mon Sep 17 00:00:00 2001 From: Restart2008 Date: Thu, 20 Nov 2025 23:14:19 -0800 Subject: [PATCH] feat: Implement visual on-map pinging system --- src/client/HostLobbyModal.ts | 150 +++++++----------- src/client/InputHandler.ts | 42 +++++ src/client/SinglePlayerModal.ts | 88 +++------- src/client/graphics/GameRenderer.ts | 21 ++- src/client/graphics/UIState.ts | 2 + src/client/graphics/fx/PingFx.ts | 112 +++++++++++++ src/client/graphics/layers/FxLayer.ts | 20 ++- src/client/graphics/layers/PingMenu.ts | 87 ++++++++++ .../layers/PingTrajectoryPreviewLayer.ts | 121 ++++++++++++++ .../graphics/layers/RadialMenuElements.ts | 2 + src/core/configuration/Config.ts | 8 +- src/core/game/Game.ts | 25 ++- src/core/game/GameImpl.ts | 34 +--- tests/client/graphics/ProgressBar.test.ts | 4 + tests/client/graphics/UILayer.test.ts | 4 + 15 files changed, 494 insertions(+), 226 deletions(-) create mode 100644 src/client/graphics/fx/PingFx.ts create mode 100644 src/client/graphics/layers/PingMenu.ts create mode 100644 src/client/graphics/layers/PingTrajectoryPreviewLayer.ts diff --git a/src/client/HostLobbyModal.ts b/src/client/HostLobbyModal.ts index 9ace197cf..a7a743ff1 100644 --- a/src/client/HostLobbyModal.ts +++ b/src/client/HostLobbyModal.ts @@ -9,7 +9,6 @@ import { GameMapSize, GameMapType, GameMode, - HumansVsNations, Quads, Trios, UnitType, @@ -25,7 +24,6 @@ import { import { generateID } from "../core/Util"; import "./components/baseComponents/Modal"; import "./components/Difficulties"; -import "./components/LobbyTeamView"; import "./components/Maps"; import { JoinLobbyEvent } from "./Main"; import { renderUnitTypeOptions } from "./utilities/RenderUnitTypeOptions"; @@ -49,7 +47,6 @@ export class HostLobbyModal extends LitElement { @state() private maxTimer: boolean = false; @state() private maxTimerValue: number | undefined = undefined; @state() private instantBuild: boolean = false; - @state() private randomSpawn: boolean = false; @state() private compactMap: boolean = false; @state() private lobbyId = ""; @state() private copySuccess = false; @@ -287,18 +284,7 @@ export class HostLobbyModal extends LitElement { ${translateText("host_modal.team_count")}
- ${[ - 2, - 3, - 4, - 5, - 6, - 7, - Quads, - Trios, - Duos, - HumansVsNations, - ].map( + ${[2, 3, 4, 5, 6, 7, Quads, Trios, Duos].map( (o) => html`
${typeof o === "string" - ? o === HumansVsNations - ? translateText("public_lobby.teams_hvn") - : translateText(`public_lobby.teams_${o}`) + ? translateText(`public_lobby.teams_${o}`) : translateText("public_lobby.teams", { num: o, })} @@ -329,53 +313,42 @@ export class HostLobbyModal extends LitElement { ${translateText("host_modal.options_title")}
-
- ${!( - this.gameMode === GameMode.Team && - this.teamCount === HumansVsNations - ) - ? html` - - ` - : ""} - + - -