From f5d23a3a1225cbe9a6c3461391d9534ab1dcdb4c Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 20:28:03 -0700 Subject: [PATCH] feat: add equipment set manager window (backtick key) Lists all saved equipment sets from SMSG_EQUIPMENT_SET_LIST with icon placeholder and an Equip button per set. Clicking either the icon or the Equip button sends CMSG_EQUIPMENT_SET_USE to swap the player's gear to that set. Window toggled with the ` (backtick) key. --- include/ui/game_screen.hpp | 4 +++ src/ui/game_screen.cpp | 71 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/include/ui/game_screen.hpp b/include/ui/game_screen.hpp index 846381c4..0fb98ba3 100644 --- a/include/ui/game_screen.hpp +++ b/include/ui/game_screen.hpp @@ -433,6 +433,10 @@ private: bool showTitlesWindow_ = false; void renderTitlesWindow(game::GameHandler& gameHandler); + // Equipment Set Manager window + bool showEquipSetWindow_ = false; + void renderEquipSetWindow(game::GameHandler& gameHandler); + // GM Ticket window bool showGmTicketWindow_ = false; char gmTicketBuf_[2048] = {}; diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index ef73a16c..a711ae9f 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -711,6 +711,7 @@ void GameScreen::render(game::GameHandler& gameHandler) { renderCombatLog(gameHandler); renderAchievementWindow(gameHandler); renderTitlesWindow(gameHandler); + renderEquipSetWindow(gameHandler); renderGmTicketWindow(gameHandler); renderInspectWindow(gameHandler); renderBookWindow(gameHandler); @@ -2339,6 +2340,11 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) { showTitlesWindow_ = !showTitlesWindow_; } + // Toggle Equipment Set Manager with ` (backtick / grave — unused in standard WoW) + if (input.isKeyJustPressed(SDL_SCANCODE_GRAVE) && !ImGui::GetIO().WantCaptureKeyboard) { + showEquipSetWindow_ = !showEquipSetWindow_; + } + // Action bar keys (1-9, 0, -, =) static const SDL_Scancode actionBarKeys[] = { SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, @@ -20719,4 +20725,69 @@ void GameScreen::renderTitlesWindow(game::GameHandler& gameHandler) { ImGui::End(); } +// ─── Equipment Set Manager Window ───────────────────────────────────────────── +void GameScreen::renderEquipSetWindow(game::GameHandler& gameHandler) { + if (!showEquipSetWindow_) return; + + ImGui::SetNextWindowSize(ImVec2(280, 320), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(260, 180), ImGuiCond_FirstUseEver); + + if (!ImGui::Begin("Equipment Sets##equipsets", &showEquipSetWindow_)) { + ImGui::End(); + return; + } + + const auto& sets = gameHandler.getEquipmentSets(); + + if (sets.empty()) { + ImGui::TextDisabled("No equipment sets saved."); + ImGui::Spacing(); + ImGui::TextWrapped("Create equipment sets in-game using the default WoW equipment manager (Shift+click the Equipment Sets button)."); + ImGui::End(); + return; + } + + ImGui::TextUnformatted("Click a set to equip it:"); + ImGui::Separator(); + ImGui::Spacing(); + + ImGui::BeginChild("##equipsetlist", ImVec2(0, 0), false); + for (const auto& set : sets) { + ImGui::PushID(static_cast(set.setId)); + + // Icon placeholder (use a coloured square if no icon texture available) + ImVec2 iconSize(32.0f, 32.0f); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.25f, 0.20f, 0.10f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.40f, 0.30f, 0.15f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.60f, 0.45f, 0.20f, 1.0f)); + if (ImGui::Button("##icon", iconSize)) { + gameHandler.useEquipmentSet(set.setId); + } + ImGui::PopStyleColor(3); + + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Equip set: %s", set.name.c_str()); + } + + ImGui::SameLine(); + + // Name and equip button + ImGui::BeginGroup(); + ImGui::TextUnformatted(set.name.c_str()); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.20f, 0.35f, 0.15f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.30f, 0.50f, 0.22f, 1.0f)); + if (ImGui::SmallButton("Equip")) { + gameHandler.useEquipmentSet(set.setId); + } + ImGui::PopStyleColor(2); + ImGui::EndGroup(); + + ImGui::Spacing(); + ImGui::PopID(); + } + ImGui::EndChild(); + + ImGui::End(); +} + }} // namespace wowee::ui