mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
fix: add proficiency warning to vendor/loot item tooltips
The proficiency check added in the previous commit only applied to the ItemDef tooltip variant (inventory items). Vendor, loot, and AH tooltips use the ItemQueryResponseData variant which was missing the check. Now both tooltip paths show "You can't use this type of item." in red when the player lacks weapon or armor proficiency.
This commit is contained in:
parent
120c2967eb
commit
6b7975107e
1 changed files with 11 additions and 0 deletions
|
|
@ -3298,6 +3298,17 @@ void InventoryScreen::renderItemTooltip(const game::ItemQueryResponseData& info,
|
|||
else
|
||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", slotName);
|
||||
}
|
||||
|
||||
// Proficiency check for vendor/loot tooltips (ItemQueryResponseData has itemClass/subClass)
|
||||
if (gameHandler_) {
|
||||
bool canUse = true;
|
||||
if (info.itemClass == 2) // Weapon
|
||||
canUse = gameHandler_->canUseWeaponSubclass(info.subClass);
|
||||
else if (info.itemClass == 4 && info.subClass > 0) // Armor (skip subclass 0 = misc)
|
||||
canUse = gameHandler_->canUseArmorSubclass(info.subClass);
|
||||
if (!canUse)
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.2f, 0.2f, 1.0f), "You can't use this type of item.");
|
||||
}
|
||||
}
|
||||
|
||||
// Weapon stats
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue