mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
fix: show equipment durability summary in repair button tooltip
The Repair All button tooltip now shows how many items are damaged or broken instead of a generic message, helping players gauge repair need.
This commit is contained in:
parent
4a30fdf9f6
commit
f283f9eb86
1 changed files with 16 additions and 1 deletions
|
|
@ -15890,7 +15890,22 @@ void GameScreen::renderVendorWindow(game::GameHandler& gameHandler) {
|
|||
gameHandler.repairAll(vendor.vendorGuid, false);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Repair all equipped items using your gold");
|
||||
// Show durability summary of all equipment
|
||||
const auto& inv = gameHandler.getInventory();
|
||||
int damagedCount = 0;
|
||||
int brokenCount = 0;
|
||||
for (int s = 0; s < static_cast<int>(game::EquipSlot::BAG1); s++) {
|
||||
const auto& slot = inv.getEquipSlot(static_cast<game::EquipSlot>(s));
|
||||
if (slot.empty() || slot.item.maxDurability == 0) continue;
|
||||
if (slot.item.curDurability == 0) brokenCount++;
|
||||
else if (slot.item.curDurability < slot.item.maxDurability) damagedCount++;
|
||||
}
|
||||
if (brokenCount > 0)
|
||||
ImGui::SetTooltip("Repair all equipped items\n%d damaged, %d broken", damagedCount, brokenCount);
|
||||
else if (damagedCount > 0)
|
||||
ImGui::SetTooltip("Repair all equipped items\n%d item%s need repair", damagedCount, damagedCount > 1 ? "s" : "");
|
||||
else
|
||||
ImGui::SetTooltip("All equipment is in good condition");
|
||||
}
|
||||
if (gameHandler.isInGuild()) {
|
||||
ImGui::SameLine();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue