Pavel Okhlopkov
ada019e0d4
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>
2026-04-12 15:46:03 +03:00
Pavel Okhlopkov
42f1bb98ea
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>
2026-04-12 14:59:56 +03:00
Paul
34c0e3ca28
chore(refactor): god-object decomposition and mega-file splits
...
Split all mega-files by single-responsibility concern and
partially extracting AudioCoordinator and
OverlaySystem from the Renderer facade. No behavioral changes.
Splits:
- game_handler.cpp (5,247 LOC) → core + callbacks + packets (3 files)
- world_packets.cpp (4,453 LOC) → economy/entity/social/world (4 files)
- game_screen.cpp (5,786 LOC) → core + frames + hud + minimap (4 files)
- m2_renderer.cpp (3,343 LOC) → core + instance + particles + render (4 files)
- chat_panel.cpp (3,140 LOC) → core + commands + utils (3 files)
- entity_spawner.cpp (2,750 LOC) → core + player + processing (3 files)
Extractions:
- AudioCoordinator: include/audio/ + src/audio/ (owned by Renderer)
- OverlaySystem: include/rendering/ + src/rendering/overlay_system.*
CMakeLists.txt: registered all 17 new translation units.
Related handler/callback files: minor include fixups post-split.
2026-04-05 19:30:44 +03:00
Kelsi
fe1c4c622b
chore: remove dead functions left behind by handler extractions
...
685 lines of unused code duplicated into extracted handler files
(entity_controller, spell_handler, quest_handler, warden_handler,
social_handler, action_bar_panel, chat_panel, window_manager)
during PRs #33-#38. Build is now warning-free.
2026-04-02 14:47:04 -07:00
Paul
5af9f7aa4b
chore(renderer): extract AnimationController and remove audio pass-throughs
...
Extract ~1,500 lines of character animation state from Renderer into a dedicated
AnimationController class, and complete the AudioCoordinator migration by removing
all 10 audio pass-through getters from Renderer.
AnimationController:
- New: include/rendering/animation_controller.hpp (182 lines)
- New: src/rendering/animation_controller.cpp (1,703 lines)
- Moves: locomotion state machine (50+ members), mount animation (40+ members),
emote system, footstep triggering, surface detection, melee combat animations
- Renderer holds std::unique_ptr<AnimationController> and delegates completely
- AnimationController accesses audio via renderer_->getAudioCoordinator()
Audio caller migration:
- Migrate ~60 external callers from renderer->getXManager() to AudioCoordinator
directly, grouped by access pattern:
- UIServices: settings_panel, game_screen, toast_manager, chat_panel,
combat_ui, window_manager
- GameServices: game_handler, spell_handler, inventory_handler, quest_handler,
social_handler, combat_handler
- Application singleton: application.cpp, auth_screen.cpp, lua_engine.cpp
- Remove 10 pass-through getter definitions from renderer.cpp
- Remove 10 pass-through getter declarations from renderer.hpp
- Remove individual audio manager forward declarations from renderer.hpp
- Redirect 69 internal renderer.cpp audio calls to audioCoordinator_ directly
- game_handler.cpp: withSoundManager template uses services_.audioCoordinator;
MFP changed from &Renderer::getUiSoundManager to &AudioCoordinator::getUiSoundManager
- GameServices struct: add AudioCoordinator* audioCoordinator member
- settings_panel: applyAudioVolumes(Renderer*) -> applyAudioVolumes(AudioCoordinator*)
2026-04-02 13:06:31 +03:00
Paul
1c0e9dd1df
chore(application): extract appearance controller and unify UI flow
...
- Refactor UI application architecture: extracted appearance controller into ui_services.hpp + implementation updates
- Update UI components and managers to use new service layer:
- `action_bar_panel`, `auth_screen`, `character_screen`, `chat_panel`, `combat_ui`, `dialog_manager`, `game_screen`, `settings_panel`, `social_panel`, `toast_manager`, `ui_manager`, `window_manager`
- Adjust core application entrypoints:
- application.cpp
- Update component implementations for new controller flow:
- action_bar_panel.cpp, `chat_panel.cpp`, `combat_ui.cpp`, `dialog_manager.cpp`, `game_screen.cpp`, `settings_panel.cpp`, `social_panel.cpp`, `toast_manager.cpp`, `window_manager.cpp`
These staged changes implement a major architectural refactor for UI/appearance controller separation
2026-04-01 20:59:17 +03:00
Paul
0e6aaeb44e
fix warnings, remove phases from commentaries
2026-03-31 20:11:28 +03:00
Paul
0f1cd5fe9a
chore(game-ui): extract chat panel into dedicated UI module
...
- moved chat panel logic out of `game_screen` into `chat_panel`
- added chat_panel.hpp and chat_panel.cpp
- updated game_screen.hpp and game_screen.cpp to integrate new `ChatPanel` component
- updated build config in CMakeLists.txt to include new UI module sources
2026-03-31 08:53:14 +03:00