~sebsite/generic-tetromino-game

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

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

Lorenz (xha) <me@xha.li>
Details
Message ID
<20230313183822.10701-1-me@xha.li>
DKIM signature
pass
Download raw message
Patch: +7 -3
---
 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
Details
Message ID
<CR6LMHKOQC8A.100IGSNA8UQT3@notmylaptop>
In-Reply-To
<20230313183822.10701-1-me@xha.li> (view parent)
DKIM signature
pass
Download raw message
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).
Reply to thread Export thread (mbox)