From 432da20b3e2897ca06e8dd58da93d6d349d8be61 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 24 Mar 2026 14:22:28 -0700 Subject: [PATCH] feat: enable crafting sounds and add Create All button Remove the isProfessionSpell sound suppression so crafting spells play precast and cast-complete audio like combat spells. Crafting was previously silent by design but users expect audio feedback. Add "Create All" button to the tradeskill UI that queues 999 crafts. The server automatically stops the queue when materials run out (SPELL_FAILED_REAGENTS cancels the craft queue). This matches the real WoW client's behavior for batch crafting. --- src/game/game_handler.cpp | 42 +++++++++++++++++---------------------- src/ui/game_screen.cpp | 6 ++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 981f04f7..57488d72 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -19592,18 +19592,15 @@ void GameHandler::handleSpellStart(network::Packet& packet) { castTimeRemaining = castTimeTotal; if (addonEventCallback_) addonEventCallback_("CURRENT_SPELL_CAST_CHANGED", {}); - // Play precast (channeling) sound with correct magic school - // Skip sound for profession/tradeskill spells (crafting should be silent) - if (!isProfessionSpell(data.spellId)) { - if (auto* renderer = core::Application::getInstance().getRenderer()) { - if (auto* ssm = renderer->getSpellSoundManager()) { - loadSpellNameCache(); - auto it = spellNameCache_.find(data.spellId); - auto school = (it != spellNameCache_.end() && it->second.schoolMask) - ? schoolMaskToMagicSchool(it->second.schoolMask) - : audio::SpellSoundManager::MagicSchool::ARCANE; - ssm->playPrecast(school, audio::SpellSoundManager::SpellPower::MEDIUM); - } + // Play precast sound with correct magic school (including crafting spells) + if (auto* renderer = core::Application::getInstance().getRenderer()) { + if (auto* ssm = renderer->getSpellSoundManager()) { + loadSpellNameCache(); + auto it = spellNameCache_.find(data.spellId); + auto school = (it != spellNameCache_.end() && it->second.schoolMask) + ? schoolMaskToMagicSchool(it->second.schoolMask) + : audio::SpellSoundManager::MagicSchool::ARCANE; + ssm->playPrecast(school, audio::SpellSoundManager::SpellPower::MEDIUM); } } @@ -19639,18 +19636,15 @@ void GameHandler::handleSpellGo(network::Packet& packet) { // Cast completed if (data.casterUnit == playerGuid) { - // Play cast-complete sound with correct magic school - // Skip sound for profession/tradeskill spells (crafting should be silent) - if (!isProfessionSpell(data.spellId)) { - if (auto* renderer = core::Application::getInstance().getRenderer()) { - if (auto* ssm = renderer->getSpellSoundManager()) { - loadSpellNameCache(); - auto it = spellNameCache_.find(data.spellId); - auto school = (it != spellNameCache_.end() && it->second.schoolMask) - ? schoolMaskToMagicSchool(it->second.schoolMask) - : audio::SpellSoundManager::MagicSchool::ARCANE; - ssm->playCast(school); - } + // Play cast-complete sound with correct magic school (including crafting) + if (auto* renderer = core::Application::getInstance().getRenderer()) { + if (auto* ssm = renderer->getSpellSoundManager()) { + loadSpellNameCache(); + auto it = spellNameCache_.find(data.spellId); + auto school = (it != spellNameCache_.end() && it->second.schoolMask) + ? schoolMaskToMagicSchool(it->second.schoolMask) + : audio::SpellSoundManager::MagicSchool::ARCANE; + ssm->playCast(school); } } diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index b74a78b5..26f0b8f2 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -17436,6 +17436,12 @@ void GameScreen::renderTrainerWindow(game::GameHandler& gameHandler) { gameHandler.startCraftQueue(selectedCraftSpell, craftQuantity); } } + ImGui::SameLine(); + if (ImGui::Button("Create All")) { + // Queue a large count — server stops the queue automatically + // when materials run out (sends SPELL_FAILED_REAGENTS). + gameHandler.startCraftQueue(selectedCraftSpell, 999); + } if (!canCraft) ImGui::EndDisabled(); } }