Allow held directional buttons to scroll up and down the list repeatedly.

This commit is contained in:
The Dax committed 2013-12-08 20:33:16 -05:00
1 parent bd1d4e2d92
commit 814a81b692
3 files changed
+26 -2

No files matched your search

+19
View File
@@ -128,6 +128,25 @@ bool PSPDialog::IsButtonPressed(int checkButton)
return !isFading && !(lastButtons & checkButton) && (buttons & checkButton);
}
bool PSPDialog::IsButtonHeld(int checkButton, int &framesHeld)
{
bool btnWasHeldLastFrame = (lastButtons & checkButton) && (buttons & checkButton);
if (!isFading && btnWasHeldLastFrame) {
framesHeld++;
}
else {
framesHeld = 0;
return false;
}
// It's considered held for dialog purposes after 30 frames (~0.5 seconds).
// Seems to give the best responsiveness. Maybe this should be configurable?
if (framesHeld >= 30 && ((framesHeld % 10) == 0))
return true;
return false;
}
void PSPDialog::DisplayButtons(int flags)
{
I18NCategory *d = GetI18NCategory("Dialog");