mirror of
https://github.com/libretro/RetroArch
synced 2025-03-14 10:21:46 +00:00
Menu simplifications/cleanups
This commit is contained in:
parent
e01ef9e1de
commit
ce88a46a05
@ -6793,17 +6793,19 @@ static int action_ok_push_downloads_dir(const char *path,
|
||||
int action_ok_push_filebrowser_list_dir_select(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
char current_value[PATH_MAX_LENGTH];
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
menu_handle_t *menu = menu_st->driver_data;
|
||||
|
||||
current_value[0] = '\0';
|
||||
|
||||
if (!menu)
|
||||
return -1;
|
||||
|
||||
/* Start browsing from current directory */
|
||||
get_current_menu_value(menu_st, current_value, sizeof(current_value));
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
entry.flags |= MENU_ENTRY_FLAG_VALUE_ENABLED;
|
||||
menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true);
|
||||
strlcpy(current_value, entry.value, sizeof(current_value));
|
||||
#if IOS
|
||||
char tmp[PATH_MAX_LENGTH];
|
||||
fill_pathname_expand_special(tmp, current_value, sizeof(tmp));
|
||||
@ -6813,7 +6815,6 @@ int action_ok_push_filebrowser_list_dir_select(const char *path,
|
||||
if (!path_is_directory(current_value))
|
||||
current_value[0] = '\0';
|
||||
#endif
|
||||
|
||||
filebrowser_set_type(FILEBROWSER_SELECT_DIR);
|
||||
strlcpy(menu->filebrowser_label, label, sizeof(menu->filebrowser_label));
|
||||
return generic_action_ok_displaylist_push(
|
||||
|
@ -4040,8 +4040,8 @@ void menu_entries_search_append_terms_string(char *s, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
void get_current_menu_value(struct menu_state *menu_st,
|
||||
char *s, size_t len)
|
||||
static void get_current_menu_value(
|
||||
struct menu_state *menu_st, char *s, size_t len)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
const char* entry_label;
|
||||
@ -4058,18 +4058,6 @@ void get_current_menu_value(struct menu_state *menu_st,
|
||||
strlcpy(s, entry_label, len);
|
||||
}
|
||||
|
||||
static void get_current_menu_type(struct menu_state *menu_st,
|
||||
uint8_t *setting_type)
|
||||
{
|
||||
menu_entry_t entry;
|
||||
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
entry.flags = MENU_ENTRY_FLAG_VALUE_ENABLED;
|
||||
menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true);
|
||||
|
||||
*setting_type = entry.setting_type;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ACCESSIBILITY
|
||||
static void menu_driver_get_current_menu_label(struct menu_state *menu_st,
|
||||
char *s, size_t len)
|
||||
@ -5582,14 +5570,21 @@ unsigned menu_event(
|
||||
if (switch_current)
|
||||
{
|
||||
uint8_t setting_type = 0;
|
||||
menu_entry_t entry;
|
||||
|
||||
get_current_menu_type(menu_st, &setting_type);
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
entry.flags = MENU_ENTRY_FLAG_VALUE_ENABLED;
|
||||
menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true);
|
||||
setting_type = entry.setting_type;
|
||||
|
||||
if (setting_type == ST_BOOL)
|
||||
{
|
||||
char value[8];
|
||||
|
||||
get_current_menu_value(menu_st, value, sizeof(value));
|
||||
if (entry.enum_idx == MENU_ENUM_LABEL_CHEEVOS_PASSWORD)
|
||||
strlcpy(value, entry.password_value, sizeof(value));
|
||||
else
|
||||
strlcpy(value, entry.value, sizeof(value));
|
||||
|
||||
/* Ignore direction if switch is already in that position */
|
||||
if ( ( string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))
|
||||
|
@ -672,9 +672,6 @@ void menu_entries_build_scroll_indices(
|
||||
struct menu_state *menu_st,
|
||||
file_list_t *list);
|
||||
|
||||
void get_current_menu_value(struct menu_state *menu_st,
|
||||
char *s, size_t len);
|
||||
|
||||
/* Teardown function for the menu driver. */
|
||||
void menu_driver_destroy(
|
||||
struct menu_state *menu_st);
|
||||
|
Loading…
x
Reference in New Issue
Block a user