mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Add first implementation of 'Cursor Manager'
This commit is contained in:
parent
cbe33955e1
commit
27b54f504e
@ -488,6 +488,12 @@ static int action_ok_database_manager_list_deferred(const char *path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_ok_cursor_manager_list_deferred(const char *path,
|
||||
const char *label, unsigned type, size_t idx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_ok_core_load(const char *path,
|
||||
const char *label, unsigned type, size_t idx)
|
||||
{
|
||||
@ -586,6 +592,21 @@ static int action_ok_database_manager_list(const char *path,
|
||||
0, idx);
|
||||
}
|
||||
|
||||
static int action_ok_cursor_manager_list(const char *path,
|
||||
const char *label, unsigned type, size_t idx)
|
||||
{
|
||||
char cursor_path[PATH_MAX_LENGTH];
|
||||
|
||||
fill_pathname_join(cursor_path, g_settings.cursor_directory,
|
||||
path, sizeof(cursor_path));
|
||||
|
||||
return menu_list_push_stack_refresh(
|
||||
driver.menu->menu_list,
|
||||
cursor_path,
|
||||
"deferred_cursor_manager_list",
|
||||
0, idx);
|
||||
}
|
||||
|
||||
static int action_ok_config_load(const char *path,
|
||||
const char *label, unsigned type, size_t idx)
|
||||
{
|
||||
@ -1634,6 +1655,43 @@ static int deferred_push_database_manager_list_deferred(void *data, void *userda
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int deferred_push_cursor_manager_list_deferred(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
{
|
||||
char *query = NULL, *rdb = NULL;
|
||||
char rdb_path[PATH_MAX_LENGTH];
|
||||
config_file_t *conf = NULL;
|
||||
file_list_t *list = (file_list_t*)data;
|
||||
file_list_t *menu_list = (file_list_t*)userdata;
|
||||
|
||||
if (!list || !menu_list)
|
||||
return -1;
|
||||
|
||||
menu_list_clear(list);
|
||||
|
||||
conf = config_file_new(path);
|
||||
|
||||
if (!conf)
|
||||
return -1;
|
||||
|
||||
if (!config_get_string(conf, "query", &query))
|
||||
return -1;
|
||||
|
||||
if (!config_get_string(conf, "rdb", &rdb))
|
||||
return -1;
|
||||
|
||||
fill_pathname_join(rdb_path, g_settings.content_database,
|
||||
rdb, sizeof(rdb_path));
|
||||
|
||||
menu_database_populate_query(list, rdb_path, query);
|
||||
|
||||
menu_list_sort_on_alt(list);
|
||||
|
||||
menu_list_populate_generic(driver.menu, list, path, label, type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int deferred_push_core_information(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
{
|
||||
@ -2388,6 +2446,13 @@ static int deferred_push_database_manager_list(void *data, void *userdata,
|
||||
MENU_FILE_RDB, "rdb");
|
||||
}
|
||||
|
||||
static int deferred_push_cursor_manager_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
{
|
||||
return generic_deferred_push(data, userdata, g_settings.cursor_directory, label, type,
|
||||
MENU_FILE_CURSOR, "dbc");
|
||||
}
|
||||
|
||||
static int deferred_push_core_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
{
|
||||
@ -2648,6 +2713,12 @@ static int menu_entries_cbs_init_bind_ok_first(menu_file_list_cbs_t *cbs,
|
||||
else
|
||||
return -1;
|
||||
break;
|
||||
case MENU_FILE_CURSOR:
|
||||
if (!strcmp(menu_label, "deferred_database_manager_list"))
|
||||
cbs->action_ok = action_ok_cursor_manager_list_deferred;
|
||||
else if (!strcmp(menu_label, "cursor_manager_list"))
|
||||
cbs->action_ok = action_ok_cursor_manager_list;
|
||||
break;
|
||||
case MENU_FILE_FONT:
|
||||
case MENU_FILE_OVERLAY:
|
||||
case MENU_FILE_AUDIOFILTER:
|
||||
@ -2799,6 +2870,7 @@ static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
cbs->action_ok = action_ok_push_content_list;
|
||||
else if (!strcmp(label, "history_list") ||
|
||||
!strcmp(label, "core_manager_list") ||
|
||||
!strcmp(label, "cursor_manager_list") ||
|
||||
!strcmp(label, "database_manager_list") ||
|
||||
(setting && setting->browser_selection_type == ST_DIR)
|
||||
)
|
||||
@ -2857,6 +2929,7 @@ static void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs,
|
||||
case MENU_FILE_CORE:
|
||||
case MENU_FILE_RDB:
|
||||
case MENU_FILE_RDB_ENTRY:
|
||||
case MENU_FILE_CURSOR:
|
||||
case MENU_FILE_SHADER:
|
||||
case MENU_FILE_IMAGE:
|
||||
case MENU_FILE_OVERLAY:
|
||||
@ -2935,6 +3008,8 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
cbs->action_deferred_push = deferred_push_history_list;
|
||||
else if (!strcmp(label, "database_manager_list"))
|
||||
cbs->action_deferred_push = deferred_push_database_manager_list;
|
||||
else if (!strcmp(label, "cursor_manager_list"))
|
||||
cbs->action_deferred_push = deferred_push_cursor_manager_list;
|
||||
else if (!strcmp(label, "cheat_file_load"))
|
||||
cbs->action_deferred_push = deferred_push_cheat_file_load;
|
||||
else if (!strcmp(label, "remap_file_load"))
|
||||
@ -2949,6 +3024,8 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
cbs->action_deferred_push = deferred_push_core_list_deferred;
|
||||
else if (!strcmp(label, "deferred_database_manager_list"))
|
||||
cbs->action_deferred_push = deferred_push_database_manager_list_deferred;
|
||||
else if (!strcmp(label, "deferred_cursor_manager_list"))
|
||||
cbs->action_deferred_push = deferred_push_cursor_manager_list_deferred;
|
||||
else if (!strcmp(label, "core_information"))
|
||||
cbs->action_deferred_push = deferred_push_core_information;
|
||||
else if (!strcmp(label, "performance_counters"))
|
||||
|
@ -610,6 +610,7 @@ static void config_set_defaults(void)
|
||||
*g_settings.content_history_directory = '\0';
|
||||
*g_settings.content_database = '\0';
|
||||
*g_settings.cheat_database = '\0';
|
||||
*g_settings.cursor_directory = '\0';
|
||||
*g_settings.cheat_settings_path = '\0';
|
||||
*g_settings.resampler_directory = '\0';
|
||||
*g_settings.screenshot_directory = '\0';
|
||||
@ -1387,6 +1388,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
CONFIG_GET_PATH(content_database, "content_database_path");
|
||||
CONFIG_GET_PATH(cheat_database, "cheat_database_path");
|
||||
CONFIG_GET_PATH(cursor_directory, "cursor_directory");
|
||||
CONFIG_GET_PATH(cheat_settings_path, "cheat_settings_path");
|
||||
|
||||
CONFIG_GET_BOOL(block_sram_overwrite, "block_sram_overwrite");
|
||||
@ -1825,6 +1827,7 @@ bool config_save_file(const char *path)
|
||||
config_set_path(conf, "libretro_info_path", g_settings.libretro_info_path);
|
||||
config_set_path(conf, "content_database_path", g_settings.content_database);
|
||||
config_set_path(conf, "cheat_database_path", g_settings.cheat_database);
|
||||
config_set_path(conf, "cursor_directory", g_settings.cursor_directory);
|
||||
config_set_path(conf, "content_history_dir", g_settings.content_history_directory);
|
||||
config_set_bool(conf, "rewind_enable", g_settings.rewind_enable);
|
||||
config_set_int(conf, "audio_latency", g_settings.audio.latency);
|
||||
|
@ -3362,6 +3362,12 @@ static bool setting_data_append_list_main_menu_options(
|
||||
"Database Manager",
|
||||
group_info.name,
|
||||
subgroup_info.name);
|
||||
|
||||
CONFIG_ACTION(
|
||||
"cursor_manager_list",
|
||||
"Cursor Manager",
|
||||
group_info.name,
|
||||
subgroup_info.name);
|
||||
#endif
|
||||
|
||||
if (g_settings.history_list_enable)
|
||||
|
Loading…
x
Reference in New Issue
Block a user