feat: play error sound when UI error messages are triggered

This commit is contained in:
Kelsi 2026-03-13 10:05:10 -07:00
parent 44ff2dd4ee
commit c31ab8c8b6

View file

@ -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;
}