diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-03-18 18:48:02 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-03-18 18:48:02 (EDT) |
commit | 0e92178007ccfa8997c87a5b89e859a396224277 (patch) | |
tree | f45c25d847d979b928411455f0cd2d20fabcb78c /src | |
parent | c46b288718eca6dbc3bfe43a5b1134b616e620b4 (diff) | |
download | dodge-balls-0e92178007ccfa8997c87a5b89e859a396224277.zip dodge-balls-0e92178007ccfa8997c87a5b89e859a396224277.tar.gz dodge-balls-0e92178007ccfa8997c87a5b89e859a396224277.tar.bz2 |
main-menu: Link buttons (for arrow keys nav)
Diffstat (limited to 'src')
-rw-r--r-- | src/main-menu.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main-menu.c b/src/main-menu.c index 910ecc6..9583668 100644 --- a/src/main-menu.c +++ b/src/main-menu.c @@ -208,7 +208,33 @@ db_main_menu(void) if (buttons[i + 2]->texture_over == NULL) { goto err; } + if (i > 0) { + buttons[i + 2]->u = buttons[i + 1]; + buttons[i + 1]->d = buttons[i + 2]; + } + buttons[i + 2]->l = NULL; + buttons[i + 2]->r = buttons[0]; + } + + /* Help button links */ + buttons[0]->u = NULL; + buttons[0]->d = buttons[1]; + if (n > 0) { + buttons[0]->l = buttons[2]; + } else { + buttons[0]->l = NULL; + } + buttons[0]->r = NULL; + + /* Quit button links */ + buttons[1]->u = buttons[0]; + buttons[1]->d = NULL; + if (n > 0) { + buttons[1]->l = buttons[2]; + } else { + buttons[1]->l = NULL; } + buttons[1]->r = NULL; SDL_RenderPresent(renderer); SDL_Delay(1000); |