mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
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*)
176 lines
7.2 KiB
C++
176 lines
7.2 KiB
C++
#pragma once
|
||
|
||
#include "ui/ui_services.hpp"
|
||
#include <vulkan/vulkan.h>
|
||
#include <string>
|
||
#include <functional>
|
||
#include <cstdint>
|
||
|
||
namespace wowee {
|
||
namespace rendering { class Renderer; }
|
||
namespace audio { class AudioCoordinator; }
|
||
namespace ui {
|
||
|
||
class InventoryScreen;
|
||
class ChatPanel;
|
||
|
||
/**
|
||
* Settings panel (extracted from GameScreen)
|
||
*
|
||
* Owns all settings UI rendering, settings state variables, and
|
||
* graphics preset logic. Save/load remains in GameScreen since
|
||
* it serialises cross-cutting state (chat, quest tracker, etc.).
|
||
*/
|
||
class SettingsPanel {
|
||
public:
|
||
// ---- Settings UI visibility flags (written by EscapeMenu / Escape key) ----
|
||
bool showEscapeSettingsNotice = false;
|
||
bool showSettingsWindow = false;
|
||
bool settingsInit = false;
|
||
|
||
// ---- Pending video / graphics settings ----
|
||
bool pendingFullscreen = false;
|
||
bool pendingVsync = false;
|
||
int pendingResIndex = 0;
|
||
bool pendingShadows = true;
|
||
float pendingShadowDistance = 300.0f;
|
||
bool pendingWaterRefraction = true;
|
||
int pendingBrightness = 50; // 0-100, maps to 0.0-2.0 (50 = 1.0 default)
|
||
|
||
// ---- Pending audio settings ----
|
||
int pendingMasterVolume = 100;
|
||
int pendingMusicVolume = 30;
|
||
int pendingAmbientVolume = 100;
|
||
int pendingUiVolume = 100;
|
||
int pendingCombatVolume = 100;
|
||
int pendingSpellVolume = 100;
|
||
int pendingMovementVolume = 100;
|
||
int pendingFootstepVolume = 100;
|
||
int pendingNpcVoiceVolume = 100;
|
||
int pendingMountVolume = 100;
|
||
int pendingActivityVolume = 100;
|
||
|
||
// ---- Pending camera / controls ----
|
||
float pendingMouseSensitivity = 0.2f;
|
||
bool pendingInvertMouse = false;
|
||
bool pendingExtendedZoom = false;
|
||
float pendingCameraStiffness = 30.0f; // Camera smooth speed (higher = tighter, less sway)
|
||
float pendingPivotHeight = 1.6f; // Camera pivot height above feet (lower = less detached feel)
|
||
float pendingFov = 70.0f; // degrees, default matches WoW's ~70° horizontal FOV
|
||
|
||
// ---- Pending UI / interface ----
|
||
int pendingUiOpacity = 65;
|
||
bool pendingMinimapRotate = false;
|
||
bool pendingMinimapSquare = false;
|
||
bool pendingMinimapNpcDots = false;
|
||
bool pendingShowLatencyMeter = true;
|
||
bool pendingSeparateBags = true;
|
||
bool pendingShowKeyring = true;
|
||
|
||
// ---- Pending gameplay ----
|
||
bool pendingAutoLoot = false;
|
||
bool pendingAutoSellGrey = false;
|
||
bool pendingAutoRepair = false;
|
||
|
||
// ---- Pending soundtrack ----
|
||
bool pendingUseOriginalSoundtrack = true;
|
||
|
||
// ---- Pending action bar layout ----
|
||
bool pendingShowActionBar2 = true; // Show second action bar above main bar
|
||
float pendingActionBarScale = 1.0f; // Multiplier for action bar slot size (0.5–1.5)
|
||
float pendingActionBar2OffsetX = 0.0f; // Horizontal offset from default center position
|
||
float pendingActionBar2OffsetY = 0.0f; // Vertical offset from default (above bar 1)
|
||
bool pendingShowRightBar = false; // Right-edge vertical action bar (bar 3, slots 24-35)
|
||
bool pendingShowLeftBar = false; // Left-edge vertical action bar (bar 4, slots 36-47)
|
||
float pendingRightBarOffsetY = 0.0f; // Vertical offset from screen center
|
||
float pendingLeftBarOffsetY = 0.0f; // Vertical offset from screen center
|
||
|
||
// ---- Pending graphics quality ----
|
||
int pendingGroundClutterDensity = 100;
|
||
int pendingAntiAliasing = 0; // 0=Off, 1=2x, 2=4x, 3=8x
|
||
bool pendingFXAA = false; // FXAA post-process (combinable with MSAA)
|
||
bool pendingNormalMapping = true; // on by default
|
||
float pendingNormalMapStrength = 0.8f; // 0.0-2.0
|
||
bool pendingPOM = true; // on by default
|
||
int pendingPOMQuality = 1; // 0=Low(16), 1=Medium(32), 2=High(64)
|
||
bool pendingFSR = false;
|
||
int pendingUpscalingMode = 0; // 0=Off, 1=FSR1, 2=FSR3
|
||
int pendingFSRQuality = 3; // 0=UltraQuality, 1=Quality, 2=Balanced, 3=Native(100%)
|
||
float pendingFSRSharpness = 1.6f;
|
||
float pendingFSR2JitterSign = 0.38f;
|
||
float pendingFSR2MotionVecScaleX = 1.0f;
|
||
float pendingFSR2MotionVecScaleY = 1.0f;
|
||
bool pendingAMDFramegen = false;
|
||
|
||
// ---- Graphics quality presets ----
|
||
enum class GraphicsPreset : int {
|
||
CUSTOM = 0,
|
||
LOW = 1,
|
||
MEDIUM = 2,
|
||
HIGH = 3,
|
||
ULTRA = 4
|
||
};
|
||
GraphicsPreset currentGraphicsPreset = GraphicsPreset::CUSTOM;
|
||
GraphicsPreset pendingGraphicsPreset = GraphicsPreset::CUSTOM;
|
||
|
||
// ---- Applied-once flags (used by GameScreen::render() one-time-apply blocks) ----
|
||
bool fsrSettingsApplied_ = false;
|
||
float uiOpacity_ = 0.65f; // UI element transparency (0.0 = fully transparent, 1.0 = fully opaque)
|
||
bool minimapRotate_ = false;
|
||
bool minimapSquare_ = false;
|
||
bool minimapNpcDots_ = false;
|
||
bool showLatencyMeter_ = true; // Show server latency indicator
|
||
bool minimapSettingsApplied_ = false;
|
||
bool volumeSettingsApplied_ = false; // True once saved volume settings applied to audio managers
|
||
bool msaaSettingsApplied_ = false; // True once saved MSAA setting applied to renderer
|
||
bool fxaaSettingsApplied_ = false; // True once saved FXAA setting applied to renderer
|
||
bool waterRefractionApplied_ = false;
|
||
bool normalMapSettingsApplied_ = false; // True once saved normal map/POM settings applied
|
||
|
||
// ---- Mute state: mute bypasses master volume without touching slider values ----
|
||
bool soundMuted_ = false;
|
||
float preMuteVolume_ = 1.0f; // AudioEngine master volume before muting
|
||
|
||
// ---- Config toggles (read by GameScreen rendering, edited by Interface tab) ----
|
||
float nameplateScale_ = 1.0f; // Scale multiplier for nameplate bar dimensions
|
||
bool showFriendlyNameplates_ = true; // Shift+V toggles friendly player nameplates
|
||
bool showDPSMeter_ = false;
|
||
bool showCooldownTracker_ = false;
|
||
bool damageFlashEnabled_ = true;
|
||
bool lowHealthVignetteEnabled_ = true; // Persistent pulsing red vignette below 20% HP
|
||
|
||
// ---- Public methods ----
|
||
|
||
/// Render the settings window (call from GameScreen::render)
|
||
void renderSettingsWindow(InventoryScreen& inventoryScreen, ChatPanel& chatPanel,
|
||
std::function<void()> saveCallback);
|
||
|
||
/// Apply audio volume levels to all audio coordinator sound managers
|
||
void applyAudioVolumes(audio::AudioCoordinator* ac);
|
||
|
||
/// Return the platform-specific settings file path
|
||
static std::string getSettingsPath();
|
||
|
||
/// Set services (dependency injection)
|
||
void setServices(const UIServices& services) { services_ = services; }
|
||
|
||
private:
|
||
UIServices services_; // Injected service references
|
||
|
||
// Keybinding customization (private — only used in Controls tab)
|
||
int pendingRebindAction_ = -1; // -1 = not rebinding, otherwise action index
|
||
bool awaitingKeyPress_ = false;
|
||
|
||
// Settings tab rendering
|
||
void renderSettingsInterfaceTab(std::function<void()> saveCallback);
|
||
void renderSettingsGameplayTab(InventoryScreen& inventoryScreen,
|
||
std::function<void()> saveCallback);
|
||
void renderSettingsControlsTab(std::function<void()> saveCallback);
|
||
void renderSettingsAudioTab(std::function<void()> saveCallback);
|
||
void renderSettingsAboutTab();
|
||
void applyGraphicsPreset(GraphicsPreset preset);
|
||
void updateGraphicsPresetFromCurrentSettings();
|
||
};
|
||
|
||
} // namespace ui
|
||
} // namespace wowee
|