Add 'Update Core Info Files'

This commit is contained in:
twinaphex 2015-07-04 06:18:02 +02:00
parent ddb6efa75c
commit 431169d86b
5 changed files with 34 additions and 0 deletions

View File

@ -1356,6 +1356,8 @@ static int action_ok_download_generic(const char *path,
else if (!strcmp(type_msg, "cb_update_autoconfig_profiles_hid"))
path = "autoconf_hid.zip";
#endif
else if (!strcmp(type_msg, "cb_update_core_info_files"))
path = "info.zip";
else if (!strcmp(type_msg, "cb_update_cheats"))
path = "cheats.zip";
else if (!strcmp(type_msg, "cb_update_overlays"))
@ -1416,6 +1418,14 @@ static int action_ok_update_assets(const char *path,
return 0;
}
static int action_ok_update_core_info_files(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
action_ok_download_generic(path, label, type, idx, entry_idx,
"cb_update_core_info_files");
return 0;
}
static int action_ok_update_overlays(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@ -1866,6 +1876,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_UPDATE_ASSETS:
cbs->action_ok = action_ok_update_assets;
break;
case MENU_LABEL_UPDATE_CORE_INFO_FILES:
cbs->action_ok = action_ok_update_core_info_files;
break;
case MENU_LABEL_UPDATE_OVERLAYS:
cbs->action_ok = action_ok_update_overlays;
break;

View File

@ -26,6 +26,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
{
switch (hash)
{
case MENU_LABEL_UPDATE_CORE_INFO_FILES:
return "update_core_info_files";
case MENU_LABEL_DEFERRED_CORE_CONTENT_LIST:
return "deferred_core_content_list";
case MENU_LABEL_DOWNLOAD_CORE_CONTENT:
@ -608,6 +610,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
switch (hash)
{
case MENU_LABEL_VALUE_UPDATE_CORE_INFO_FILES:
return "Update Core Info Files";
case MENU_LABEL_VALUE_DOWNLOAD_CORE_CONTENT:
return "Download Content";
case MENU_LABEL_VALUE_SCAN_THIS_DIRECTORY:

View File

@ -1715,6 +1715,11 @@ static int menu_displaylist_parse_options(menu_displaylist_info_t *info)
menu_hash_to_str(MENU_LABEL_CORE_UPDATER_LIST),
MENU_SETTING_ACTION, 0, 0);
menu_list_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_UPDATE_CORE_INFO_FILES),
menu_hash_to_str(MENU_LABEL_UPDATE_CORE_INFO_FILES),
MENU_SETTING_ACTION, 0, 0);
menu_list_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_UPDATE_ASSETS),
menu_hash_to_str(MENU_LABEL_UPDATE_ASSETS),

View File

@ -22,6 +22,8 @@
extern "C" {
#endif
#define MENU_LABEL_VALUE_UPDATE_CORE_INFO_FILES 0xba274810U
#define MENU_LABEL_UPDATE_CORE_INFO_FILES 0x620d758dU
#define MENU_VALUE_SEARCH 0xd0d5febbU

View File

@ -30,6 +30,7 @@
#define CB_CORE_UPDATER_DOWNLOAD 0x7412da7dU
#define CB_CORE_UPDATER_LIST 0x32fd4f01U
#define CB_UPDATE_ASSETS 0xbf85795eU
#define CB_UPDATE_CORE_INFO_FILES 0xe6084091U
#define CB_UPDATE_AUTOCONFIG_PROFILES 0x28ada67dU
#define CB_UPDATE_CHEATS 0xc360fec3U
#define CB_UPDATE_OVERLAYS 0x699009a0U
@ -143,6 +144,12 @@ static int cb_core_content_download(void *data, size_t len)
return cb_generic_download(data, len, settings->core_assets_directory);
}
static int cb_update_core_info_files(void *data, size_t len)
{
settings_t *settings = config_get_ptr();
return cb_generic_download(data, len, settings->libretro_info_path);
}
static int cb_update_assets(void *data, size_t len)
{
settings_t *settings = config_get_ptr();
@ -279,6 +286,9 @@ static int cb_http_conn_default(void *data_, size_t len)
case CB_UPDATE_ASSETS:
http->cb = &cb_update_assets;
break;
case CB_UPDATE_CORE_INFO_FILES:
http->cb = &cb_update_core_info_files;
break;
case CB_UPDATE_AUTOCONFIG_PROFILES:
http->cb = &cb_update_autoconfig_profiles;
break;