# HG changeset patch # User Michael Pavone # Date 1553669111 25200 # Node ID 396369ab481a19d9a0c76520830500ee31e37641 # Parent 930c113488744fe92670e663f64c7466e666ffd9 Skip buttons or axes in the mapping UI that have no label for the selected controller type diff -r 930c11348874 -r 396369ab481a nuklear_ui/blastem_nuklear.c --- a/nuklear_ui/blastem_nuklear.c Tue Mar 26 23:27:46 2019 -0700 +++ b/nuklear_ui/blastem_nuklear.c Tue Mar 26 23:45:11 2019 -0700 @@ -1228,12 +1228,17 @@ } } - if (added_mapping) { + while (added_mapping) { quiet = QUIET_FRAMES; if (current_button < SDL_CONTROLLER_BUTTON_MAX) { current_button++; if (current_button == SDL_CONTROLLER_BUTTON_MAX) { current_axis = 0; + if (get_axis_label(&selected_controller_info, current_axis)) { + added_mapping = 0; + } + } else if (get_button_label(&selected_controller_info, current_button)) { + added_mapping = 0; } } else { current_axis++; @@ -1246,6 +1251,9 @@ pop_view(); push_view(view_controller_bindings); controller_binding_changed = 0; + added_mapping = 0; + } else if (get_axis_label(&selected_controller_info, current_axis)) { + added_mapping = 0; } } }