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
This commit is contained in:
Paul 2026-04-01 20:59:17 +03:00
parent d43397163e
commit 1c0e9dd1df
23 changed files with 315 additions and 134 deletions

View file

@ -39,6 +39,7 @@
#include "pipeline/wdt_loader.hpp"
#include "pipeline/dbc_loader.hpp"
#include "ui/ui_manager.hpp"
#include "ui/ui_services.hpp"
#include "auth/auth_handler.hpp"
#include "game/game_handler.hpp"
#include "game/transport_manager.hpp"
@ -227,6 +228,20 @@ bool Application::initialize() {
// Wire AppearanceComposer to UI components (Phase A singleton breaking)
if (uiManager) {
uiManager->setAppearanceComposer(appearanceComposer_.get());
// Wire all services to UI components (Phase B singleton breaking)
ui::UIServices uiServices;
uiServices.window = window.get();
uiServices.renderer = renderer.get();
uiServices.assetManager = assetManager.get();
uiServices.gameHandler = gameHandler.get();
uiServices.expansionRegistry = expansionRegistry_.get();
uiServices.addonManager = addonManager_.get(); // May be nullptr here, re-wire later
uiServices.audioCoordinator = audioCoordinator_.get();
uiServices.entitySpawner = entitySpawner_.get();
uiServices.appearanceComposer = appearanceComposer_.get();
uiServices.worldLoader = worldLoader_.get();
uiManager->setServices(uiServices);
}
// Ensure the main in-world CharacterRenderer can load textures immediately.
@ -505,6 +520,22 @@ bool Application::initialize() {
entitySpawner_.get(), appearanceComposer_.get(), window.get(),
world.get(), addonManager_.get());
// Re-wire UIServices now that all services (addonManager_, worldLoader_) are available
if (uiManager) {
ui::UIServices uiServices;
uiServices.window = window.get();
uiServices.renderer = renderer.get();
uiServices.assetManager = assetManager.get();
uiServices.gameHandler = gameHandler.get();
uiServices.expansionRegistry = expansionRegistry_.get();
uiServices.addonManager = addonManager_.get();
uiServices.audioCoordinator = audioCoordinator_.get();
uiServices.entitySpawner = entitySpawner_.get();
uiServices.appearanceComposer = appearanceComposer_.get();
uiServices.worldLoader = worldLoader_.get();
uiManager->setServices(uiServices);
}
// Start background preload for last-played character's world.
// Warms the file cache so terrain tile loading is faster at Enter World.
{