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