mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
[nk] add initial dir for file picker
This commit is contained in:
parent
ed2177d524
commit
fa3fee12e9
@ -50,12 +50,14 @@
|
||||
|
||||
static void nk_menu_main(nk_menu_handle_t *nk)
|
||||
{
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct nk_context *ctx = &nk->ctx;
|
||||
|
||||
if (nk->window[NK_WND_SETTINGS].open)
|
||||
nk_wnd_settings(nk);
|
||||
if (nk->window[NK_WND_FILE_PICKER].open)
|
||||
nk_wnd_file_picker(nk);
|
||||
nk_wnd_file_picker(nk, settings->directory.menu_content);
|
||||
if (nk->window[NK_WND_SHADER_PARAMETERS].open)
|
||||
nk_wnd_shader_parameters(nk);
|
||||
if (nk->window[NK_WND_MAIN].open)
|
||||
|
@ -95,7 +95,7 @@ typedef struct nk_menu_handle
|
||||
|
||||
void nk_wnd_shader_parameters(nk_menu_handle_t *zr);
|
||||
void nk_wnd_main(nk_menu_handle_t *zr);
|
||||
void nk_wnd_file_picker(nk_menu_handle_t *zr);
|
||||
void nk_wnd_file_picker(nk_menu_handle_t *zr, const char* startup_path);
|
||||
void nk_wnd_settings(nk_menu_handle_t *zr);
|
||||
void nk_wnd_set_state(nk_menu_handle_t *zr, const int id,
|
||||
struct nk_vec2 pos, struct nk_vec2 size);
|
||||
|
@ -61,10 +61,10 @@ void load_icons(nk_menu_handle_t *nk)
|
||||
assets_loaded = true;
|
||||
}
|
||||
|
||||
void nk_wnd_file_picker(nk_menu_handle_t *nk)
|
||||
void nk_wnd_file_picker(nk_menu_handle_t *nk, const char* startup_path)
|
||||
{
|
||||
struct nk_panel layout;
|
||||
struct nk_context *ctx = &nk->ctx;
|
||||
struct nk_context *ctx = &nk->ctx;
|
||||
const int id = NK_WND_FILE_PICKER;
|
||||
int i = 0;
|
||||
static file_list_t *drives = NULL;
|
||||
@ -77,10 +77,17 @@ void nk_wnd_file_picker(nk_menu_handle_t *nk)
|
||||
frontend_driver_parse_drive_list(drives);
|
||||
}
|
||||
|
||||
if (!string_is_empty(startup_path) && string_is_empty(path))
|
||||
{
|
||||
RARCH_LOG("beep\n");
|
||||
strlcpy(path, startup_path, sizeof(path));
|
||||
files = dir_list_new(path, NULL, true, true);
|
||||
}
|
||||
|
||||
if (!assets_loaded)
|
||||
load_icons(nk);
|
||||
|
||||
if (nk_begin(ctx, &layout, "Select File", nk_rect(440, 10, 330, 400),
|
||||
if (nk_begin(ctx, &layout, "Select File", nk_rect(10, 10, 500, 400),
|
||||
NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE|
|
||||
NK_WINDOW_BORDER))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user