diff --git a/UI/BackgroundAudio.cpp b/UI/BackgroundAudio.cpp index 794992adc9..82cb981a9c 100644 --- a/UI/BackgroundAudio.cpp +++ b/UI/BackgroundAudio.cpp @@ -369,7 +369,7 @@ int BackgroundAudio::Play() { } } - // Mix in menu sound effects + // Mix in menu sound effects. Terribly slow mixer but meh. if (!plays_.empty()) { for (int i = 0; i < sz * 2; i += 2) { std::vector::iterator iter = plays_.begin(); diff --git a/ext/native/ui/root.cpp b/ext/native/ui/root.cpp index d65bfc0d33..5533359c7c 100644 --- a/ext/native/ui/root.cpp +++ b/ext/native/ui/root.cpp @@ -147,7 +147,7 @@ void SetSoundCallback(std::function func) { void PlayUISound(UISound sound) { if (soundCallback) { - soundCallback(UISound::SELECT); + soundCallback(sound); } } diff --git a/ext/native/ui/root.h b/ext/native/ui/root.h index 5d13c51e2d..97923f93e0 100644 --- a/ext/native/ui/root.h +++ b/ext/native/ui/root.h @@ -1,6 +1,7 @@ #pragma once #include + #include "ui/ui_context.h" #include "input/input_state.h" diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index 0a2a665e34..74e31c8601 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -157,6 +157,10 @@ bool UIScreen::key(const KeyInput &key) { } void UIScreen::TriggerFinish(DialogResult result) { + switch (result) { + case DialogResult::DR_BACK: UI::PlayUISound(UI::UISound::BACK); break; + case DialogResult::DR_OK: UI::PlayUISound(UI::UISound::CONFIRM); break; + } screenManager()->finishDialog(this, result); } diff --git a/ext/native/ui/view.cpp b/ext/native/ui/view.cpp index d452b6a8a3..1aea855070 100644 --- a/ext/native/ui/view.cpp +++ b/ext/native/ui/view.cpp @@ -217,6 +217,7 @@ void Clickable::Click() { UI::EventParams e{}; e.v = this; OnClick.Trigger(e); + UI::PlayUISound(UI::UISound::CONFIRM); }; void Clickable::FocusChanged(int focusFlags) {