mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-07-10 23:18:08 +00:00
Port Settings Control and Audio Menu. Add focus sound.
This commit is contained in:
@@ -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 --
|
||||
|
||||
Reference in New Issue
Block a user