diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 97a023ab..81257c6f 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -339,7 +339,8 @@ public: uint32_t unspentTalents = 0; uint8_t talentGroups = 0; uint8_t activeTalentGroup = 0; - std::array itemEntries{}; // 0=head…18=ranged + std::array itemEntries{}; // 0=head…18=ranged + std::array enchantIds{}; // permanent enchant per slot (0 = none) }; const InspectResult* getInspectResult() const { return inspectResult_.guid ? &inspectResult_ : nullptr; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index b8205e8a..3b643674 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -11339,6 +11339,7 @@ void GameHandler::handleInspectResults(network::Packet& packet) { } // Parse enchantment slot mask + enchant IDs + std::array enchantIds{}; bytesLeft = packet.getSize() - packet.getReadPos(); if (bytesLeft >= 4) { uint32_t slotMask = packet.readUInt32(); @@ -11346,7 +11347,7 @@ void GameHandler::handleInspectResults(network::Packet& packet) { if (slotMask & (1u << slot)) { bytesLeft = packet.getSize() - packet.getReadPos(); if (bytesLeft < 2) break; - packet.readUInt16(); // enchantId + enchantIds[slot] = packet.readUInt16(); } } } @@ -11358,6 +11359,7 @@ void GameHandler::handleInspectResults(network::Packet& packet) { inspectResult_.unspentTalents = unspentTalents; inspectResult_.talentGroups = talentGroupCount; inspectResult_.activeTalentGroup = activeTalentGroup; + inspectResult_.enchantIds = enchantIds; // Merge any gear we already have from a prior inspect request auto gearIt = inspectedPlayerItemEntries_.find(guid); diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 6ce06e12..548ed9ef 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -16508,6 +16508,7 @@ void GameScreen::renderInspectWindow(game::GameHandler& gameHandler) { ImGui::PushID(s); auto qColor = InventoryScreen::getQualityColor( static_cast(info->quality)); + uint16_t enchantId = result->enchantIds[s]; // Item icon VkDescriptorSet iconTex = inventoryScreen.getItemIcon(info->displayInfoId); @@ -16530,6 +16531,13 @@ void GameScreen::renderInspectWindow(game::GameHandler& gameHandler) { ImGui::BeginGroup(); ImGui::TextDisabled("%s", kSlotNames[s]); ImGui::TextColored(qColor, "%s", info->name.c_str()); + // Enchant indicator on the same row as the name + if (enchantId != 0) { + ImGui::SameLine(); + ImGui::TextColored(ImVec4(0.6f, 0.85f, 1.0f, 1.0f), "\xe2\x9c\xa6"); // UTF-8 ✦ + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("Enchanted (ID %u)", static_cast(enchantId)); + } ImGui::EndGroup(); hovered = hovered || ImGui::IsItemHovered();