(Menu) Cleanups
This commit is contained in:
parent
7090de541a
commit
a0ab7ab6fc
|
@ -2018,34 +2018,47 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_THUMBNAILS:
|
case MENU_ENUM_LABEL_THUMBNAILS:
|
||||||
settings = config_get_ptr();
|
settings = config_get_ptr();
|
||||||
|
#ifdef HAVE_RGUI
|
||||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_MATERIALUI
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_LEFT_THUMBNAILS:
|
case MENU_ENUM_LABEL_LEFT_THUMBNAILS:
|
||||||
settings = config_get_ptr();
|
settings = config_get_ptr();
|
||||||
|
#ifdef HAVE_RGUI
|
||||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_OZONE
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_MATERIALUI
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
||||||
}
|
}
|
||||||
|
@ -2798,15 +2811,20 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||||
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_RIGHT_THUMBNAIL_MODE:
|
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_RIGHT_THUMBNAIL_MODE:
|
||||||
settings = config_get_ptr();
|
settings = config_get_ptr();
|
||||||
/* Uses same sublabels as MENU_ENUM_LABEL_THUMBNAILS */
|
/* Uses same sublabels as MENU_ENUM_LABEL_THUMBNAILS */
|
||||||
|
#ifdef HAVE_RGUI
|
||||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_MATERIALUI
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
||||||
}
|
}
|
||||||
|
@ -2814,19 +2832,27 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||||
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE:
|
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE:
|
||||||
settings = config_get_ptr();
|
settings = config_get_ptr();
|
||||||
/* Uses same sublabels as MENU_ENUM_LABEL_LEFT_THUMBNAILS */
|
/* Uses same sublabels as MENU_ENUM_LABEL_LEFT_THUMBNAILS */
|
||||||
|
#ifdef HAVE_RGUI
|
||||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_OZONE
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_MATERIALUI
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,17 +89,23 @@ static int action_get_title_remap_port(const char *path, const char *label,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_thumbnails(
|
static int action_get_title_thumbnails(
|
||||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
const char *path, const char *label, unsigned menu_type,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const char *title = NULL;
|
const char *title = NULL;
|
||||||
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
||||||
|
#if defined(HAVE_RGUI) || defined(HAVE_MATERIALUI)
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
/* Get label value */
|
/* Get label value */
|
||||||
|
#ifdef HAVE_RGUI
|
||||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||||
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_RGUI;
|
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_RGUI;
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
#endif
|
||||||
|
#ifdef HAVE_MATERIALUI
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||||
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI;
|
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
title = msg_hash_to_str(label_value);
|
title = msg_hash_to_str(label_value);
|
||||||
|
|
||||||
|
@ -113,19 +119,27 @@ static int action_get_title_thumbnails(
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_left_thumbnails(
|
static int action_get_title_left_thumbnails(
|
||||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
const char *path, const char *label, unsigned menu_type,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const char *title = NULL;
|
const char *title = NULL;
|
||||||
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS;
|
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS;
|
||||||
|
#if defined(HAVE_RGUI) || defined(HAVE_OZONE) || defined(HAVE_MATERIALUI)
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
/* Get label value */
|
/* Get label value */
|
||||||
|
#ifdef HAVE_RGUI
|
||||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_RGUI;
|
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_RGUI;
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
#endif
|
||||||
|
#ifdef HAVE_OZONE
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
|
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
|
||||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
#endif
|
||||||
|
#ifdef HAVE_MATERIALUI
|
||||||
|
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI;
|
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
title = msg_hash_to_str(label_value);
|
title = msg_hash_to_str(label_value);
|
||||||
|
|
||||||
|
@ -138,7 +152,9 @@ static int action_get_title_left_thumbnails(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_dropdown_item(const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
static int action_get_title_dropdown_item(
|
||||||
|
const char *path, const char *label, unsigned menu_type,
|
||||||
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
if (string_is_empty(path))
|
if (string_is_empty(path))
|
||||||
|
@ -158,15 +174,16 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||||
|
|
||||||
if (coreopts)
|
if (coreopts)
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
unsigned menu_index = string_to_unsigned(tmp_str_list->elems[(unsigned)tmp_str_list->size - 1].data);
|
unsigned menu_index = string_to_unsigned(tmp_str_list->elems[(unsigned)tmp_str_list->size - 1].data);
|
||||||
unsigned visible_index = 0;
|
unsigned visible_index = 0;
|
||||||
unsigned option_index = 0;
|
unsigned option_index = 0;
|
||||||
bool option_found = false;
|
bool option_found = false;
|
||||||
unsigned i;
|
bool game_specific_options = settings->bools.game_specific_options;
|
||||||
|
|
||||||
/* Convert menu index to option index */
|
/* Convert menu index to option index */
|
||||||
if (settings->bools.game_specific_options)
|
if (game_specific_options)
|
||||||
menu_index--;
|
menu_index--;
|
||||||
|
|
||||||
for (i = 0; i < coreopts->size; i++)
|
for (i = 0; i < coreopts->size; i++)
|
||||||
|
@ -186,7 +203,8 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||||
/* If option was found, title == option description */
|
/* If option was found, title == option description */
|
||||||
if (option_found)
|
if (option_found)
|
||||||
{
|
{
|
||||||
const char *title = core_option_manager_get_desc(coreopts, option_index);
|
const char *title = core_option_manager_get_desc(
|
||||||
|
coreopts, option_index);
|
||||||
|
|
||||||
if (s && !string_is_empty(title))
|
if (s && !string_is_empty(title))
|
||||||
{
|
{
|
||||||
|
@ -215,7 +233,8 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||||
* MENU_ENUM_LABEL_VALUE_##STR
|
* MENU_ENUM_LABEL_VALUE_##STR
|
||||||
* to get 'MENU_ENUM_LABEL_VALUE_' from a
|
* to get 'MENU_ENUM_LABEL_VALUE_' from a
|
||||||
* 'MENU_ENUM_LABEL_', we therefore add 2... */
|
* 'MENU_ENUM_LABEL_', we therefore add 2... */
|
||||||
enum msg_hash_enums enum_idx = (enum msg_hash_enums)(string_to_unsigned(path) + 2);
|
enum msg_hash_enums enum_idx = (enum msg_hash_enums)
|
||||||
|
(string_to_unsigned(path) + 2);
|
||||||
|
|
||||||
/* Check if enum index is valid
|
/* Check if enum index is valid
|
||||||
* Note: This is a very crude check, but better than nothing */
|
* Note: This is a very crude check, but better than nothing */
|
||||||
|
@ -225,11 +244,15 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||||
* MENU_ENUM_LABEL_LEFT_THUMBNAILS require special
|
* MENU_ENUM_LABEL_LEFT_THUMBNAILS require special
|
||||||
* treatment, since their titles depend upon the
|
* treatment, since their titles depend upon the
|
||||||
* current menu driver... */
|
* current menu driver... */
|
||||||
if (enum_idx == MENU_ENUM_LABEL_VALUE_THUMBNAILS)
|
switch (enum_idx)
|
||||||
return action_get_title_thumbnails(path, label, menu_type, s, len);
|
{
|
||||||
else if (enum_idx == MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS)
|
case MENU_ENUM_LABEL_VALUE_THUMBNAILS:
|
||||||
return action_get_title_left_thumbnails(path, label, menu_type, s, len);
|
return action_get_title_thumbnails(
|
||||||
else
|
path, label, menu_type, s, len);
|
||||||
|
case MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS:
|
||||||
|
return action_get_title_left_thumbnails(
|
||||||
|
path, label, menu_type, s, len);
|
||||||
|
default:
|
||||||
{
|
{
|
||||||
const char *title = msg_hash_to_str(enum_idx);
|
const char *title = msg_hash_to_str(enum_idx);
|
||||||
|
|
||||||
|
@ -239,6 +262,8 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,18 +322,6 @@ static int action_get_title_deferred_playlist_list(const char *path, const char
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_dropdown_playlist_right_thumbnail_mode_item(
|
|
||||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
|
||||||
{
|
|
||||||
return action_get_title_thumbnails(path, label, menu_type, s, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int action_get_title_dropdown_playlist_left_thumbnail_mode_item(
|
|
||||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
|
||||||
{
|
|
||||||
return action_get_title_left_thumbnails(path, label, menu_type, s, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
default_title_macro(action_get_quick_menu_override_options, MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS)
|
default_title_macro(action_get_quick_menu_override_options, MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS)
|
||||||
default_title_macro(action_get_user_accounts_cheevos_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS)
|
default_title_macro(action_get_user_accounts_cheevos_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS)
|
||||||
default_title_macro(action_get_user_accounts_youtube_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_YOUTUBE)
|
default_title_macro(action_get_user_accounts_youtube_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_YOUTUBE)
|
||||||
|
@ -1474,8 +1487,8 @@ int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_VIDEO_SHADER_NUM_PASSES, action_get_title_dropdown_video_shader_num_pass_item },
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_VIDEO_SHADER_NUM_PASSES, action_get_title_dropdown_video_shader_num_pass_item },
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_DEFAULT_CORE, action_get_title_dropdown_playlist_default_core_item},
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_DEFAULT_CORE, action_get_title_dropdown_playlist_default_core_item},
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LABEL_DISPLAY_MODE, action_get_title_dropdown_playlist_label_display_mode_item},
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LABEL_DISPLAY_MODE, action_get_title_dropdown_playlist_label_display_mode_item},
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE, action_get_title_dropdown_playlist_right_thumbnail_mode_item},
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE, action_get_title_thumbnails},
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE, action_get_title_dropdown_playlist_left_thumbnail_mode_item},
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE, action_get_title_left_thumbnails},
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME, action_get_title_dropdown_manual_content_scan_system_name_item},
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME, action_get_title_dropdown_manual_content_scan_system_name_item},
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_CORE_NAME, action_get_title_dropdown_manual_content_scan_core_name_item},
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_CORE_NAME, action_get_title_dropdown_manual_content_scan_core_name_item},
|
||||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_DISK_INDEX, action_get_title_dropdown_disk_index},
|
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_DISK_INDEX, action_get_title_dropdown_disk_index},
|
||||||
|
|
Loading…
Reference in New Issue