From 83eb1e04dc4607ef27d119ad70ce6326a0612496 Mon Sep 17 00:00:00 2001 From: Restart2008 Date: Thu, 25 Dec 2025 09:53:00 -0800 Subject: [PATCH] kick confirmation with translation key --- resources/lang/en.json | 3 ++- src/client/graphics/layers/PlayerPanel.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index e1bebea9e..4a3629e06 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -694,7 +694,8 @@ "send_troops": "Send Troops", "send_gold": "Send Gold", "emotes": "Emojis", - "kick": "Kick Player" + "kick": "Kick Player", + "kick_confirm": "Are you sure you want to kick {name}?" }, "send_troops_modal": { "title_with_name": "Send Troops to {name}", diff --git a/src/client/graphics/layers/PlayerPanel.ts b/src/client/graphics/layers/PlayerPanel.ts index ab95ac44d..bad07c19a 100644 --- a/src/client/graphics/layers/PlayerPanel.ts +++ b/src/client/graphics/layers/PlayerPanel.ts @@ -278,6 +278,13 @@ export class PlayerPanel extends LitElement implements Layer { private handleKickClick(e: Event, other: PlayerView) { e.stopPropagation(); + if ( + !window.confirm( + translateText("player_panel.kick_confirm", { name: other.name() }), + ) + ) { + return; + } const targetClientID = other.clientID(); if (!targetClientID) { console.warn("Cannot kick player without clientID");