Conversation
Continuously enforces the disabled chat state to prevent users from re-enabling it through the alliances menu.
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
Provides visual feedback to the user when chat is disabled via the spawner configuration, preventing them from unknowingly attempting to send messages. The feedback is throttled to prevent spamming the chat window.
There was a problem hiding this comment.
Pull request overview
Adds a per-player DisableChat spawn.ini option to reintroduce the legacy “no send / no receive chat” behavior for ranked/ladder use cases (issue #60).
Changes:
- Introduces
DisableChatinSpawnerConfigwith defaultfalseand INI loading support. - Implements hooks to suppress outgoing chat, suppress incoming chat display, and prevent re-enabling chat via the diplomacy UI.
- Enforces
Game::ChatMaskwhileDisableChatis enabled.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Spawner/Spawner.Config.h |
Adds DisableChat config field with default value. |
src/Spawner/Spawner.Config.cpp |
Loads DisableChat from the [Settings] section of spawn.ini. |
src/Misc/InGameChat.cpp |
Adds hooks/UI enforcement to disable sending/receiving chat when configured. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static int LastDisableChatFeedbackFrame = -1000; | ||
|
|
||
| if (IsDisableChatEnabled()) | ||
| { | ||
| const int currentFrame = Unsorted::CurrentFrame; | ||
|
|
||
| if (currentFrame - LastDisableChatFeedbackFrame >= 90) | ||
| { | ||
| MessageListClass::Instance.PrintMessage(L"Chat is disabled. Message not sent."); | ||
| LastDisableChatFeedbackFrame = currentFrame; | ||
| } |
There was a problem hiding this comment.
LastDisableChatFeedbackFrame is a function-local static that persists across matches. If Unsorted::CurrentFrame resets to 0 on a new game, currentFrame - LastDisableChatFeedbackFrame will be negative and the feedback message may never display again until the frame counter surpasses the previous match’s value. Consider resetting the stored frame when the current frame goes backwards (or move this state into a global that gets reset in the game-start reset hook).
Potential solution to issue #60
Mirrors the DisableChat functionality of the older yr spawner.
Pull rquest to remain open and used for testing nightlybuild dll's.