# HG changeset patch # User Michael Pavone # Date 1511756242 28800 # Node ID 6a35815cc409c04e49e10909544459d19e7cdb1c # Parent a6881d0d76d0d299b265fe7097904922b0c8ada5 Enable lock-on in Nuklear UI diff -r a6881d0d76d0 -r 6a35815cc409 blastem.c --- a/blastem.c Sun Nov 26 19:22:09 2017 -0800 +++ b/blastem.c Sun Nov 26 20:17:22 2017 -0800 @@ -562,7 +562,9 @@ current_system = menu_system; menu = 1; } - current_system->resume_context(current_system); + if (!current_system->next_rom) { + current_system->resume_context(current_system); + } } else { break; } diff -r a6881d0d76d0 -r 6a35815cc409 nuklear_ui/blastem_nuklear.c --- a/nuklear_ui/blastem_nuklear.c Sun Nov 26 19:22:09 2017 -0800 +++ b/nuklear_ui/blastem_nuklear.c Sun Nov 26 20:17:22 2017 -0800 @@ -23,7 +23,7 @@ } -void view_load(struct nk_context *context) +void view_file_browser(struct nk_context *context, uint8_t normal_open) { static char *current_path; static dir_entry *entries; @@ -79,11 +79,16 @@ free_dir_list(entries, num_entries); entries = NULL; } else { - if (current_system) { - current_system->next_rom = full_path; - current_system->request_exit(current_system); + if(normal_open) { + if (current_system) { + current_system->next_rom = full_path; + current_system->request_exit(current_system); + } else { + init_system_with_media(full_path, SYSTEM_UNKNOWN); + free(full_path); + } } else { - init_system_with_media(full_path, SYSTEM_UNKNOWN); + lockon_media(full_path); free(full_path); } current_view = view_play; @@ -93,6 +98,16 @@ } } +void view_load(struct nk_context *context) +{ + view_file_browser(context, 1); +} + +void view_lock_on(struct nk_context *context) +{ + view_file_browser(context, 0); +} + void view_about(struct nk_context *context) { } @@ -191,6 +206,7 @@ static menu_item items[] = { {"Resume", view_play}, {"Load ROM", view_load}, + {"Lock On", view_lock_on}, {"Save State", view_save_state}, {"Load State", view_load_state}, {"Exit", NULL}