2026-03-31 10:07:58 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
`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
|
|
|
#include "ui/ui_services.hpp"
|
2026-03-31 10:07:58 +03:00
|
|
|
#include <imgui.h>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
namespace wowee {
|
|
|
|
|
namespace game { class GameHandler; }
|
|
|
|
|
namespace ui {
|
|
|
|
|
|
|
|
|
|
class ChatPanel;
|
|
|
|
|
class InventoryScreen;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Dialog / popup overlay manager
|
|
|
|
|
*
|
|
|
|
|
* Owns all yes/no popup rendering:
|
|
|
|
|
* group invite, duel request, duel countdown, loot roll, trade request,
|
|
|
|
|
* trade window, summon request, shared quest, item text, guild invite,
|
|
|
|
|
* ready check, BG invite, BF manager invite, LFG proposal, LFG role check,
|
|
|
|
|
* resurrect, talent wipe confirm, pet unlearn confirm.
|
|
|
|
|
*/
|
|
|
|
|
class DialogManager {
|
|
|
|
|
public:
|
|
|
|
|
DialogManager() = default;
|
|
|
|
|
|
|
|
|
|
/// Render "early" dialogs (group invite through LFG role check)
|
|
|
|
|
/// called in render() before guild roster / social frame
|
|
|
|
|
void renderDialogs(game::GameHandler& gameHandler,
|
|
|
|
|
InventoryScreen& inventoryScreen,
|
|
|
|
|
ChatPanel& chatPanel);
|
|
|
|
|
|
|
|
|
|
/// Render "late" dialogs (resurrect, talent wipe, pet unlearn)
|
|
|
|
|
/// called in render() after reclaim corpse button
|
|
|
|
|
void renderLateDialogs(game::GameHandler& gameHandler);
|
|
|
|
|
|
refactor: extract spline math, consolidate packet parsing, decompose TransportManager
Extract CatmullRomSpline (include/math/spline.hpp, src/math/spline.cpp) as a
standalone, immutable, thread-safe spline module with O(log n) binary segment
search and fused position+tangent evaluation — replacing the duplicated O(n)
evalTimedCatmullRom/orientationFromTangent pair in TransportManager.
Consolidate 7 copies of spline packet parsing into shared functions in
game/spline_packet.{hpp,cpp}: parseMonsterMoveSplineBody (WotLK/TBC),
parseMonsterMoveSplineBodyVanilla, parseClassicMoveUpdateSpline,
parseWotlkMoveUpdateSpline, and decodePackedDelta. Named SplineFlag constants
replace magic hex literals throughout.
Extract TransportPathRepository (game/transport_path_repository.{hpp,cpp}) from
TransportManager — owns path data, DBC loading, and path inference. Paths stored
as PathEntry wrapping CatmullRomSpline + metadata (zOnly, fromDBC, worldCoords).
TransportManager reduced from ~1200 to ~500 lines, focused on transport lifecycle
and server sync.
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
2026-04-11 08:30:28 +03:00
|
|
|
// UIServices injection (Phase B singleton breaking)
|
`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
|
|
|
void setServices(const UIServices& services) { services_ = services; }
|
|
|
|
|
|
2026-03-31 10:07:58 +03:00
|
|
|
private:
|
refactor: extract spline math, consolidate packet parsing, decompose TransportManager
Extract CatmullRomSpline (include/math/spline.hpp, src/math/spline.cpp) as a
standalone, immutable, thread-safe spline module with O(log n) binary segment
search and fused position+tangent evaluation — replacing the duplicated O(n)
evalTimedCatmullRom/orientationFromTangent pair in TransportManager.
Consolidate 7 copies of spline packet parsing into shared functions in
game/spline_packet.{hpp,cpp}: parseMonsterMoveSplineBody (WotLK/TBC),
parseMonsterMoveSplineBodyVanilla, parseClassicMoveUpdateSpline,
parseWotlkMoveUpdateSpline, and decodePackedDelta. Named SplineFlag constants
replace magic hex literals throughout.
Extract TransportPathRepository (game/transport_path_repository.{hpp,cpp}) from
TransportManager — owns path data, DBC loading, and path inference. Paths stored
as PathEntry wrapping CatmullRomSpline + metadata (zOnly, fromDBC, worldCoords).
TransportManager reduced from ~1200 to ~500 lines, focused on transport lifecycle
and server sync.
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
2026-04-11 08:30:28 +03:00
|
|
|
// Injected UI services
|
`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
|
|
|
UIServices services_;
|
2026-03-31 10:07:58 +03:00
|
|
|
// Common ImGui window flags for popup dialogs
|
|
|
|
|
static constexpr ImGuiWindowFlags kDialogFlags =
|
|
|
|
|
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize;
|
|
|
|
|
|
|
|
|
|
// ---- LFG role state ----
|
|
|
|
|
uint8_t lfgRoles_ = 0x08; // default: DPS (0x02=tank, 0x04=healer, 0x08=dps)
|
|
|
|
|
|
|
|
|
|
// ---- Individual dialog renderers ----
|
|
|
|
|
void renderGroupInvitePopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderDuelRequestPopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderDuelCountdown(game::GameHandler& gameHandler);
|
|
|
|
|
void renderItemTextWindow(game::GameHandler& gameHandler);
|
|
|
|
|
void renderSharedQuestPopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderSummonRequestPopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderTradeRequestPopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderTradeWindow(game::GameHandler& gameHandler,
|
|
|
|
|
InventoryScreen& inventoryScreen,
|
|
|
|
|
ChatPanel& chatPanel);
|
|
|
|
|
void renderLootRollPopup(game::GameHandler& gameHandler,
|
|
|
|
|
InventoryScreen& inventoryScreen,
|
|
|
|
|
ChatPanel& chatPanel);
|
|
|
|
|
void renderGuildInvitePopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderReadyCheckPopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderBgInvitePopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderBfMgrInvitePopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderLfgProposalPopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderLfgRoleCheckPopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderResurrectDialog(game::GameHandler& gameHandler);
|
|
|
|
|
void renderTalentWipeConfirmDialog(game::GameHandler& gameHandler);
|
|
|
|
|
void renderPetUnlearnConfirmDialog(game::GameHandler& gameHandler);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace ui
|
|
|
|
|
} // namespace wowee
|