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

@@ -68,6 +68,7 @@ UIScene_MessageBox::UIScene_MessageBox(int iPad, void *initData, UILayer *parent
if (buttons[i])
{
buttons[i]->AddEventListener(Rml::EventId::Click, this);
buttons[i]->AddEventListener(Rml::EventId::Mouseover, this);
buttons[i]->SetProperty("display", "none");
}
}
@@ -98,17 +99,7 @@ UIScene_MessageBox::~UIScene_MessageBox()
{
if (m_document)
{
Rml::Element* buttons[4] = {
m_document->GetElementById("button0"),
m_document->GetElementById("button1"),
m_document->GetElementById("button2"),
m_document->GetElementById("button3")
};
for (int i = 0; i < 4; i++)
{
if (buttons[i])
buttons[i]->RemoveEventListener(Rml::EventId::Click, this);
}
UnregisterEvents({ "button0", "button1", "button2", "button3" });
m_document->Close();
}
@@ -182,6 +173,8 @@ void UIScene_MessageBox::ProcessEvent(Rml::Event& event)
else if (id == "button2") OnButtonClicked(2);
else if (id == "button3") OnButtonClicked(3);
}
else if (event == Rml::EventId::Mouseover)
ui.PlayUISFX(eSFX_Focus);
}
void UIScene_MessageBox::OnButtonClicked(int buttonIndex)