From 64311539035d988bc4477f9dc1b921f0e4566eb2 Mon Sep 17 00:00:00 2001 From: Aotumuri Date: Sat, 17 May 2025 08:15:53 +0900 Subject: [PATCH] Disable send button when required player not selected in quick chat (#767) ## Description: This PR prevents players from sending Quick Chat messages that require a player target ([P1]) unless a player has been selected. The Send button is now disabled in such cases and visually dimmed for clarity. ## Please complete the following: - [ ] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: aotumuri ## Summary by CodeRabbit - **Bug Fixes** - The chat send button is now disabled if a required player selection is missing, preventing unintended sends. - **Style** - The chat send button visually indicates when it is disabled with a gray background and a not-allowed cursor. --- src/client/graphics/layers/ChatModal.ts | 3 ++- src/client/styles/modal/chat.css | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/graphics/layers/ChatModal.ts b/src/client/graphics/layers/ChatModal.ts index 13827eb7c..40cb4e4a4 100644 --- a/src/client/graphics/layers/ChatModal.ts +++ b/src/client/graphics/layers/ChatModal.ts @@ -173,7 +173,8 @@ export class ChatModal extends LitElement { diff --git a/src/client/styles/modal/chat.css b/src/client/styles/modal/chat.css index c8759ebdc..a71856ba9 100644 --- a/src/client/styles/modal/chat.css +++ b/src/client/styles/modal/chat.css @@ -57,6 +57,11 @@ cursor: pointer; } +.chat-send-button:disabled { + background: #666; + cursor: not-allowed; +} + .chat-column { display: flex; flex-direction: column;