From 6b7975107ed93decd8acf5369676b0981b46ae79 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 06:07:38 -0700 Subject: [PATCH] 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. --- src/ui/inventory_screen.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ui/inventory_screen.cpp b/src/ui/inventory_screen.cpp index e9fcf39a..2ea91c10 100644 --- a/src/ui/inventory_screen.cpp +++ b/src/ui/inventory_screen.cpp @@ -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