Skip to content

feat: Update LAN chat messages and emotes for consistency with WOL#1821

Open
tintinhamans wants to merge 1 commit intoTheSuperHackers:mainfrom
tintinhamans:arctic/issue-1443
Open

feat: Update LAN chat messages and emotes for consistency with WOL#1821
tintinhamans wants to merge 1 commit intoTheSuperHackers:mainfrom
tintinhamans:arctic/issue-1443

Conversation

@tintinhamans
Copy link

@tintinhamans tintinhamans commented Nov 7, 2025

This pull request introduces a new method for handling LAN chat messages, specifically adding support for /me emote commands in LAN chat, consistent with WOL behavior.

It also tweaks UI code to rename the chat button from buttonEmote to buttonChat for clarity across multiple menus. The chat message handling logic is updated in all relevant places to use the new method, ensuring consistent emote and normal chat processing.

Closes #1443

@tintinhamans tintinhamans added GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker labels Nov 7, 2025
if (!txtInput.isEmpty())
TheLAN->RequestChat(txtInput, LANAPIInterface::LANCHAT_EMOTE);
// TheSuperHackers @tweak arcticdolphin 07/11/2025 changed from LANCHAT_EMOTE for consistency
TheLAN->RequestChat(txtInput, LANAPIInterface::LANCHAT_NORMAL);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button is named "buttonEmoteID". Maybe EMOTE type is intentional? What is the difference?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LANCHAT_EMOTE (first line in screenshot) is used when you press the button that looks like an Enter symbol, LANCHAT_NORMAL (second line in screenshot) is used when you press Enter on your keyboard.

image

Emote feels like a feature that was never completed, I essentially did the same as what was done for this in the LanLobbyMenu:

if (!txtInput.isEmpty()) {
// TheLAN->RequestChat(txtInput, LANAPIInterface::LANCHAT_EMOTE);
TheLAN->RequestChat(txtInput, LANAPIInterface::LANCHAT_NORMAL);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will the EMOTE be used without the button?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should introduce a /me command that would trigger the Emote formatting.

Emote is also used in the score screen chat and may need evaluation there too.

Copy link

@xezon xezon Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is how it is done in GameSpy code:

Bool handleGameSetupSlashCommands(UnicodeString uText)
{
...
	else if (token == "me" && uText.getLength()>4)
	{
		TheGameSpyInfo->sendChat(UnicodeString(uText.str()+4), TRUE, NULL); // <---- second argument "isAction" makes emote chat
		return TRUE; // was a slash command
	}
...

Ok.

So the action items here are:

  1. Change all lobby emote lobby buttons to send normal chat (Game Room, Score Screen)
  2. Rename the "emote" buttons to "chat" buttons
  3. Implement /me command for Network chat (ideally /me command still works when clicking the button too)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tintinhamans Will you make another pass on this or should someone else pick this up?

@tintinhamans tintinhamans changed the title tweak: Update LanGameOptionsMenu chat type for consistency feat: Update LAN chat messages and emotes for consistency with WOL Mar 8, 2026
@tintinhamans tintinhamans requested a review from xezon March 8, 2026 22:08
@greptile-apps
Copy link

greptile-apps bot commented Mar 8, 2026

Greptile Summary

This PR adds /me emote command support for LAN chat via the new LANAPIInterface::processChatMessage helper, and renames the C++ variables buttonEmotebuttonChat for clarity across all LAN/WOL lobby and setup menus in both the Generals and Zero Hour codebases. WOL menus receive only the variable rename — their chat paths continue routing through TheGameSpyInfo->sendChat() unchanged.

Key observations:

  • processChatMessage is implemented cleanly as a concrete method on LANAPIInterface, correctly dispatching to the pure-virtual RequestChat through the vtable — no issues with the class hierarchy.
  • The method intentionally matches WOL behavior: unknown slash commands (e.g., /help, /kick) fall through to LANCHAT_NORMAL and are forwarded as-is, maintaining consistent chat handling between the two networks.
  • The TODO comments at the .wnd key lookup sites (ButtonEmoteButtonChat) correctly track the follow-up UI file renames that could not be done in this PR.
  • The ScoreScreen adoption is safely guarded by if(TheLAN), so the WOL post-game score screen is unaffected.
  • All new comments carry a 08/03/2026 date tag, which is compliant with the current-year annotation policy.

Confidence Score: 5/5

  • Safe to merge; core logic is correct and well-contained with no blockers or defects.
  • The implementation is sound: processChatMessage is a non-virtual helper that cleanly delegates to the polymorphic RequestChat, the emote offset arithmetic is correct, all callers are properly guarded, WOL paths are untouched, and the behavior intentionally matches WOL for consistency. No files require special attention.
  • No files require special attention.

Sequence Diagram

sequenceDiagram
    participant User
    participant Menu as LAN Menu<br/>(LanLobbyMenu / LanGameOptionsMenu / ScoreScreen)
    participant LANAPI as LANAPIInterface::processChatMessage
    participant RequestChat as LANAPI::RequestChat

    User->>Menu: Types message & presses Enter / Chat button
    Menu->>Menu: txtInput.trim() / strip leading whitespace
    alt txtInput is not empty
        Menu->>LANAPI: processChatMessage(txtInput)
        LANAPI->>LANAPI: ascii.translate(message)
        alt ascii starts with '/'
            LANAPI->>LANAPI: nextToken → token.toLower()
            alt token == "me" && length > 4
                LANAPI->>RequestChat: RequestChat(message.str()+4, LANCHAT_EMOTE)
            else unknown slash command
                LANAPI->>RequestChat: RequestChat(message, LANCHAT_NORMAL)
            end
        else no leading slash
            LANAPI->>RequestChat: RequestChat(message, LANCHAT_NORMAL)
        end
    end
Loading

Last reviewed commit: 7ed2490

Signed-off-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network pre-match lobby inconsistent chat send behavior

3 participants