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:
Kelsi 2026-03-20 06:07:38 -07:00
parent 120c2967eb
commit 6b7975107e

View file

@ -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