feat: add auto-repair at vendor open

When 'Auto Repair' is enabled in Settings > Gameplay, all damaged
equipment is automatically repaired when opening any armorer vendor
(canRepair=true). The repair is skipped when no items are actually
damaged to avoid a pointless server round-trip. A system chat message
confirms the repair. Setting persists to ~/.wowee/settings.cfg as
auto_repair.
This commit is contained in:
Kelsi 2026-03-17 20:27:45 -07:00
parent 072f256af6
commit d44d462686
4 changed files with 30 additions and 0 deletions

View file

@ -595,6 +595,7 @@ void GameScreen::render(game::GameHandler& gameHandler) {
// Apply auto-loot / auto-sell settings to GameHandler every frame (cheap bool sync)
gameHandler.setAutoLoot(pendingAutoLoot);
gameHandler.setAutoSellGrey(pendingAutoSellGrey);
gameHandler.setAutoRepair(pendingAutoRepair);
// Zone entry detection — fire a toast when the renderer's zone name changes
if (auto* rend = core::Application::getInstance().getRenderer()) {
@ -16334,6 +16335,11 @@ void GameScreen::renderSettingsWindow() {
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Automatically sell all grey (poor quality) items when opening a vendor");
if (ImGui::Checkbox("Auto Repair", &pendingAutoRepair)) {
saveSettings();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Automatically repair all damaged equipment when opening an armorer vendor");
ImGui::Spacing();
ImGui::Text("Bags");
@ -18335,6 +18341,7 @@ void GameScreen::saveSettings() {
// Gameplay
out << "auto_loot=" << (pendingAutoLoot ? 1 : 0) << "\n";
out << "auto_sell_grey=" << (pendingAutoSellGrey ? 1 : 0) << "\n";
out << "auto_repair=" << (pendingAutoRepair ? 1 : 0) << "\n";
out << "graphics_preset=" << static_cast<int>(currentGraphicsPreset) << "\n";
out << "ground_clutter_density=" << pendingGroundClutterDensity << "\n";
out << "shadows=" << (pendingShadows ? 1 : 0) << "\n";
@ -18477,6 +18484,7 @@ void GameScreen::loadSettings() {
// Gameplay
else if (key == "auto_loot") pendingAutoLoot = (std::stoi(val) != 0);
else if (key == "auto_sell_grey") pendingAutoSellGrey = (std::stoi(val) != 0);
else if (key == "auto_repair") pendingAutoRepair = (std::stoi(val) != 0);
else if (key == "graphics_preset") {
int presetVal = std::clamp(std::stoi(val), 0, 4);
currentGraphicsPreset = static_cast<GraphicsPreset>(presetVal);