mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
feat(repair): DBC-based repair cost estimation and UI display
Calculate repair costs client-side using DurabilityCosts.dbc and DurabilityQuality.dbc. Block repair when player can't afford it and only apply optimistic durability/gold updates when cost is verified. Show repair cost next to the Repair All button in the vendor window.
This commit is contained in:
parent
3dec33ecf1
commit
53244d025c
7 changed files with 160 additions and 14 deletions
|
|
@ -896,11 +896,16 @@ void WindowManager::renderVendorWindow(game::GameHandler& gameHandler,
|
|||
renderCoinsFromCopper(money);
|
||||
|
||||
if (vendor.canRepair) {
|
||||
uint32_t repairCost = gameHandler.estimateRepairAllCost();
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 8.0f);
|
||||
if (ImGui::SmallButton("Repair All")) {
|
||||
gameHandler.repairAll(vendor.vendorGuid, false);
|
||||
}
|
||||
if (repairCost > 0) {
|
||||
ImGui::SameLine(0, 4);
|
||||
renderCoinsFromCopper(repairCost);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
// Show durability summary of all equipment
|
||||
const auto& inv = gameHandler.getInventory();
|
||||
|
|
@ -925,7 +930,7 @@ void WindowManager::renderVendorWindow(game::GameHandler& gameHandler,
|
|||
gameHandler.repairAll(vendor.vendorGuid, true);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Repair all equipped items using guild bank funds");
|
||||
ImGui::SetTooltip("Repair all items using guild bank funds");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue