mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 11:19:58 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user