mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
feat: add audio feedback for item loot, vendor buy/sell, and spell learning
Wire up remaining UISoundManager calls for core gameplay actions: - playLootItem() on SMSG_ITEM_PUSH_RESULT and handleLootRemoved - playPickupBag() on successful vendor purchase (SMSG_BUY_ITEM) - playDropOnGround() on successful item sell (SMSG_SELL_ITEM) - playQuestActivate() on trainer spell purchase success
This commit is contained in:
parent
a0b978f95b
commit
6fbf5b5797
1 changed files with 20 additions and 0 deletions
|
|
@ -1940,6 +1940,10 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
std::string msg = "Received: " + itemName;
|
std::string msg = "Received: " + itemName;
|
||||||
if (count > 1) msg += " x" + std::to_string(count);
|
if (count > 1) msg += " x" + std::to_string(count);
|
||||||
addSystemChatMessage(msg);
|
addSystemChatMessage(msg);
|
||||||
|
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||||
|
if (auto* sfx = renderer->getUiSoundManager())
|
||||||
|
sfx->playLootItem();
|
||||||
|
}
|
||||||
if (itemLootCallback_) {
|
if (itemLootCallback_) {
|
||||||
itemLootCallback_(itemId, count, quality, itemName);
|
itemLootCallback_(itemId, count, quality, itemName);
|
||||||
}
|
}
|
||||||
|
|
@ -3899,6 +3903,10 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
addSystemChatMessage("You have learned " + name + ".");
|
addSystemChatMessage("You have learned " + name + ".");
|
||||||
else
|
else
|
||||||
addSystemChatMessage("Spell learned.");
|
addSystemChatMessage("Spell learned.");
|
||||||
|
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||||
|
if (auto* sfx = renderer->getUiSoundManager())
|
||||||
|
sfx->playQuestActivate();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Opcode::SMSG_TRAINER_BUY_FAILED: {
|
case Opcode::SMSG_TRAINER_BUY_FAILED: {
|
||||||
|
|
@ -4504,6 +4512,10 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
" result=", static_cast<int>(result));
|
" result=", static_cast<int>(result));
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
pendingSellToBuyback_.erase(itemGuid);
|
pendingSellToBuyback_.erase(itemGuid);
|
||||||
|
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||||
|
if (auto* sfx = renderer->getUiSoundManager())
|
||||||
|
sfx->playDropOnGround();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
bool removedPending = false;
|
bool removedPending = false;
|
||||||
auto it = pendingSellToBuyback_.find(itemGuid);
|
auto it = pendingSellToBuyback_.find(itemGuid);
|
||||||
|
|
@ -4748,6 +4760,10 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
std::string msg = "Purchased: " + itemLabel;
|
std::string msg = "Purchased: " + itemLabel;
|
||||||
if (itemCount > 1) msg += " x" + std::to_string(itemCount);
|
if (itemCount > 1) msg += " x" + std::to_string(itemCount);
|
||||||
addSystemChatMessage(msg);
|
addSystemChatMessage(msg);
|
||||||
|
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||||
|
if (auto* sfx = renderer->getUiSoundManager())
|
||||||
|
sfx->playPickupBag();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pendingBuyItemId_ = 0;
|
pendingBuyItemId_ = 0;
|
||||||
pendingBuyItemSlot_ = 0;
|
pendingBuyItemSlot_ = 0;
|
||||||
|
|
@ -20800,6 +20816,10 @@ void GameHandler::handleLootRemoved(network::Packet& packet) {
|
||||||
msg << " x" << it->count;
|
msg << " x" << it->count;
|
||||||
}
|
}
|
||||||
addSystemChatMessage(msg.str());
|
addSystemChatMessage(msg.str());
|
||||||
|
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||||
|
if (auto* sfx = renderer->getUiSoundManager())
|
||||||
|
sfx->playLootItem();
|
||||||
|
}
|
||||||
currentLoot.items.erase(it);
|
currentLoot.items.erase(it);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue