diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/nds/gui.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/nds/gui.c b/source/nds/gui.c index 1582b16..969925f 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -2566,7 +2566,7 @@ u32 menu(u16 *screen) void save_screen_snapshot() { - if((gui_action == CURSOR_SELECT)) + if(gui_action == CURSOR_SELECT) { if(bg_screenp != NULL) { @@ -3574,16 +3574,21 @@ u32 menu(u16 *screen) // ___ 60 above or below these are ignored. // . . . (+27) The row between 33 and 60 is [1], though! // ___ 192 - current_option_num = (inputdata.y - 33) / 27 + 1; + u32 next_option_num = (inputdata.y - 33) / 27 + 1; + struct _MENU_OPTION_TYPE *next_option = current_menu->options + next_option_num; - current_option = current_menu->options + current_option_num; + if (next_option_num >= current_menu->num_options) + break; - if(!current_option) + if(!next_option) break; - if(current_option -> option_type & HIDEN_TYPE) + if(next_option -> option_type & HIDEN_TYPE) break; + current_option_num = next_option_num; + current_option = current_menu->options + current_option_num; + if(current_menu->key_function) { gui_action = CURSOR_RIGHT; @@ -3591,6 +3596,7 @@ u32 menu(u16 *screen) } else if(current_option->option_type & (NUMBER_SELECTION_TYPE | STRING_SELECTION_TYPE)) { + gui_action = CURSOR_RIGHT; u32 current_option_val = *(current_option->current_option); if(current_option_val < current_option->num_options -1) @@ -3602,6 +3608,8 @@ u32 menu(u16 *screen) if(current_option->action_function) current_option->action_function(); } + else if(current_option->option_type & ACTION_TYPE) + current_option->action_function(); } /* Save states */ else if(current_menu == (main_menu.options + 1)->sub_menu) |