mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(core_info) Can now set core info directory from RGUI
This commit is contained in:
parent
c56f53599a
commit
a35e708335
@ -74,7 +74,7 @@ core_info_list_t *core_info_list_new(const char *modules_path)
|
|||||||
#endif
|
#endif
|
||||||
strlcat(info_path_base, ".info", sizeof(info_path_base));
|
strlcat(info_path_base, ".info", sizeof(info_path_base));
|
||||||
|
|
||||||
fill_pathname(info_path, (*g_settings.libretro_info_path) ? g_settings.libretro_info_path : modules_path,
|
fill_pathname_join(info_path, (*g_settings.libretro_info_path) ? g_settings.libretro_info_path : modules_path,
|
||||||
info_path_base, sizeof(info_path));
|
info_path_base, sizeof(info_path));
|
||||||
|
|
||||||
core_info[i].data = config_file_new(info_path);
|
core_info[i].data = config_file_new(info_path);
|
||||||
|
@ -131,6 +131,7 @@ typedef enum
|
|||||||
RGUI_SAVESTATE_DIR_PATH,
|
RGUI_SAVESTATE_DIR_PATH,
|
||||||
RGUI_SAVEFILE_DIR_PATH,
|
RGUI_SAVEFILE_DIR_PATH,
|
||||||
RGUI_LIBRETRO_DIR_PATH,
|
RGUI_LIBRETRO_DIR_PATH,
|
||||||
|
RGUI_LIBRETRO_INFO_DIR_PATH,
|
||||||
RGUI_CONFIG_DIR_PATH,
|
RGUI_CONFIG_DIR_PATH,
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
RGUI_OVERLAY_DIR_PATH,
|
RGUI_OVERLAY_DIR_PATH,
|
||||||
|
@ -580,6 +580,10 @@ int menu_set_settings(unsigned setting, unsigned action)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
case RGUI_LIBRETRO_INFO_DIR_PATH:
|
||||||
|
if (action == RGUI_ACTION_START)
|
||||||
|
*g_settings.libretro_info_path = '\0';
|
||||||
|
break;
|
||||||
case RGUI_CONFIG_DIR_PATH:
|
case RGUI_CONFIG_DIR_PATH:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
*g_settings.rgui_config_directory = '\0';
|
*g_settings.rgui_config_directory = '\0';
|
||||||
@ -1153,6 +1157,9 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
|
|||||||
strlcpy(type_str, *rgui->libretro_dir ? rgui->libretro_dir : "<None>", type_str_size);
|
strlcpy(type_str, *rgui->libretro_dir ? rgui->libretro_dir : "<None>", type_str_size);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
case RGUI_LIBRETRO_INFO_DIR_PATH:
|
||||||
|
strlcpy(type_str, *g_settings.libretro_info_path ? g_settings.libretro_info_path : "<Core dir>", type_str_size);
|
||||||
|
break;
|
||||||
case RGUI_CONFIG_DIR_PATH:
|
case RGUI_CONFIG_DIR_PATH:
|
||||||
strlcpy(type_str, *g_settings.rgui_config_directory ? g_settings.rgui_config_directory : "<default>", type_str_size);
|
strlcpy(type_str, *g_settings.rgui_config_directory ? g_settings.rgui_config_directory : "<default>", type_str_size);
|
||||||
break;
|
break;
|
||||||
|
@ -100,6 +100,7 @@ static bool menu_type_is_directory_browser(unsigned type)
|
|||||||
type == RGUI_SAVESTATE_DIR_PATH ||
|
type == RGUI_SAVESTATE_DIR_PATH ||
|
||||||
#ifdef HAVE_DYNAMIC
|
#ifdef HAVE_DYNAMIC
|
||||||
type == RGUI_LIBRETRO_DIR_PATH ||
|
type == RGUI_LIBRETRO_DIR_PATH ||
|
||||||
|
type == RGUI_LIBRETRO_INFO_DIR_PATH ||
|
||||||
#endif
|
#endif
|
||||||
type == RGUI_CONFIG_DIR_PATH ||
|
type == RGUI_CONFIG_DIR_PATH ||
|
||||||
type == RGUI_SAVEFILE_DIR_PATH ||
|
type == RGUI_SAVEFILE_DIR_PATH ||
|
||||||
@ -491,6 +492,7 @@ static void rgui_settings_path_populate_entries(rgui_handle_t *rgui)
|
|||||||
#ifdef HAVE_DYNAMIC
|
#ifdef HAVE_DYNAMIC
|
||||||
rgui_list_push(rgui->selection_buf, "Core Directory", RGUI_LIBRETRO_DIR_PATH, 0);
|
rgui_list_push(rgui->selection_buf, "Core Directory", RGUI_LIBRETRO_DIR_PATH, 0);
|
||||||
#endif
|
#endif
|
||||||
|
rgui_list_push(rgui->selection_buf, "Core Info Directory", RGUI_LIBRETRO_INFO_DIR_PATH, 0);
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
rgui_list_push(rgui->selection_buf, "Shader Directory", RGUI_SHADER_DIR_PATH, 0);
|
rgui_list_push(rgui->selection_buf, "Shader Directory", RGUI_SHADER_DIR_PATH, 0);
|
||||||
#endif
|
#endif
|
||||||
@ -1436,6 +1438,11 @@ static int rgui_iterate(void *data, unsigned action)
|
|||||||
rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS_PATH_OPTIONS);
|
rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS_PATH_OPTIONS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else if (menu_type == RGUI_LIBRETRO_INFO_DIR_PATH)
|
||||||
|
{
|
||||||
|
strlcpy(g_settings.libretro_info_path, dir, sizeof(g_settings.libretro_info_path));
|
||||||
|
rgui_flush_menu_stack_type(rgui, RGUI_SETTINGS_PATH_OPTIONS);
|
||||||
|
}
|
||||||
else if (menu_type == RGUI_SHADER_DIR_PATH)
|
else if (menu_type == RGUI_SHADER_DIR_PATH)
|
||||||
{
|
{
|
||||||
strlcpy(g_settings.video.shader_dir, dir, sizeof(g_settings.video.shader_dir));
|
strlcpy(g_settings.video.shader_dir, dir, sizeof(g_settings.video.shader_dir));
|
||||||
|
@ -734,6 +734,8 @@ bool config_load_file(const char *path)
|
|||||||
if (!*g_settings.libretro)
|
if (!*g_settings.libretro)
|
||||||
CONFIG_GET_PATH(libretro, "libretro_path");
|
CONFIG_GET_PATH(libretro, "libretro_path");
|
||||||
|
|
||||||
|
CONFIG_GET_PATH(libretro_info_path, "libretro_info_path");
|
||||||
|
|
||||||
CONFIG_GET_PATH(core_options_path, "core_options_path");
|
CONFIG_GET_PATH(core_options_path, "core_options_path");
|
||||||
CONFIG_GET_PATH(screenshot_directory, "screenshot_directory");
|
CONFIG_GET_PATH(screenshot_directory, "screenshot_directory");
|
||||||
if (*g_settings.screenshot_directory)
|
if (*g_settings.screenshot_directory)
|
||||||
@ -1045,6 +1047,7 @@ bool config_save_file(const char *path)
|
|||||||
RARCH_LOG("Saving config at path: \"%s\"\n", path);
|
RARCH_LOG("Saving config at path: \"%s\"\n", path);
|
||||||
|
|
||||||
config_set_string(conf, "libretro_path", g_settings.libretro);
|
config_set_string(conf, "libretro_path", g_settings.libretro);
|
||||||
|
config_set_string(conf, "libretro_info_path", g_settings.libretro_info_path);
|
||||||
config_set_string(conf, "cheat_database_path", g_settings.cheat_database);
|
config_set_string(conf, "cheat_database_path", g_settings.cheat_database);
|
||||||
config_set_bool(conf, "rewind_enable", g_settings.rewind_enable);
|
config_set_bool(conf, "rewind_enable", g_settings.rewind_enable);
|
||||||
config_set_int(conf, "rewind_granularity", g_settings.rewind_granularity);
|
config_set_int(conf, "rewind_granularity", g_settings.rewind_granularity);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user