mirror of
https://github.com/BernardoGiordano/Checkpoint
synced 2024-11-28 11:30:22 +00:00
Fix #193
This commit is contained in:
parent
cfbf391a6e
commit
11f2837893
3 changed files with 28 additions and 2 deletions
|
@ -86,3 +86,19 @@ void IHid::page_forward(void)
|
|||
mPage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void IHid::pageBack(size_t count)
|
||||
{
|
||||
page_back();
|
||||
if (mIndex > maxEntries(count)) {
|
||||
mIndex = maxEntries(count);
|
||||
}
|
||||
}
|
||||
|
||||
void IHid::pageForward(size_t count)
|
||||
{
|
||||
page_forward();
|
||||
if (mIndex > maxEntries(count)) {
|
||||
mIndex = maxEntries(count);
|
||||
}
|
||||
}
|
|
@ -54,6 +54,8 @@ public:
|
|||
int page(void) const;
|
||||
void page(int v);
|
||||
void reset(void);
|
||||
void pageBack(size_t count);
|
||||
void pageForward(size_t count);
|
||||
|
||||
protected:
|
||||
void page_back(void);
|
||||
|
|
|
@ -201,14 +201,22 @@ void MainScreen::update(touchPosition* touch)
|
|||
void MainScreen::updateSelector(touchPosition* touch)
|
||||
{
|
||||
if (!g_backupScrollEnabled) {
|
||||
size_t count = getTitleCount(g_currentUId);
|
||||
size_t oldindex = hid.index();
|
||||
hid.update(getTitleCount(g_currentUId));
|
||||
hid.update(count);
|
||||
// change page
|
||||
if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_L) {
|
||||
hid.pageBack(count);
|
||||
}
|
||||
else if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_R) {
|
||||
hid.pageForward(count);
|
||||
}
|
||||
|
||||
// loop through every rendered title
|
||||
for (u8 row = 0; row < rowlen; row++) {
|
||||
for (u8 col = 0; col < collen; col++) {
|
||||
u8 index = row * collen + col;
|
||||
if (index > hid.maxEntries(getTitleCount(g_currentUId)))
|
||||
if (index > hid.maxEntries(count))
|
||||
break;
|
||||
|
||||
u32 x = selectorX(index);
|
||||
|
|
Loading…
Reference in a new issue