mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: highlight required level in item tooltips when player is under-level
Display 'Requires Level N' in red when the player does not meet the item's level requirement, and in normal colour when they do. Applies to both equipped-item and bag-item tooltip paths.
This commit is contained in:
parent
00a939a733
commit
b658743e94
1 changed files with 8 additions and 2 deletions
|
|
@ -1880,7 +1880,10 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item, const game::I
|
|||
}
|
||||
|
||||
if (item.requiredLevel > 1) {
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.5f, 0.5f, 1.0f), "Requires Level %u", item.requiredLevel);
|
||||
uint32_t playerLvl = gameHandler_ ? gameHandler_->getPlayerLevel() : 0;
|
||||
bool meetsReq = (playerLvl >= item.requiredLevel);
|
||||
ImVec4 reqColor = meetsReq ? ImVec4(1.0f, 1.0f, 1.0f, 0.75f) : ImVec4(1.0f, 0.5f, 0.5f, 1.0f);
|
||||
ImGui::TextColored(reqColor, "Requires Level %u", item.requiredLevel);
|
||||
}
|
||||
if (item.maxDurability > 0) {
|
||||
float durPct = static_cast<float>(item.curDurability) / static_cast<float>(item.maxDurability);
|
||||
|
|
@ -2149,7 +2152,10 @@ void InventoryScreen::renderItemTooltip(const game::ItemQueryResponseData& info)
|
|||
}
|
||||
|
||||
if (info.requiredLevel > 1) {
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.5f, 0.5f, 1.0f), "Requires Level %u", info.requiredLevel);
|
||||
uint32_t playerLvl = gameHandler_ ? gameHandler_->getPlayerLevel() : 0;
|
||||
bool meetsReq = (playerLvl >= info.requiredLevel);
|
||||
ImVec4 reqColor = meetsReq ? ImVec4(1.0f, 1.0f, 1.0f, 0.75f) : ImVec4(1.0f, 0.5f, 0.5f, 1.0f);
|
||||
ImGui::TextColored(reqColor, "Requires Level %u", info.requiredLevel);
|
||||
}
|
||||
|
||||
// Spell effects
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue