refactor(chat): extract ItemTooltipRenderer, slim render(), consolidate utils

- Extract renderItemTooltip() (510 LOC) from ChatMarkupRenderer into
  dedicated ItemTooltipRenderer class; chat_markup_renderer.cpp 766→192 LOC
- Extract formatChatMessage(), detectChannelPrefix(), inputTextCallback()
  from render(); render() 711→376 LOC
- Consolidate replaceGenderPlaceholders() from 3 copies into
  chat_utils::replaceGenderPlaceholders(); remove 118 LOC duplicate from
  quest_log_screen.cpp, update 8 call sites in window_manager.cpp
- Delete chat_panel_commands.cpp (359 LOC) — absorb sendChatMessage,
  executeMacroText, PortBot helpers into chat_panel.cpp; move
  evaluateMacroConditionals to macro_eval_convenience.cpp
- Delete chat_panel_utils.cpp (229 LOC) — absorb small utilities into
  chat_panel.cpp
- Replace 3 forward declarations of evaluateMacroConditionals with
  #include "ui/chat/macro_evaluator.hpp"

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
Pavel Okhlopkov 2026-04-12 15:46:03 +03:00
parent 42f1bb98ea
commit ada019e0d4
17 changed files with 1302 additions and 1463 deletions

View file

@ -3,6 +3,7 @@
// /focus, /clearfocus
// Moved from ChatPanel::sendChatMessage() if/else chain (Phase 3).
#include "ui/chat/i_chat_command.hpp"
#include "ui/chat/macro_evaluator.hpp"
#include "ui/chat_panel.hpp"
#include "game/game_handler.hpp"
#include "game/entity.hpp"
@ -13,11 +14,6 @@
namespace wowee { namespace ui {
// Forward declaration of evaluateMacroConditionals (still in chat_panel_commands.cpp)
std::string evaluateMacroConditionals(const std::string& rawArg,
game::GameHandler& gameHandler,
uint64_t& targetOverride);
namespace {
// Trim leading/trailing whitespace.