Skip to content

Commit

Permalink
Play sound for private messages
Browse files Browse the repository at this point in the history
  • Loading branch information
siecvi committed May 4, 2024
1 parent 9680d69 commit 8e89076
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/Client/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,15 @@ namespace spades {
if (cg_ignorePrivateMessages)
return;

std::string s = "PM from " + msg.substr(8);
chatWindow->AddMessage(ChatWindow::ColoredMessage(s, MsgColorGreen));
// play chat sound
if (!IsMuted()) {
Handle<IAudioChunk> c = audioDevice->RegisterSound("Sounds/Feedback/Chat.opus");
AudioParam params;
params.volume = (float)cg_chatBeep;
audioDevice->PlayLocal(c.GetPointerOrNull(), params);
}

chatWindow->AddMessage(ChatWindow::ColoredMessage(msg.substr(8), MsgColorGreen));
return;
}

Expand Down

0 comments on commit 8e89076

Please sign in to comment.