mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 00:33:34 +01:00
Hook up a couple more sounds. Unfortunately clickable back buttons now play both back and confirm sounds...
This commit is contained in:
1 parent
5423f76e25
commit
55eb2844fd
5 files changed
+8
-2
No files matched your search
@@ -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<PlayInstance>::iterator iter = plays_.begin();
|
||||
|
||||
@@ -147,7 +147,7 @@ void SetSoundCallback(std::function<void(UISound)> func) {
|
||||
|
||||
void PlayUISound(UISound sound) {
|
||||
if (soundCallback) {
|
||||
soundCallback(UISound::SELECT);
|
||||
soundCallback(sound);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "ui/ui_context.h"
|
||||
#include "input/input_state.h"
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user