11-15-2023, 02:08 PM
you have to find out what void to use and where i will not give it to you
static Timer openTimer(0ms);
openTimer.SetDelay(std::chrono::milliseconds(m_OpenDelay));
if ((m_OpenKeyPressed || PAD::IS_CONTROL_PRESSED(44, 14)) && PAD::IS_CONTROL_JUST_PRESSED(2,44 ) && openTimer.Update()) // Enter key or A button on controller
{
m_Opened ^= true;
if (m_Sounds)
PlaySound(m_Opened ? "SELECT" : "BACK");
}
static Timer backTimer(0ms);
backTimer.SetDelay(std::chrono::milliseconds(m_BackDelay));
if ((m_BackKeyPressed || PAD::IS_CONTROL_PRESSED(2, 225)) && backTimer.Update()) // Backspace key or B button on controller
{
if (m_Sounds)
PlaySound("BACK");
if (m_SubmenuStack.size() <= 1)
m_Opened = false;
else
m_SubmenuStack.pop();
}
if (m_Opened && !m_SubmenuStack.empty())
{
auto sub = m_SubmenuStack.top();
static Timer enterTimer(0ms);
enterTimer.SetDelay(std::chrono::milliseconds(m_EnterDelay));
if ((m_EnterKeyPressed || PAD::IS_CONTROL_PRESSED(2, 201)) && sub->GetNumOptions() != 0 && enterTimer.Update()) // Enter key or A button on controller
{
if (m_Sounds)
PlaySound("SELECT");
if (const auto opt = sub->GetOption(sub->GetSelectedOption()))
opt->HandleAction(OptionAction::EnterPress);
}
static Timer upTimer(0ms);
upTimer.SetDelay(std::chrono::milliseconds(m_VerticalDelay));
if ((m_UpKeyPressed || PAD::IS_CONTROL_PRESSED(2, 232)) && upTimer.Update()) // Up arrow key or D-pad Up on controller
{
if (m_Sounds)
PlaySound("NAV_UP_DOWN");
sub->ScrollBackward();
}
static Timer downTimer(0ms);
downTimer.SetDelay(std::chrono::milliseconds(m_VerticalDelay));
if ((m_DownKeyPressed || PAD::IS_CONTROL_PRESSED(2, 19)) && downTimer.Update()) // Down arrow key or D-pad Down on controller
{
if (m_Sounds)
PlaySound("NAV_UP_DOWN");
sub->ScrollForward();
}
static Timer leftTimer(0ms);
leftTimer.SetDelay(std::chrono::milliseconds(m_HorizontalDelay));
if ((m_LeftKeyPressed || PAD::IS_CONTROL_PRESSED(2, 174)) && sub->GetNumOptions() != 0 && leftTimer.Update()) // Left arrow key or D-pad Left on controller
{
if (m_Sounds)
PlaySound("NAV_LEFT_RIGHT");
if (const auto opt = sub->GetOption(sub->GetSelectedOption()))
opt->HandleAction(OptionAction::LeftPress);
}
static Timer rightTimer(0ms);
rightTimer.SetDelay(std::chrono::milliseconds(m_HorizontalDelay));
if ((m_RightKeyPressed || PAD::IS_CONTROL_PRESSED(2, 175)) && sub->GetNumOptions() != 0 && rightTimer.Update()) // Right arrow key or D-pad Right on controller
{
if (m_Sounds)
PlaySound("NAV_LEFT_RIGHT");
if (const auto opt = sub->GetOption(sub->GetSelectedOption()))
opt->HandleAction(OptionAction::RightPress);
}
}
static Timer openTimer(0ms);
openTimer.SetDelay(std::chrono::milliseconds(m_OpenDelay));
if ((m_OpenKeyPressed || PAD::IS_CONTROL_PRESSED(44, 14)) && PAD::IS_CONTROL_JUST_PRESSED(2,44 ) && openTimer.Update()) // Enter key or A button on controller
{
m_Opened ^= true;
if (m_Sounds)
PlaySound(m_Opened ? "SELECT" : "BACK");
}
static Timer backTimer(0ms);
backTimer.SetDelay(std::chrono::milliseconds(m_BackDelay));
if ((m_BackKeyPressed || PAD::IS_CONTROL_PRESSED(2, 225)) && backTimer.Update()) // Backspace key or B button on controller
{
if (m_Sounds)
PlaySound("BACK");
if (m_SubmenuStack.size() <= 1)
m_Opened = false;
else
m_SubmenuStack.pop();
}
if (m_Opened && !m_SubmenuStack.empty())
{
auto sub = m_SubmenuStack.top();
static Timer enterTimer(0ms);
enterTimer.SetDelay(std::chrono::milliseconds(m_EnterDelay));
if ((m_EnterKeyPressed || PAD::IS_CONTROL_PRESSED(2, 201)) && sub->GetNumOptions() != 0 && enterTimer.Update()) // Enter key or A button on controller
{
if (m_Sounds)
PlaySound("SELECT");
if (const auto opt = sub->GetOption(sub->GetSelectedOption()))
opt->HandleAction(OptionAction::EnterPress);
}
static Timer upTimer(0ms);
upTimer.SetDelay(std::chrono::milliseconds(m_VerticalDelay));
if ((m_UpKeyPressed || PAD::IS_CONTROL_PRESSED(2, 232)) && upTimer.Update()) // Up arrow key or D-pad Up on controller
{
if (m_Sounds)
PlaySound("NAV_UP_DOWN");
sub->ScrollBackward();
}
static Timer downTimer(0ms);
downTimer.SetDelay(std::chrono::milliseconds(m_VerticalDelay));
if ((m_DownKeyPressed || PAD::IS_CONTROL_PRESSED(2, 19)) && downTimer.Update()) // Down arrow key or D-pad Down on controller
{
if (m_Sounds)
PlaySound("NAV_UP_DOWN");
sub->ScrollForward();
}
static Timer leftTimer(0ms);
leftTimer.SetDelay(std::chrono::milliseconds(m_HorizontalDelay));
if ((m_LeftKeyPressed || PAD::IS_CONTROL_PRESSED(2, 174)) && sub->GetNumOptions() != 0 && leftTimer.Update()) // Left arrow key or D-pad Left on controller
{
if (m_Sounds)
PlaySound("NAV_LEFT_RIGHT");
if (const auto opt = sub->GetOption(sub->GetSelectedOption()))
opt->HandleAction(OptionAction::LeftPress);
}
static Timer rightTimer(0ms);
rightTimer.SetDelay(std::chrono::milliseconds(m_HorizontalDelay));
if ((m_RightKeyPressed || PAD::IS_CONTROL_PRESSED(2, 175)) && sub->GetNumOptions() != 0 && rightTimer.Update()) // Right arrow key or D-pad Right on controller
{
if (m_Sounds)
PlaySound("NAV_LEFT_RIGHT");
if (const auto opt = sub->GetOption(sub->GetSelectedOption()))
opt->HandleAction(OptionAction::RightPress);
}
}