Mercurial > repos > blastem
comparison nuklear_ui/blastem_nuklear.c @ 1475:afa3fbb76bff nuklear_ui
Basic support for loading ROMs via Nuklear UI
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 21 Nov 2017 23:11:11 -0800 |
parents | c5c022c7aa54 |
children | 0646ae0987c3 |
comparison
equal
deleted
inserted
replaced
1474:c5c022c7aa54 | 1475:afa3fbb76bff |
---|---|
46 } | 46 } |
47 nk_group_end(context); | 47 nk_group_end(context); |
48 } | 48 } |
49 nk_layout_row_static(context, 52, 300, 1); | 49 nk_layout_row_static(context, 52, 300, 1); |
50 if (nk_button_label(context, "Open")) { | 50 if (nk_button_label(context, "Open")) { |
51 char const *pieces[] = {current_path, PATH_SEP, entries[selected_entry].name}; | |
51 if (entries[selected_entry].is_dir) { | 52 if (entries[selected_entry].is_dir) { |
52 char *old = current_path; | 53 char *old = current_path; |
53 char const *pieces[] = {old, PATH_SEP, entries[selected_entry].name}; | |
54 current_path = alloc_concat_m(3, pieces); | 54 current_path = alloc_concat_m(3, pieces); |
55 free(old); | 55 free(old); |
56 free_dir_list(entries, num_entries); | 56 free_dir_list(entries, num_entries); |
57 entries = NULL; | 57 entries = NULL; |
58 } else { | 58 } else { |
59 //TODO: load ROM | 59 current_system->next_rom = alloc_concat_m(3, pieces); |
60 current_system->request_exit(current_system); | |
60 current_view = view_play; | 61 current_view = view_play; |
61 } | 62 } |
62 } | 63 } |
63 nk_end(context); | 64 nk_end(context); |
64 } | 65 } |