mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
fix: add error sound on cast failure and AFK/DND whisper auto-reply
Play UI error sound on SMSG_CAST_FAILED for consistent audio feedback, matching other error handlers (vendor, inventory, trainer). Auto-reply to incoming whispers with AFK/DND message when player has set /afk or /dnd status.
This commit is contained in:
parent
2dc5b21341
commit
7f2ee8aa7e
1 changed files with 15 additions and 0 deletions
|
|
@ -12759,6 +12759,15 @@ void GameHandler::handleMessageChat(network::Packet& packet) {
|
|||
// Track whisper sender for /r command
|
||||
if (data.type == ChatType::WHISPER && !data.senderName.empty()) {
|
||||
lastWhisperSender_ = data.senderName;
|
||||
|
||||
// Auto-reply if AFK or DND
|
||||
if (afkStatus_ && !data.senderName.empty()) {
|
||||
std::string reply = afkMessage_.empty() ? "Away from Keyboard" : afkMessage_;
|
||||
sendChatMessage(ChatType::WHISPER, "<AFK> " + reply, data.senderName);
|
||||
} else if (dndStatus_ && !data.senderName.empty()) {
|
||||
std::string reply = dndMessage_.empty() ? "Do Not Disturb" : dndMessage_;
|
||||
sendChatMessage(ChatType::WHISPER, "<DND> " + reply, data.senderName);
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger chat bubble for SAY/YELL messages from others
|
||||
|
|
@ -18533,6 +18542,12 @@ void GameHandler::handleCastFailed(network::Packet& packet) {
|
|||
msg.language = ChatLanguage::UNIVERSAL;
|
||||
msg.message = errMsg;
|
||||
addLocalChatMessage(msg);
|
||||
|
||||
// Play error sound for cast failure feedback
|
||||
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
sfx->playError();
|
||||
}
|
||||
}
|
||||
|
||||
static audio::SpellSoundManager::MagicSchool schoolMaskToMagicSchool(uint32_t mask) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue