changeset 1545:3faf917bab56

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
author Michael Pavone <pavone@retrodev.com>
date Mon, 26 Mar 2018 09:49:03 -0700
parents 650178d81d33
children 1a09422b87a5
files nuklear_ui/blastem_nuklear.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nuklear_ui/blastem_nuklear.c	Sun Mar 25 23:11:17 2018 -0700
+++ b/nuklear_ui/blastem_nuklear.c	Mon Mar 26 09:49:03 2018 -0700
@@ -425,7 +425,10 @@
 		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_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)