diff --git a/menu/drivers/nuklear/nk_wnd_file_picker.c b/menu/drivers/nuklear/nk_wnd_file_picker.c index 3ba7cc8020..f061506e7b 100644 --- a/menu/drivers/nuklear/nk_wnd_file_picker.c +++ b/menu/drivers/nuklear/nk_wnd_file_picker.c @@ -30,6 +30,7 @@ #include "../../menu_driver.h" #include "../../frontend/frontend_driver.h" +#include "../../configuration.h" static bool assets_loaded; static char path[PATH_MAX_LENGTH]; @@ -80,7 +81,7 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, char* title, char* in, char* out, if (!string_is_empty(in) && string_is_empty(path)) { strlcpy(path, in, sizeof(path)); - files = dir_list_new(path, filter, true, true); + files = dir_list_new(path, filter, true, settings->show_hidden_files, true, false); } if (!assets_loaded) @@ -99,7 +100,7 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, char* title, char* in, char* out, { fill_pathname_join(path, "/", "", sizeof(path)); - files = dir_list_new(path, filter, true, true); + files = dir_list_new(path, filter, true, settings->show_hidden_files, true, false); } } else @@ -111,7 +112,7 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, char* title, char* in, char* out, { fill_pathname_join(path, drives->list[i].path, "", sizeof(path)); - files = dir_list_new(path, filter, true, true); + files = dir_list_new(path, filter, true, settings->show_hidden_files, true, false); } } } @@ -127,7 +128,7 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, char* title, char* in, char* out, { strlcpy (path, files->elems[i].data, sizeof(path)); if (path_is_directory (path)) - files = dir_list_new(path, filter, true, true); + files = dir_list_new(path, filter, true, settings->show_hidden_files, true, false); } } } diff --git a/menu/drivers/nuklear/nk_wnd_main.c b/menu/drivers/nuklear/nk_wnd_main.c index 0eff5485e6..94113e5642 100644 --- a/menu/drivers/nuklear/nk_wnd_main.c +++ b/menu/drivers/nuklear/nk_wnd_main.c @@ -27,6 +27,7 @@ #include #include "../../menu_driver.h" +#include "../../configuration.h" static char* out; static char core[PATH_MAX_LENGTH] = {0}; @@ -41,6 +42,7 @@ void nk_wnd_main(nk_menu_handle_t *nk, const char* title) struct nk_context *ctx = &nk->ctx; const int id = NK_WND_MAIN; settings_t *settings = config_get_ptr(); + char core_basename[PATH_MAX_LENGTH] = {0}; static char picker_filter[PATH_MAX_LENGTH]; static char picker_title[PATH_MAX_LENGTH]; @@ -48,8 +50,10 @@ void nk_wnd_main(nk_menu_handle_t *nk, const char* title) int len_core, len_content = 0; + strlcpy(core_basename, path_basename(core), sizeof(core_basename)); + if (!out) - out = &core; + out = core; if (!string_is_empty(core)) len_core = strlen(path_basename(core)); @@ -73,10 +77,10 @@ void nk_wnd_main(nk_menu_handle_t *nk, const char* title) nk_layout_row_dynamic(ctx, 30, 1); nk_label(ctx,"Core:", NK_TEXT_LEFT); nk_layout_row(ctx, NK_DYNAMIC, 30, 3, ratio); - nk_edit_string(ctx, NK_EDIT_SIMPLE, path_basename(core), &len_core, 64, nk_filter_default); + nk_edit_string(ctx, NK_EDIT_SIMPLE, core_basename, &len_core, 64, nk_filter_default); if (nk_button_text(ctx, "...", 3, NK_BUTTON_DEFAULT)) { - out = &core; + out = core; strlcpy(picker_title, "Select core", sizeof(picker_title)); strlcpy(picker_filter, ".dll", sizeof(picker_filter)); picker_startup_dir = settings->directory.libretro; @@ -88,7 +92,7 @@ void nk_wnd_main(nk_menu_handle_t *nk, const char* title) nk_edit_string(ctx, NK_EDIT_SIMPLE, content, &len_content, 64, nk_filter_default); if (nk_button_text(ctx, "...", 3, NK_BUTTON_DEFAULT)) { - out = &content; + out = content; strlcpy(picker_title, "Select content", sizeof(picker_title)); strlcpy(picker_filter, ".zip", sizeof(picker_filter)); picker_startup_dir = settings->directory.menu_content;