mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
feat: display permanent and temporary enchants in item tooltips for equipped items
Tracks ITEM_ENCHANTMENT_SLOT 0 (permanent) and 1 (temporary) from item update fields in OnlineItemInfo, then looks up names from SpellItemEnchantment.dbc and renders them in both ItemDef and ItemQueryResponseData tooltip variants.
This commit is contained in:
parent
4025e6576c
commit
1fd3d5fdc8
4 changed files with 118 additions and 8 deletions
|
|
@ -2125,6 +2125,16 @@ public:
|
|||
if (index < 0 || index >= static_cast<int>(backpackSlotGuids_.size())) return 0;
|
||||
return backpackSlotGuids_[index];
|
||||
}
|
||||
uint64_t getEquipSlotGuid(int slot) const {
|
||||
if (slot < 0 || slot >= static_cast<int>(equipSlotGuids_.size())) return 0;
|
||||
return equipSlotGuids_[slot];
|
||||
}
|
||||
// Returns the permanent and temporary enchant IDs for an item by GUID (0 if unknown).
|
||||
std::pair<uint32_t, uint32_t> getItemEnchantIds(uint64_t guid) const {
|
||||
auto it = onlineItems_.find(guid);
|
||||
if (it == onlineItems_.end()) return {0, 0};
|
||||
return {it->second.permanentEnchantId, it->second.temporaryEnchantId};
|
||||
}
|
||||
uint64_t getVendorGuid() const { return currentVendorItems.vendorGuid; }
|
||||
|
||||
/**
|
||||
|
|
@ -2621,6 +2631,8 @@ private:
|
|||
uint32_t stackCount = 1;
|
||||
uint32_t curDurability = 0;
|
||||
uint32_t maxDurability = 0;
|
||||
uint32_t permanentEnchantId = 0; // ITEM_ENCHANTMENT_SLOT 0 (enchanting)
|
||||
uint32_t temporaryEnchantId = 0; // ITEM_ENCHANTMENT_SLOT 1 (sharpening stones, poisons)
|
||||
};
|
||||
std::unordered_map<uint64_t, OnlineItemInfo> onlineItems_;
|
||||
std::unordered_map<uint32_t, ItemQueryResponseData> itemInfoCache_;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ private:
|
|||
std::unordered_map<uint32_t, VkDescriptorSet> iconCache_;
|
||||
public:
|
||||
VkDescriptorSet getItemIcon(uint32_t displayInfoId);
|
||||
void renderItemTooltip(const game::ItemQueryResponseData& info, const game::Inventory* inventory = nullptr);
|
||||
void renderItemTooltip(const game::ItemQueryResponseData& info, const game::Inventory* inventory = nullptr, uint64_t itemGuid = 0);
|
||||
private:
|
||||
|
||||
// Character model preview
|
||||
|
|
@ -161,7 +161,7 @@ private:
|
|||
SlotKind kind, int backpackIndex,
|
||||
game::EquipSlot equipSlot,
|
||||
int bagIndex = -1, int bagSlotIndex = -1);
|
||||
void renderItemTooltip(const game::ItemDef& item, const game::Inventory* inventory = nullptr);
|
||||
void renderItemTooltip(const game::ItemDef& item, const game::Inventory* inventory = nullptr, uint64_t itemGuid = 0);
|
||||
|
||||
// Held item helpers
|
||||
void pickupFromBackpack(game::Inventory& inv, int index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue