~sebsite/generic-tetromino-game

Options: Fix going to the next page when there are no useroptions v2 SUPERSEDED

Lorenz (xha): 1
 Options: Fix going to the next page when there are no useroptions

 1 files changed, 7 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sebsite/generic-tetromino-game/patches/39685/mbox | git am -3
Learn more about email & git

[PATCH v2] Options: Fix going to the next page when there are no useroptions Export this patch

---
 main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c
index 8f27c46..af75f25 100644
--- a/main.c
+++ b/main.c
@@ -7791,7 +7791,7 @@ optionsinput(uint8_t inputs)
				|| state.options.pos == 19) {
			if (state.options.page == state.options.userlen / 20 + 1) {
				state.options.page = 0;
			} else {
			} else if (state.options.userlen > 0) {
				++state.options.page;
			}
			draw_options_page();
@@ -7805,8 +7805,12 @@ optionsinput(uint8_t inputs)
		if (state.options.pos == 0) {
			uint8_t pos;
			if (state.options.page == 0) {
				state.options.page = state.options.userlen / 20 + 1;
				pos = MIN(19, state.options.userlen % 20 - 1);
				if (state.options.userlen > 0) {
					state.options.page = state.options.userlen / 20 + 1;
					pos = MIN(19, state.options.userlen % 20 - 1);
				} else {
					pos = OPT_LAST;
				}
			} else {
				--state.options.page;
				pos = state.options.page > 0 ? 19 : OPT_LAST;
-- 
2.38.4
This doesn't work for me? Wrapping around on page 1 works, but pressing
either flip button goes to an empty page 2, when it should either do
nothing or jump to the top of page 1 (whichever is easier to implement I
guess).