Port Settings Control and Audio Menu. Add focus sound.

This commit is contained in:
GabsPuNs
2026-06-21 03:10:18 -04:00
parent 894eec412f
commit 831ad4ab43
23 changed files with 1063 additions and 386 deletions

View File

@@ -229,6 +229,7 @@ void UIScene_LoadCreateJoinMenu::AddListItem(const char* listId, const wstring&
sprintf_s(btnId, "%s_btn_%d", listId, index);
btn->SetId(btnId);
btn->AddEventListener(Rml::EventId::Click, this);
btn->AddEventListener(Rml::EventId::Mouseover, this);
item->AppendChild(std::move(btnPtr));
container->AppendChild(std::move(itemPtr));
@@ -303,7 +304,11 @@ UIScene_LoadCreateJoinMenu::UIScene_LoadCreateJoinMenu(int iPad, void* initData,
// Register tab button click listeners
auto registerTab = [&](const char* id) {
auto* el = m_document->GetElementById(id);
if (el) el->AddEventListener(Rml::EventId::Click, this);
if (el)
{
el->AddEventListener(Rml::EventId::Click, this);
el->AddEventListener(Rml::EventId::Mouseover, this);
}
};
registerTab("tab_load");
registerTab("tab_create");
@@ -372,7 +377,11 @@ UIScene_LoadCreateJoinMenu::~UIScene_LoadCreateJoinMenu()
{
auto removeTab = [&](const char* id) {
auto* el = m_document->GetElementById(id);
if (el) el->RemoveEventListener(Rml::EventId::Click, this);
if (el)
{
el->RemoveEventListener(Rml::EventId::Click, this);
el->RemoveEventListener(Rml::EventId::Mouseover, this);
}
};
removeTab("tab_load");
removeTab("tab_create");
@@ -417,6 +426,8 @@ void UIScene_LoadCreateJoinMenu::ProcessEvent(Rml::Event& event)
}
}
}
else if (event == Rml::EventId::Mouseover)
ui.PlayUISFX(eSFX_Focus);
}
// -- Update / Tooltips / Components --