diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-03-26 09:49:03 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-03-26 09:49:03 -0700 |
commit | b79940c0421e79906b4a7af0bb79fdcf39be8c22 (patch) | |
tree | 2650cb416aae7627ac9853596d8df19759f4553c | |
parent | 8c4d7754751c55bdf16bbd8a91f7bd3fc2cbbc1d (diff) |
Add back button to Key binding view and add a window and back button to empty controller view so you can always get back to the main menu
-rw-r--r-- | nuklear_ui/blastem_nuklear.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nuklear_ui/blastem_nuklear.c b/nuklear_ui/blastem_nuklear.c index 59d5a3b..05747ed 100644 --- a/nuklear_ui/blastem_nuklear.c +++ b/nuklear_ui/blastem_nuklear.c @@ -425,7 +425,10 @@ void view_key_bindings(struct nk_context *context) binding_group(context, "General", general_binds, general_names, NUM_GEN_BINDS, binding_lookup); binding_group(context, "Speed Control", speed_binds, speed_names, NUM_SPEED_BINDS, binding_lookup); binding_group(context, "Debug", debug_binds, debug_names, NUM_DBG_BINDS, binding_lookup); - + nk_layout_row_static(context, 34, (render_width() - 80) / 2, 1); + if (nk_button_label(context, "Back")) { + pop_view(); + } nk_end(context); } if (set_binding && nk_begin(context, "Set Binding", nk_rect(width/4, height/4, width/2/*width*3/4*/, height/2), NK_WINDOW_TITLE | NK_WINDOW_BORDER)) { @@ -471,7 +474,13 @@ void view_key_bindings(struct nk_context *context) } void view_controllers(struct nk_context *context) { - + if (nk_begin(context, "Controller Bindings", nk_rect(0, 0, render_width(), render_height()), 0)) { + nk_layout_row_static(context, 34, (render_width() - 80) / 2, 1); + if (nk_button_label(context, "Back")) { + pop_view(); + } + nk_end(context); + } } void settings_toggle(struct nk_context *context, char *label, char *path, uint8_t def) |