mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: play error sound when UI error messages are triggered
This commit is contained in:
parent
44ff2dd4ee
commit
c31ab8c8b6
1 changed files with 4 additions and 0 deletions
|
|
@ -395,6 +395,10 @@ void GameScreen::render(game::GameHandler& gameHandler) {
|
|||
gameHandler.setUIErrorCallback([this](const std::string& msg) {
|
||||
uiErrors_.push_back({msg, 0.0f});
|
||||
if (uiErrors_.size() > 5) uiErrors_.erase(uiErrors_.begin());
|
||||
// Play error sound for each new error (rate-limited by deque cap of 5)
|
||||
if (auto* r = core::Application::getInstance().getRenderer()) {
|
||||
if (auto* sfx = r->getUiSoundManager()) sfx->playError();
|
||||
}
|
||||
});
|
||||
uiErrorCallbackSet_ = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue