mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-27 05:23:51 +00:00
Initial commit: wowee native WoW 3.3.5a client
This commit is contained in:
commit
ce6cb8f38e
147 changed files with 32347 additions and 0 deletions
84
include/ui/ui_manager.hpp
Normal file
84
include/ui/ui_manager.hpp
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#pragma once
|
||||
|
||||
#include "ui/auth_screen.hpp"
|
||||
#include "ui/realm_screen.hpp"
|
||||
#include "ui/character_screen.hpp"
|
||||
#include "ui/game_screen.hpp"
|
||||
#include <memory>
|
||||
|
||||
// Forward declare SDL_Event
|
||||
union SDL_Event;
|
||||
|
||||
namespace wowee {
|
||||
|
||||
// Forward declarations
|
||||
namespace core { class Window; enum class AppState; }
|
||||
namespace auth { class AuthHandler; }
|
||||
namespace game { class GameHandler; }
|
||||
|
||||
namespace ui {
|
||||
|
||||
/**
|
||||
* UIManager - Manages all UI screens and ImGui rendering
|
||||
*
|
||||
* Coordinates screen transitions and rendering based on application state
|
||||
*/
|
||||
class UIManager {
|
||||
public:
|
||||
UIManager();
|
||||
~UIManager();
|
||||
|
||||
/**
|
||||
* Initialize ImGui and UI screens
|
||||
* @param window Window instance for ImGui initialization
|
||||
*/
|
||||
bool initialize(core::Window* window);
|
||||
|
||||
/**
|
||||
* Shutdown ImGui and cleanup
|
||||
*/
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Update UI state
|
||||
* @param deltaTime Time since last frame in seconds
|
||||
*/
|
||||
void update(float deltaTime);
|
||||
|
||||
/**
|
||||
* Render UI based on current application state
|
||||
* @param appState Current application state
|
||||
* @param authHandler Authentication handler reference
|
||||
* @param gameHandler Game handler reference
|
||||
*/
|
||||
void render(core::AppState appState, auth::AuthHandler* authHandler, game::GameHandler* gameHandler);
|
||||
|
||||
/**
|
||||
* Process SDL event for ImGui
|
||||
* @param event SDL event to process
|
||||
*/
|
||||
void processEvent(const SDL_Event& event);
|
||||
|
||||
/**
|
||||
* Get screen instances for callback setup
|
||||
*/
|
||||
AuthScreen& getAuthScreen() { return *authScreen; }
|
||||
RealmScreen& getRealmScreen() { return *realmScreen; }
|
||||
CharacterScreen& getCharacterScreen() { return *characterScreen; }
|
||||
GameScreen& getGameScreen() { return *gameScreen; }
|
||||
|
||||
private:
|
||||
core::Window* window = nullptr;
|
||||
|
||||
// UI Screens
|
||||
std::unique_ptr<AuthScreen> authScreen;
|
||||
std::unique_ptr<RealmScreen> realmScreen;
|
||||
std::unique_ptr<CharacterScreen> characterScreen;
|
||||
std::unique_ptr<GameScreen> gameScreen;
|
||||
|
||||
// ImGui state
|
||||
bool imguiInitialized = false;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue