Skip to content

Commit

Permalink
Trigger L/R to scroll 10 games in the carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
SirMangler committed Jun 10, 2023
1 parent 797dcfe commit 2780c0d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
42 changes: 42 additions & 0 deletions Source/Core/UICommon/ImGuiMenu/ImGuiFrontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,48 @@ void ImGuiFrontend::RefreshControls(bool updateGameSelection)

input_handled = true;
}
else if (m_displayed_games.size() > 10 && TryInput("Trigger L", device))
{
if (timeSinceLastInput > 500L)
{
int i = m_selectedGameIdx - 10;
if (i < 0)
{
// wrap around, total games + -index
m_selectedGameIdx = static_cast<int>(m_displayed_games.size()) + i;
}
else
{
m_selectedGameIdx = i;
}

m_scroll_last = std::chrono::high_resolution_clock::now();
break;
}

input_handled = true;
}
else if (m_displayed_games.size() > 10 && TryInput("Trigger R", device))
{
if (timeSinceLastInput > 500L)
{
int i = m_selectedGameIdx + 10;
if (i >= m_displayed_games.size())
{
// wrap around, i - total games
m_selectedGameIdx = i - static_cast<int>(m_displayed_games.size());
}
else
{
m_selectedGameIdx = i;
}

m_scroll_last = std::chrono::high_resolution_clock::now();
break;
}

input_handled = true;
}
else
{
m_direction_pressed = false;
Expand Down
1 change: 0 additions & 1 deletion Source/DolphinWinRT/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct App : implements<App, IFrameworkViewSource, IFrameworkView>
v.Activated({this, &App::OnActivate});
CoreApplication::EnteredBackground({this, &App::EnteredBackground});
CoreApplication::Suspending({this, &App::Suspending});

}

void Load(hstring const&) {}
Expand Down

0 comments on commit 2780c0d

Please sign in to comment.