Left/right to scroll release notes faster

This commit is contained in:
Pk11
2022-03-04 20:11:42 -06:00
committed by Dark98
parent a9490eaa5a
commit 470248f722
+10 -6
View File
@@ -106,13 +106,17 @@ void StoreUtils::DrawReleaseNotes(const int &scrollIndex, const std::unique_ptr<
int &storeMode: The store mode to properly return back. int &storeMode: The store mode to properly return back.
*/ */
void StoreUtils::ReleaseNotesLogic(int &scrollIndex, int &storeMode) { void StoreUtils::ReleaseNotesLogic(int &scrollIndex, int &storeMode) {
if (hRepeat & KEY_DOWN) { int linesPerScreen = ((240.0f - 25.0f) / Gui::GetStringHeight(0.5f, "", font));
if (scrollIndex < (int)wrappedNotes.size() - ((240.0f - 25.0f) / Gui::GetStringHeight(0.5f, "", font))) scrollIndex++;
}
if (hRepeat & KEY_UP) { if (hRepeat & KEY_DOWN) scrollIndex++;
if (scrollIndex > 0) scrollIndex--; if (hRepeat & KEY_UP) scrollIndex--;
} if (hRepeat & KEY_RIGHT) scrollIndex += linesPerScreen;
if (hRepeat & KEY_LEFT) scrollIndex -= linesPerScreen;
/* Ensure it doesn't scroll off screen. */
if (scrollIndex < 0) scrollIndex = 0;
if (scrollIndex > (int)wrappedNotes.size() - linesPerScreen)
scrollIndex = wrappedNotes.size() - linesPerScreen;
if (hDown & KEY_B) { if (hDown & KEY_B) {
scrollIndex = 0; scrollIndex = 0;