mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: play audio notification when a whisper is received
Adds UiSoundManager::playWhisperReceived() which uses the dedicated Whisper_TellMale/Female.wav files (or falls back to iSelectTarget.wav if absent). The sound is triggered once per new incoming CHAT_MSG_WHISPER message by scanning new chat history entries in the raid warning overlay update loop.
This commit is contained in:
parent
bcd984c1c5
commit
39bf8fb01e
3 changed files with 21 additions and 0 deletions
|
|
@ -6325,6 +6325,7 @@ void GameScreen::renderRaidWarningOverlay(game::GameHandler& gameHandler) {
|
|||
// Walk only the new messages (deque — iterate from back by skipping old ones)
|
||||
size_t toScan = newCount - raidWarnChatSeenCount_;
|
||||
size_t startIdx = newCount > toScan ? newCount - toScan : 0;
|
||||
auto* renderer = core::Application::getInstance().getRenderer();
|
||||
for (size_t i = startIdx; i < newCount; ++i) {
|
||||
const auto& msg = chatHistory[i];
|
||||
if (msg.type == game::ChatType::RAID_WARNING ||
|
||||
|
|
@ -6338,6 +6339,11 @@ void GameScreen::renderRaidWarningOverlay(game::GameHandler& gameHandler) {
|
|||
if (raidWarnEntries_.size() > 3)
|
||||
raidWarnEntries_.erase(raidWarnEntries_.begin());
|
||||
}
|
||||
// Whisper audio notification
|
||||
if (msg.type == game::ChatType::WHISPER && renderer) {
|
||||
if (auto* ui = renderer->getUiSoundManager())
|
||||
ui->playWhisperReceived();
|
||||
}
|
||||
}
|
||||
raidWarnChatSeenCount_ = newCount;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue