mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-28 23:13:02 +00:00
allow players to change paginated pages with L/R (#354)
This commit is contained in:
parent
0ec8a42c25
commit
e44a3c775d
1 changed files with 18 additions and 0 deletions
|
@ -8,6 +8,9 @@
|
||||||
// events //
|
// events //
|
||||||
////////////
|
////////////
|
||||||
|
|
||||||
|
static bool lTrigDown = false;
|
||||||
|
static bool rTrigDown = false;
|
||||||
|
|
||||||
static struct DjuiButton* sPrevButton = NULL;
|
static struct DjuiButton* sPrevButton = NULL;
|
||||||
static struct DjuiButton* sNextButton = NULL;
|
static struct DjuiButton* sNextButton = NULL;
|
||||||
static struct DjuiText* sPageNumText = NULL;
|
static struct DjuiText* sPageNumText = NULL;
|
||||||
|
@ -106,6 +109,21 @@ bool djui_paginated_render(struct DjuiBase* base) {
|
||||||
}
|
}
|
||||||
|
|
||||||
djui_rect_render(base);
|
djui_rect_render(base);
|
||||||
|
|
||||||
|
OSContPad* pad = &gInteractablePad;
|
||||||
|
|
||||||
|
if (pad->button & L_TRIG) {
|
||||||
|
lTrigDown = true;
|
||||||
|
} else if (pad->button & R_TRIG) {
|
||||||
|
rTrigDown = true;
|
||||||
|
} else if (lTrigDown) {
|
||||||
|
djui_paginated_prev(&paginated->prevButton->base);
|
||||||
|
lTrigDown = false;
|
||||||
|
} else if (rTrigDown) {
|
||||||
|
djui_paginated_next(&paginated->nextButton->base);
|
||||||
|
rTrigDown = false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue