mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
Hook up the first UI sound, make it play.
This commit is contained in:
1 parent
b30be913c0
commit
5423f76e25
5 files changed
+89
-20
No files matched your search
@@ -17,6 +17,9 @@ static bool focusMovementEnabled;
|
||||
bool focusForced;
|
||||
static std::mutex eventMutex_;
|
||||
|
||||
static std::function<void(UISound)> soundCallback;
|
||||
|
||||
|
||||
struct DispatchQueueItem {
|
||||
Event *e;
|
||||
EventParams params;
|
||||
@@ -133,6 +136,18 @@ void MoveFocus(ViewGroup *root, FocusDirection direction) {
|
||||
if (neigh.view) {
|
||||
neigh.view->SetFocus();
|
||||
root->SubviewFocused(neigh.view);
|
||||
|
||||
PlayUISound(UISound::SELECT);
|
||||
}
|
||||
}
|
||||
|
||||
void SetSoundCallback(std::function<void(UISound)> func) {
|
||||
soundCallback = func;
|
||||
}
|
||||
|
||||
void PlayUISound(UISound sound) {
|
||||
if (soundCallback) {
|
||||
soundCallback(UISound::SELECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user