refactor(chat): decompose into modular architecture, add GM commands, fix protocol

- Extract ChatPanel monolith into 15+ focused modules under ui/chat/
  (ChatInput, ChatTabManager, ChatTabCompleter, ChatMarkupParser,
  ChatMarkupRenderer, ChatCommandRegistry, ChatBubbleManager,
  ChatSettings, MacroEvaluator, GameStateAdapter, InputModifierAdapter)
- Split 2700-line chat_panel_commands.cpp into 11 command modules
- Add GM command handling: 190-command data table, dot-prefix interception,
  tab-completion, /gmhelp with category filter
- Fix ChatType enum to match WoW wire protocol (SAY=0x01 not 0x00);
  values 0x00-0x1B shared across Vanilla/TBC/WotLK
- Fix BG_SYSTEM_* values from 82-84 (UB in bitmask shifts) to 0x24-0x26
- Fix infinite Enter key loop after teleport (disable TOGGLE_CHAT repeat,
  add 2-frame input cooldown)
- Add tests: chat_markup_parser, chat_tab_completer, gm_commands,
  macro_evaluator

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
Pavel Okhlopkov 2026-04-12 14:59:56 +03:00
parent 09c4a9a04a
commit 42f1bb98ea
54 changed files with 7363 additions and 3856 deletions

View file

@ -570,48 +570,52 @@ public:
};
/**
* Chat message types
* Chat message types wire values shared across Vanilla 1.12, TBC 2.4.3, and WotLK 3.3.5a.
* Core types (0x000x1B) are identical in all expansions.
* WotLK adds: ACHIEVEMENT(0x30), GUILD_ACHIEVEMENT(0x31), PARTY_LEADER(0x33).
*/
enum class ChatType : uint8_t {
SAY = 0,
PARTY = 1,
RAID = 2,
GUILD = 3,
OFFICER = 4,
YELL = 5,
WHISPER = 6,
WHISPER_INFORM = 7,
EMOTE = 8,
TEXT_EMOTE = 9,
SYSTEM = 10,
MONSTER_SAY = 11,
MONSTER_YELL = 12,
MONSTER_EMOTE = 13,
CHANNEL = 14,
CHANNEL_JOIN = 15,
CHANNEL_LEAVE = 16,
CHANNEL_LIST = 17,
CHANNEL_NOTICE = 18,
CHANNEL_NOTICE_USER = 19,
AFK = 20,
DND = 21,
IGNORED = 22,
SKILL = 23,
LOOT = 24,
BATTLEGROUND = 25,
BATTLEGROUND_LEADER = 26,
RAID_LEADER = 27,
RAID_WARNING = 28,
ACHIEVEMENT = 29,
GUILD_ACHIEVEMENT = 30,
MONSTER_WHISPER = 42,
RAID_BOSS_WHISPER = 43,
RAID_BOSS_EMOTE = 44,
MONSTER_PARTY = 50,
// BG/Arena system messages (WoW 3.3.5a — no sender, treated as SYSTEM in display)
BG_SYSTEM_NEUTRAL = 82,
BG_SYSTEM_ALLIANCE = 83,
BG_SYSTEM_HORDE = 84
SYSTEM = 0x00,
SAY = 0x01,
PARTY = 0x02,
RAID = 0x03,
GUILD = 0x04,
OFFICER = 0x05,
YELL = 0x06,
WHISPER = 0x07,
WHISPER_FOREIGN = 0x08,
WHISPER_INFORM = 0x09,
EMOTE = 0x0A,
TEXT_EMOTE = 0x0B,
MONSTER_SAY = 0x0C,
MONSTER_PARTY = 0x0D,
MONSTER_YELL = 0x0E,
MONSTER_WHISPER = 0x0F,
MONSTER_EMOTE = 0x10,
CHANNEL = 0x11,
CHANNEL_JOIN = 0x12,
CHANNEL_LEAVE = 0x13,
CHANNEL_LIST = 0x14,
CHANNEL_NOTICE = 0x15,
CHANNEL_NOTICE_USER = 0x16,
AFK = 0x17,
DND = 0x18,
IGNORED = 0x19,
SKILL = 0x1A,
LOOT = 0x1B,
// 0x240x26: BG system messages
BG_SYSTEM_NEUTRAL = 0x24,
BG_SYSTEM_ALLIANCE = 0x25,
BG_SYSTEM_HORDE = 0x26,
RAID_LEADER = 0x27,
RAID_WARNING = 0x28,
RAID_BOSS_EMOTE = 0x29,
RAID_BOSS_WHISPER = 0x2A,
BATTLEGROUND = 0x2C,
BATTLEGROUND_LEADER = 0x2D,
ACHIEVEMENT = 0x30,
GUILD_ACHIEVEMENT = 0x31,
PARTY_LEADER = 0x33,
};
/**