mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: show proficiency warning in item tooltips
Item tooltips now display a red "You can't use this type of item." warning when the player lacks proficiency for the weapon or armor subclass (e.g. a mage hovering over a plate item or a two-handed sword). Uses the existing canUseWeaponSubclass/canUseArmorSubclass checks against SMSG_SET_PROFICIENCY bitmasks.
This commit is contained in:
parent
bc2085b0fc
commit
120c2967eb
1 changed files with 14 additions and 0 deletions
|
|
@ -2627,6 +2627,20 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I
|
|||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", slotName);
|
||||
}
|
||||
}
|
||||
|
||||
// Show red warning if player lacks proficiency for this weapon/armor type
|
||||
if (gameHandler_) {
|
||||
const auto* qi = gameHandler_->getItemInfo(item.itemId);
|
||||
if (qi && qi->valid) {
|
||||
bool canUse = true;
|
||||
if (qi->itemClass == 2) // Weapon
|
||||
canUse = gameHandler_->canUseWeaponSubclass(qi->subClass);
|
||||
else if (qi->itemClass == 4 && qi->subClass > 0) // Armor (skip subclass 0 = misc)
|
||||
canUse = gameHandler_->canUseArmorSubclass(qi->subClass);
|
||||
if (!canUse)
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.2f, 0.2f, 1.0f), "You can't use this type of item.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto isWeaponInventoryType = [](uint32_t invType) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue