mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 16:50:15 +00:00
feat: store and display enchant indicators in inspect window gear list
This commit is contained in:
parent
7cb4887011
commit
d26bac0221
3 changed files with 13 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue