Initial commit: wowee native WoW 3.3.5a client

This commit is contained in:
Kelsi 2026-02-02 12:24:50 -08:00
commit ce6cb8f38e
147 changed files with 32347 additions and 0 deletions

View file

@ -0,0 +1,72 @@
#pragma once
#include "auth/auth_handler.hpp"
#include <string>
#include <functional>
namespace wowee { namespace ui {
/**
* Authentication screen UI
*
* Allows user to enter credentials and connect to auth server
*/
class AuthScreen {
public:
AuthScreen();
/**
* Render the UI
* @param authHandler Reference to auth handler
*/
void render(auth::AuthHandler& authHandler);
/**
* Set callback for successful authentication
*/
void setOnSuccess(std::function<void()> callback) { onSuccess = callback; }
/**
* Set callback for single-player mode
*/
void setOnSinglePlayer(std::function<void()> callback) { onSinglePlayer = callback; }
/**
* Check if authentication is in progress
*/
bool isAuthenticating() const { return authenticating; }
/**
* Get status message
*/
const std::string& getStatusMessage() const { return statusMessage; }
private:
// UI state
char hostname[256] = "127.0.0.1";
char username[256] = "";
char password[256] = "";
int port = 3724;
bool authenticating = false;
bool showPassword = false;
// Status
std::string statusMessage;
bool statusIsError = false;
// Callbacks
std::function<void()> onSuccess;
std::function<void()> onSinglePlayer;
/**
* Attempt authentication
*/
void attemptAuth(auth::AuthHandler& authHandler);
/**
* Update status message
*/
void setStatus(const std::string& message, bool isError = false);
};
}} // namespace wowee::ui

View file

@ -0,0 +1,66 @@
#pragma once
#include "game/game_handler.hpp"
#include <imgui.h>
#include <string>
#include <functional>
namespace wowee { namespace ui {
/**
* Character selection screen UI
*
* Displays character list and allows user to select one to play
*/
class CharacterScreen {
public:
CharacterScreen();
/**
* Render the UI
* @param gameHandler Reference to game handler
*/
void render(game::GameHandler& gameHandler);
/**
* Set callback for character selection
* @param callback Function to call when character is selected (receives character GUID)
*/
void setOnCharacterSelected(std::function<void(uint64_t)> callback) {
onCharacterSelected = callback;
}
/**
* Check if a character has been selected
*/
bool hasSelection() const { return characterSelected; }
/**
* Get selected character GUID
*/
uint64_t getSelectedGuid() const { return selectedCharacterGuid; }
private:
// UI state
int selectedCharacterIndex = -1;
bool characterSelected = false;
uint64_t selectedCharacterGuid = 0;
// Status
std::string statusMessage;
// Callbacks
std::function<void(uint64_t)> onCharacterSelected;
/**
* Update status message
*/
void setStatus(const std::string& message);
/**
* Get faction color based on race
*/
ImVec4 getFactionColor(game::Race race) const;
};
}} // namespace wowee::ui

104
include/ui/game_screen.hpp Normal file
View file

@ -0,0 +1,104 @@
#pragma once
#include "game/game_handler.hpp"
#include "game/inventory.hpp"
#include "ui/inventory_screen.hpp"
#include <imgui.h>
#include <string>
namespace wowee { namespace ui {
/**
* In-game screen UI
*
* Displays player info, entity list, chat, and game controls
*/
class GameScreen {
public:
GameScreen();
/**
* Render the UI
* @param gameHandler Reference to game handler
*/
void render(game::GameHandler& gameHandler);
/**
* Check if chat input is active
*/
bool isChatInputActive() const { return chatInputActive; }
private:
// Chat state
char chatInputBuffer[512] = "";
bool chatInputActive = false;
int selectedChatType = 0; // 0=SAY, 1=YELL, 2=PARTY, etc.
// UI state
bool showEntityWindow = true;
bool showChatWindow = true;
bool showPlayerInfo = true;
bool refocusChatInput = false;
/**
* Render player info window
*/
void renderPlayerInfo(game::GameHandler& gameHandler);
/**
* Render entity list window
*/
void renderEntityList(game::GameHandler& gameHandler);
/**
* Render chat window
*/
void renderChatWindow(game::GameHandler& gameHandler);
/**
* Send chat message
*/
void sendChatMessage(game::GameHandler& gameHandler);
/**
* Get chat type name
*/
const char* getChatTypeName(game::ChatType type) const;
/**
* Get chat type color
*/
ImVec4 getChatTypeColor(game::ChatType type) const;
/**
* Render player unit frame (top-left)
*/
void renderPlayerFrame(game::GameHandler& gameHandler);
/**
* Render target frame
*/
void renderTargetFrame(game::GameHandler& gameHandler);
/**
* Process targeting input (Tab, Escape, click)
*/
void processTargetInput(game::GameHandler& gameHandler);
/**
* Rebuild character geosets from current equipment state
*/
void updateCharacterGeosets(game::Inventory& inventory);
/**
* Re-composite character skin texture from current equipment
*/
void updateCharacterTextures(game::Inventory& inventory);
/**
* Inventory screen
*/
InventoryScreen inventoryScreen;
};
}} // namespace wowee::ui

