2026-02-02 12:24:50 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "game/game_handler.hpp"
|
|
|
|
|
#include "game/inventory.hpp"
|
2026-02-04 22:27:45 -08:00
|
|
|
#include "rendering/world_map.hpp"
|
2026-02-02 12:24:50 -08:00
|
|
|
#include "ui/inventory_screen.hpp"
|
2026-02-04 11:31:08 -08:00
|
|
|
#include "ui/spellbook_screen.hpp"
|
2026-02-02 12:24:50 -08:00
|
|
|
#include <imgui.h>
|
|
|
|
|
#include <string>
|
2026-02-05 15:07:13 -08:00
|
|
|
#include <unordered_map>
|
2026-02-02 12:24:50 -08:00
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
|
2026-02-04 18:27:52 -08:00
|
|
|
/**
|
|
|
|
|
* Toggle the teleporter panel
|
|
|
|
|
*/
|
|
|
|
|
void toggleTeleporter() { showTeleporter = !showTeleporter; }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Check if teleporter panel is open
|
|
|
|
|
*/
|
|
|
|
|
bool isTeleporterOpen() const { return showTeleporter; }
|
|
|
|
|
|
2026-02-02 12:24:50 -08:00
|
|
|
private:
|
|
|
|
|
// Chat state
|
|
|
|
|
char chatInputBuffer[512] = "";
|
|
|
|
|
bool chatInputActive = false;
|
|
|
|
|
int selectedChatType = 0; // 0=SAY, 1=YELL, 2=PARTY, etc.
|
|
|
|
|
|
|
|
|
|
// UI state
|
Add gameplay systems: combat, spells, groups, loot, vendors, and UI
Implement ~70 new protocol opcodes across 5 phases while maintaining
full 3.3.5a private server compatibility:
- Phase 1: Server-aware targeting (CMSG_SET_SELECTION), player/creature
name queries, CMSG_SET_ACTIVE_MOVER after login
- Phase 2: Auto-attack, melee/spell damage parsing, health/mana/power
tracking from UPDATE_OBJECT fields, floating combat text
- Phase 3: Spell casting, action bar (12 slots, keys 1-=), cast bar,
cooldown tracking, aura/buff system with cancellation
- Phase 4: Group invite/accept/decline/leave, party frames UI,
/invite chat command
- Phase 5: Loot window, NPC gossip dialog, vendor buy/sell interface
Also: disable debug HUD/panels by default, gate 3D rendering to
IN_GAME state only, fix window resize not updating UI positions.
2026-02-04 10:30:52 -08:00
|
|
|
bool showEntityWindow = false;
|
2026-02-02 12:24:50 -08:00
|
|
|
bool showChatWindow = true;
|
Add gameplay systems: combat, spells, groups, loot, vendors, and UI
Implement ~70 new protocol opcodes across 5 phases while maintaining
full 3.3.5a private server compatibility:
- Phase 1: Server-aware targeting (CMSG_SET_SELECTION), player/creature
name queries, CMSG_SET_ACTIVE_MOVER after login
- Phase 2: Auto-attack, melee/spell damage parsing, health/mana/power
tracking from UPDATE_OBJECT fields, floating combat text
- Phase 3: Spell casting, action bar (12 slots, keys 1-=), cast bar,
cooldown tracking, aura/buff system with cancellation
- Phase 4: Group invite/accept/decline/leave, party frames UI,
/invite chat command
- Phase 5: Loot window, NPC gossip dialog, vendor buy/sell interface
Also: disable debug HUD/panels by default, gate 3D rendering to
IN_GAME state only, fix window resize not updating UI positions.
2026-02-04 10:30:52 -08:00
|
|
|
bool showPlayerInfo = false;
|
2026-02-02 12:24:50 -08:00
|
|
|
bool refocusChatInput = false;
|
2026-02-04 18:27:52 -08:00
|
|
|
bool showTeleporter = false;
|
2026-02-05 16:01:38 -08:00
|
|
|
bool showEscapeMenu = false;
|
|
|
|
|
bool showEscapeSettingsNotice = false;
|
2026-02-02 12:24:50 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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);
|
|
|
|
|
|
Add gameplay systems: combat, spells, groups, loot, vendors, and UI
Implement ~70 new protocol opcodes across 5 phases while maintaining
full 3.3.5a private server compatibility:
- Phase 1: Server-aware targeting (CMSG_SET_SELECTION), player/creature
name queries, CMSG_SET_ACTIVE_MOVER after login
- Phase 2: Auto-attack, melee/spell damage parsing, health/mana/power
tracking from UPDATE_OBJECT fields, floating combat text
- Phase 3: Spell casting, action bar (12 slots, keys 1-=), cast bar,
cooldown tracking, aura/buff system with cancellation
- Phase 4: Group invite/accept/decline/leave, party frames UI,
/invite chat command
- Phase 5: Loot window, NPC gossip dialog, vendor buy/sell interface
Also: disable debug HUD/panels by default, gate 3D rendering to
IN_GAME state only, fix window resize not updating UI positions.
2026-02-04 10:30:52 -08:00
|
|
|
// ---- New UI renders ----
|
|
|
|
|
void renderActionBar(game::GameHandler& gameHandler);
|
2026-02-05 12:07:58 -08:00
|
|
|
void renderXpBar(game::GameHandler& gameHandler);
|
Add gameplay systems: combat, spells, groups, loot, vendors, and UI
Implement ~70 new protocol opcodes across 5 phases while maintaining
full 3.3.5a private server compatibility:
- Phase 1: Server-aware targeting (CMSG_SET_SELECTION), player/creature
name queries, CMSG_SET_ACTIVE_MOVER after login
- Phase 2: Auto-attack, melee/spell damage parsing, health/mana/power
tracking from UPDATE_OBJECT fields, floating combat text
- Phase 3: Spell casting, action bar (12 slots, keys 1-=), cast bar,
cooldown tracking, aura/buff system with cancellation
- Phase 4: Group invite/accept/decline/leave, party frames UI,
/invite chat command
- Phase 5: Loot window, NPC gossip dialog, vendor buy/sell interface
Also: disable debug HUD/panels by default, gate 3D rendering to
IN_GAME state only, fix window resize not updating UI positions.
2026-02-04 10:30:52 -08:00
|
|
|
void renderCastBar(game::GameHandler& gameHandler);
|
|
|
|
|
void renderCombatText(game::GameHandler& gameHandler);
|
|
|
|
|
void renderPartyFrames(game::GameHandler& gameHandler);
|
|
|
|
|
void renderGroupInvitePopup(game::GameHandler& gameHandler);
|
|
|
|
|
void renderBuffBar(game::GameHandler& gameHandler);
|
|
|
|
|
void renderLootWindow(game::GameHandler& gameHandler);
|
|
|
|
|
void renderGossipWindow(game::GameHandler& gameHandler);
|
|
|
|
|
void renderVendorWindow(game::GameHandler& gameHandler);
|
2026-02-04 18:27:52 -08:00
|
|
|
void renderTeleporterPanel();
|
2026-02-05 16:01:38 -08:00
|
|
|
void renderEscapeMenu();
|
Add gameplay systems: combat, spells, groups, loot, vendors, and UI
Implement ~70 new protocol opcodes across 5 phases while maintaining
full 3.3.5a private server compatibility:
- Phase 1: Server-aware targeting (CMSG_SET_SELECTION), player/creature
name queries, CMSG_SET_ACTIVE_MOVER after login
- Phase 2: Auto-attack, melee/spell damage parsing, health/mana/power
tracking from UPDATE_OBJECT fields, floating combat text
- Phase 3: Spell casting, action bar (12 slots, keys 1-=), cast bar,
cooldown tracking, aura/buff system with cancellation
- Phase 4: Group invite/accept/decline/leave, party frames UI,
/invite chat command
- Phase 5: Loot window, NPC gossip dialog, vendor buy/sell interface
Also: disable debug HUD/panels by default, gate 3D rendering to
IN_GAME state only, fix window resize not updating UI positions.
2026-02-04 10:30:52 -08:00
|
|
|
|
2026-02-02 12:24:50 -08:00
|
|
|
/**
|
|
|
|
|
* Inventory screen
|
|
|
|
|
*/
|
2026-02-04 22:27:45 -08:00
|
|
|
void renderWorldMap(game::GameHandler& gameHandler);
|
|
|
|
|
|
2026-02-02 12:24:50 -08:00
|
|
|
InventoryScreen inventoryScreen;
|
2026-02-04 11:31:08 -08:00
|
|
|
SpellbookScreen spellbookScreen;
|
2026-02-04 22:27:45 -08:00
|
|
|
rendering::WorldMap worldMap;
|
2026-02-05 15:07:13 -08:00
|
|
|
|
|
|
|
|
bool actionSpellDbAttempted = false;
|
|
|
|
|
bool actionSpellDbLoaded = false;
|
|
|
|
|
std::unordered_map<uint32_t, std::string> actionSpellNames;
|
2026-02-02 12:24:50 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}} // namespace wowee::ui
|