From c31ab8c8b620b59c704c017a2f2a4f368cc8ec57 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 10:05:10 -0700 Subject: [PATCH] feat: play error sound when UI error messages are triggered --- src/ui/game_screen.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 2776108f..0c9ece01 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -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; }