View file

@ -0,0 +1,56 @@
#pragma once
#include "game/inventory.hpp"
#include <imgui.h>
namespace wowee {
namespace ui {
class InventoryScreen {
public:
void render(game::Inventory& inventory);
bool isOpen() const { return open; }
void toggle() { open = !open; }
void setOpen(bool o) { open = o; }
/// Returns true if equipment changed since last call, and clears the flag.
bool consumeEquipmentDirty() { bool d = equipmentDirty; equipmentDirty = false; return d; }
private:
bool open = false;
bool bKeyWasDown = false;
bool equipmentDirty = false;
// Drag-and-drop held item state
bool holdingItem = false;
game::ItemDef heldItem;
enum class HeldSource { NONE, BACKPACK, EQUIPMENT };
HeldSource heldSource = HeldSource::NONE;
int heldBackpackIndex = -1;
game::EquipSlot heldEquipSlot = game::EquipSlot::NUM_SLOTS;
void renderEquipmentPanel(game::Inventory& inventory);
void renderBackpackPanel(game::Inventory& inventory);
// Slot rendering with interaction support
enum class SlotKind { BACKPACK, EQUIPMENT };
void renderItemSlot(game::Inventory& inventory, const game::ItemSlot& slot,
float size, const char* label,
SlotKind kind, int backpackIndex,
game::EquipSlot equipSlot);
void renderItemTooltip(const game::ItemDef& item);
// Held item helpers
void pickupFromBackpack(game::Inventory& inv, int index);
void pickupFromEquipment(game::Inventory& inv, game::EquipSlot slot);
void placeInBackpack(game::Inventory& inv, int index);
void placeInEquipment(game::Inventory& inv, game::EquipSlot slot);
void cancelPickup(game::Inventory& inv);
game::EquipSlot getEquipSlotForType(uint8_t inventoryType, game::Inventory& inv);
void renderHeldItem();
static ImVec4 getQualityColor(game::ItemQuality quality);
};
} // namespace ui
} // namespace wowee

View file

@ -0,0 +1,73 @@
#pragma once
#include "auth/auth_handler.hpp"
#include <imgui.h>
#include <string>
#include <functional>
namespace wowee { namespace ui {
/**
* Realm selection screen UI
*
* Displays available realms and allows user to select one
*/
class RealmScreen {
public:
RealmScreen();
/**
* Render the UI
* @param authHandler Reference to auth handler
*/
void render(auth::AuthHandler& authHandler);
/**
* Set callback for realm selection
* @param callback Function to call when realm is selected (receives realm name and address)
*/
void setOnRealmSelected(std::function<void(const std::string&, const std::string&)> callback) {
onRealmSelected = callback;
}
/**
* Check if a realm has been selected
*/
bool hasSelection() const { return realmSelected; }
/**
* Get selected realm info
*/
const std::string& getSelectedName() const { return selectedRealmName; }
const std::string& getSelectedAddress() const { return selectedRealmAddress; }
private:
// UI state
int selectedRealmIndex = -1;
bool realmSelected = false;
std::string selectedRealmName;
std::string selectedRealmAddress;
// Status
std::string statusMessage;
// Callbacks
std::function<void(const std::string&, const std::string&)> onRealmSelected;
/**
* Update status message
*/
void setStatus(const std::string& message);
/**
* Get realm status text
*/
const char* getRealmStatus(uint8_t flags) const;
/**
* Get population color
*/
ImVec4 getPopulationColor(float population) const;
};
}} // namespace wowee::ui

84
include/ui/ui_manager.hpp Normal file
View 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