mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 08:30:13 +00:00
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.
This commit is contained in:
parent
1dd3823013
commit
432da20b3e
2 changed files with 24 additions and 24 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue