feat: store and display enchant indicators in inspect window gear list

This commit is contained in:
Kelsi 2026-03-12 07:37:29 -07:00
parent 7cb4887011
commit d26bac0221
3 changed files with 13 additions and 2 deletions

View file

@ -339,7 +339,8 @@ public:
uint32_t unspentTalents = 0;
uint8_t talentGroups = 0;
uint8_t activeTalentGroup = 0;
std::array<uint32_t, 19> itemEntries{}; // 0=head…18=ranged
std::array<uint32_t, 19> itemEntries{}; // 0=head…18=ranged
std::array<uint16_t, 19> enchantIds{}; // permanent enchant per slot (0 = none)
};
const InspectResult* getInspectResult() const {
return inspectResult_.guid ? &inspectResult_ : nullptr;

View file

@ -11339,6 +11339,7 @@ void GameHandler::handleInspectResults(network::Packet& packet) {
}
// Parse enchantment slot mask + enchant IDs
std::array<uint16_t, 19> 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);

View file

@ -16508,6 +16508,7 @@ void GameScreen::renderInspectWindow(game::GameHandler& gameHandler) {
ImGui::PushID(s);
auto qColor = InventoryScreen::getQualityColor(
static_cast<game::ItemQuality>(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<unsigned>(enchantId));
}
ImGui::EndGroup();
hovered = hovered || ImGui::IsItemHovered();