Alternate RMLUI Menu Sounds (#686)

* Alternate RMLUI Menu Sounds

Those fit more the game I feel like.

* swapped tab sounds

* pressing A on tab button plays the OK sound

* Fix tab sound + Added menu sounds to prelaunch menu

* Centralize UI sound definitions

* Improvements

* Add "Play" button sound

* Use kSoundItemFocus in prelaunch

* Oops

* Update play/enable/disable sounds

---------

Co-authored-by: MelonSpeedruns <melonspeedruns@stratobox.net>
Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
MelonSpeedruns
2026-05-05 18:44:11 -04:00
committed by GitHub
parent 782a8573e9
commit 945ce3e4bc
18 changed files with 142 additions and 44 deletions
+7 -3
View File
@@ -106,6 +106,10 @@ Window::Window() : Document(kDocumentSource), mRoot(mDocument->GetElementById("w
void Window::show() {
Document::show();
mRoot->SetAttribute("open", "");
if (mInitialOpen) {
mDoAud_seStartMenu(kSoundWindowOpen);
mInitialOpen = false;
}
}
void Window::hide(bool close) {
@@ -156,6 +160,7 @@ bool Window::set_active_tab(int index) {
void Window::request_close() {
if (!consume_close_request()) {
mDoAud_seStartMenu(kSoundWindowClose);
pop();
}
}
@@ -201,12 +206,11 @@ bool Window::handle_nav_command(Rml::Event& event, NavCommand cmd) {
}
if (cmd == NavCommand::Confirm || cmd == NavCommand::Down) {
if (!mContentComponents.empty() && mContentComponents.front()->focus()) {
mDoAud_seStartMenu(Z2SE_SY_NAME_CURSOR);
mDoAud_seStartMenu(kSoundItemFocus);
return true;
}
}
if (cmd == NavCommand::Cancel) {
mDoAud_seStartMenu(Z2SE_SY_CURSOR_CANCEL);
request_close();
return true;
}
@@ -219,7 +223,7 @@ bool Window::handle_nav_command(Rml::Event& event, NavCommand cmd) {
bool Window::handle_content_nav(Rml::Event& event, NavCommand cmd) noexcept {
if (cmd == NavCommand::Up) {
if (focus()) {
mDoAud_seStartMenu(Z2SE_SY_NAME_CURSOR);
mDoAud_seStartMenu(kSoundItemFocus);
return true;
}
return false;