Mercurial > repos > blastem
diff nuklear_ui/blastem_nuklear.c @ 1672:12d0c7c4ad80
Disable most bindings when UI is active
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 03 Jan 2019 09:14:49 -0800 |
parents | a1e0ed70ad82 |
children | 357b4951d9b2 |
line wrap: on
line diff
--- a/nuklear_ui/blastem_nuklear.c Wed Jan 02 09:27:00 2019 -0800 +++ b/nuklear_ui/blastem_nuklear.c Thu Jan 03 09:14:49 2019 -0800 @@ -139,7 +139,7 @@ free(full_path); } clear_view_stack(); - current_view = view_play; + show_play_view(); } selected_entry = -1; } @@ -246,12 +246,12 @@ if (is_load) { if (nk_button_label(context, "Load")) { current_system->load_state(current_system, selected_slot); - current_view = view_play; + show_play_view(); } } else { if (nk_button_label(context, "Save")) { current_system->save_state = selected_slot + 1; - current_view = view_play; + show_play_view(); } } nk_end(context); @@ -292,6 +292,8 @@ if (current_view == view_save_state || current_view == view_load_state) { free_slot_info(slots); slots = NULL; + } else if (current_view == view_play) { + set_content_binding_state(1); } } else { handler(i); @@ -1917,6 +1919,7 @@ void show_pause_menu(void) { + set_content_binding_state(0); context->style.window.background = nk_rgba(0, 0, 0, 128); context->style.window.fixed_background = nk_style_item_color(nk_rgba(0, 0, 0, 128)); current_view = view_pause; @@ -1925,6 +1928,7 @@ void show_play_view(void) { + set_content_binding_state(1); current_view = view_play; } @@ -1996,7 +2000,12 @@ texture_init(); - current_view = file_loaded ? view_play : view_menu; + if (file_loaded) { + current_view = view_play; + } else { + current_view = view_menu; + set_content_binding_state(0); + } render_set_ui_render_fun(blastem_nuklear_render); render_set_event_handler(handle_event); render_set_gl_context_handlers(context_destroyed, context_created);