fix nuklear compilation
This commit is contained in:
parent
f0485db137
commit
2b1facdc33
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include "../../menu_driver.h"
|
#include "../../menu_driver.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
|
#include "../../configuration.h"
|
||||||
|
|
||||||
static bool assets_loaded;
|
static bool assets_loaded;
|
||||||
static char path[PATH_MAX_LENGTH];
|
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))
|
if (!string_is_empty(in) && string_is_empty(path))
|
||||||
{
|
{
|
||||||
strlcpy(path, in, sizeof(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)
|
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, "/",
|
fill_pathname_join(path, "/",
|
||||||
"", sizeof(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
|
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,
|
fill_pathname_join(path, drives->list[i].path,
|
||||||
"", sizeof(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));
|
strlcpy (path, files->elems[i].data, sizeof(path));
|
||||||
if (path_is_directory (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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <lists/string_list.h>
|
#include <lists/string_list.h>
|
||||||
|
|
||||||
#include "../../menu_driver.h"
|
#include "../../menu_driver.h"
|
||||||
|
#include "../../configuration.h"
|
||||||
|
|
||||||
static char* out;
|
static char* out;
|
||||||
static char core[PATH_MAX_LENGTH] = {0};
|
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;
|
struct nk_context *ctx = &nk->ctx;
|
||||||
const int id = NK_WND_MAIN;
|
const int id = NK_WND_MAIN;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
char core_basename[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
static char picker_filter[PATH_MAX_LENGTH];
|
static char picker_filter[PATH_MAX_LENGTH];
|
||||||
static char picker_title[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;
|
int len_core, len_content = 0;
|
||||||
|
|
||||||
|
strlcpy(core_basename, path_basename(core), sizeof(core_basename));
|
||||||
|
|
||||||
if (!out)
|
if (!out)
|
||||||
out = &core;
|
out = core;
|
||||||
|
|
||||||
if (!string_is_empty(core))
|
if (!string_is_empty(core))
|
||||||
len_core = strlen(path_basename(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_layout_row_dynamic(ctx, 30, 1);
|
||||||
nk_label(ctx,"Core:", NK_TEXT_LEFT);
|
nk_label(ctx,"Core:", NK_TEXT_LEFT);
|
||||||
nk_layout_row(ctx, NK_DYNAMIC, 30, 3, ratio);
|
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))
|
if (nk_button_text(ctx, "...", 3, NK_BUTTON_DEFAULT))
|
||||||
{
|
{
|
||||||
out = &core;
|
out = core;
|
||||||
strlcpy(picker_title, "Select core", sizeof(picker_title));
|
strlcpy(picker_title, "Select core", sizeof(picker_title));
|
||||||
strlcpy(picker_filter, ".dll", sizeof(picker_filter));
|
strlcpy(picker_filter, ".dll", sizeof(picker_filter));
|
||||||
picker_startup_dir = settings->directory.libretro;
|
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);
|
nk_edit_string(ctx, NK_EDIT_SIMPLE, content, &len_content, 64, nk_filter_default);
|
||||||
if (nk_button_text(ctx, "...", 3, NK_BUTTON_DEFAULT))
|
if (nk_button_text(ctx, "...", 3, NK_BUTTON_DEFAULT))
|
||||||
{
|
{
|
||||||
out = &content;
|
out = content;
|
||||||
strlcpy(picker_title, "Select content", sizeof(picker_title));
|
strlcpy(picker_title, "Select content", sizeof(picker_title));
|
||||||
strlcpy(picker_filter, ".zip", sizeof(picker_filter));
|
strlcpy(picker_filter, ".zip", sizeof(picker_filter));
|
||||||
picker_startup_dir = settings->directory.menu_content;
|
picker_startup_dir = settings->directory.menu_content;
|
||||||
|
|
Loading…
Reference in New Issue