mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
(Menu) Create menu_entries_push
This commit is contained in:
parent
e32e269264
commit
e4745c0f24
@ -502,18 +502,6 @@ static int menu_start_screen_iterate(unsigned action)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_common_setting_push_current_menu(file_list_t *list,
|
|
||||||
const char *path, const char *label, unsigned type,
|
|
||||||
size_t directory_ptr, unsigned action)
|
|
||||||
{
|
|
||||||
if (action == MENU_ACTION_OK)
|
|
||||||
{
|
|
||||||
file_list_push(list, path, label, type, directory_ptr);
|
|
||||||
menu_clear_navigation(driver.menu);
|
|
||||||
driver.menu->need_refresh = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int menu_common_core_setting_toggle(unsigned setting, unsigned action)
|
static int menu_common_core_setting_toggle(unsigned setting, unsigned action)
|
||||||
{
|
{
|
||||||
unsigned index = setting - MENU_SETTINGS_CORE_OPTION_START;
|
unsigned index = setting - MENU_SETTINGS_CORE_OPTION_START;
|
||||||
@ -552,7 +540,7 @@ static void defer_decision_automatic(void)
|
|||||||
static void defer_decision_manual(void)
|
static void defer_decision_manual(void)
|
||||||
{
|
{
|
||||||
if (driver.menu)
|
if (driver.menu)
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
g_settings.libretro_directory, "deferred_core_list",
|
g_settings.libretro_directory, "deferred_core_list",
|
||||||
MENU_SETTINGS_DEFERRED_CORE, driver.menu->selection_ptr,
|
MENU_SETTINGS_DEFERRED_CORE, driver.menu->selection_ptr,
|
||||||
MENU_ACTION_OK);
|
MENU_ACTION_OK);
|
||||||
@ -614,7 +602,7 @@ static void menu_common_setting_set_current_path_selection(
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case MENU_ACTION_OK:
|
case MENU_ACTION_OK:
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
start_path, "path_list", type,
|
start_path, "path_list", type,
|
||||||
driver.menu->selection_ptr, action);
|
driver.menu->selection_ptr, action);
|
||||||
break;
|
break;
|
||||||
@ -1356,19 +1344,19 @@ static int menu_settings_iterate(unsigned action)
|
|||||||
&& action == MENU_ACTION_OK)
|
&& action == MENU_ACTION_OK)
|
||||||
{
|
{
|
||||||
driver.menu->defer_core = (!strcmp(label, "detect_core_list"));
|
driver.menu->defer_core = (!strcmp(label, "detect_core_list"));
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
g_settings.menu_content_directory, "", MENU_FILE_DIRECTORY,
|
g_settings.menu_content_directory, "", MENU_FILE_DIRECTORY,
|
||||||
driver.menu->selection_ptr, action);
|
driver.menu->selection_ptr, action);
|
||||||
}
|
}
|
||||||
else if ((!strcmp(label, "history_list") ||
|
else if ((!strcmp(label, "history_list") ||
|
||||||
menu_common_type_is(type) == MENU_FILE_DIRECTORY)
|
menu_common_type_is(type) == MENU_FILE_DIRECTORY)
|
||||||
&& action == MENU_ACTION_OK)
|
&& action == MENU_ACTION_OK)
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
"", "", type, driver.menu->selection_ptr, action);
|
"", "", type, driver.menu->selection_ptr, action);
|
||||||
else if ((menu_common_type_is(type) == MENU_SETTINGS ||
|
else if ((menu_common_type_is(type) == MENU_SETTINGS ||
|
||||||
type == MENU_SETTINGS_CORE || type == MENU_SETTINGS_CONFIG ||
|
type == MENU_SETTINGS_CORE || type == MENU_SETTINGS_CONFIG ||
|
||||||
type == MENU_SETTINGS_DISK_APPEND) && action == MENU_ACTION_OK)
|
type == MENU_SETTINGS_DISK_APPEND) && action == MENU_ACTION_OK)
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
dir ? dir : label, "", type,
|
dir ? dir : label, "", type,
|
||||||
driver.menu->selection_ptr, action);
|
driver.menu->selection_ptr, action);
|
||||||
else if (type == MENU_SETTINGS_CUSTOM_VIEWPORT && action == MENU_ACTION_OK)
|
else if (type == MENU_SETTINGS_CUSTOM_VIEWPORT && action == MENU_ACTION_OK)
|
||||||
@ -1416,7 +1404,7 @@ static int menu_settings_iterate(unsigned action)
|
|||||||
if (driver.menu->need_refresh && (menu_parse_check(menu_type) == -1))
|
if (driver.menu->need_refresh && (menu_parse_check(menu_type) == -1))
|
||||||
{
|
{
|
||||||
driver.menu->need_refresh = false;
|
driver.menu->need_refresh = false;
|
||||||
menu_entries_push(driver.menu, path, label, menu_type);
|
menu_entries_push_list(driver.menu, path, label, menu_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver.menu_ctx && driver.menu_ctx->render)
|
if (driver.menu_ctx && driver.menu_ctx->render)
|
||||||
@ -1711,7 +1699,7 @@ static int menu_action_ok(const char *dir, unsigned menu_type)
|
|||||||
char cat_path[PATH_MAX];
|
char cat_path[PATH_MAX];
|
||||||
fill_pathname_join(cat_path, dir, path, sizeof(cat_path));
|
fill_pathname_join(cat_path, dir, path, sizeof(cat_path));
|
||||||
|
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
cat_path, "browser_list", type, driver.menu->selection_ptr,
|
cat_path, "browser_list", type, driver.menu->selection_ptr,
|
||||||
MENU_ACTION_OK);
|
MENU_ACTION_OK);
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ static int menu_common_shader_manager_setting_toggle(unsigned id, unsigned actio
|
|||||||
}
|
}
|
||||||
else if ((id == MENU_SETTINGS_SHADER_PARAMETERS
|
else if ((id == MENU_SETTINGS_SHADER_PARAMETERS
|
||||||
|| id == MENU_SETTINGS_SHADER_PRESET_PARAMETERS))
|
|| id == MENU_SETTINGS_SHADER_PRESET_PARAMETERS))
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack, "",
|
menu_entries_push(driver.menu->menu_stack, "",
|
||||||
"shader_parameters", id, driver.menu->selection_ptr, action);
|
"shader_parameters", id, driver.menu->selection_ptr, action);
|
||||||
else if (id >= MENU_SETTINGS_SHADER_PARAMETER_0 && id <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
else if (id >= MENU_SETTINGS_SHADER_PARAMETER_0 && id <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||||
{
|
{
|
||||||
@ -359,7 +359,7 @@ static int menu_common_shader_manager_setting_toggle(unsigned id, unsigned actio
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case MENU_ACTION_OK:
|
case MENU_ACTION_OK:
|
||||||
menu_common_setting_push_current_menu(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
g_settings.video.shader_dir, "video_shader_preset",
|
g_settings.video.shader_dir, "video_shader_preset",
|
||||||
id, driver.menu->selection_ptr, action);
|
id, driver.menu->selection_ptr, action);
|
||||||
break;
|
break;
|
||||||
|
@ -273,7 +273,7 @@ void *menu_init(const void *data)
|
|||||||
menu->push_start_screen = g_settings.menu_show_start_screen;
|
menu->push_start_screen = g_settings.menu_show_start_screen;
|
||||||
g_settings.menu_show_start_screen = false;
|
g_settings.menu_show_start_screen = false;
|
||||||
|
|
||||||
menu_entries_push(menu, "", "mainmenu", 0);
|
menu_entries_push_list(menu, "", "mainmenu", 0);
|
||||||
|
|
||||||
menu->trigger_state = 0;
|
menu->trigger_state = 0;
|
||||||
menu->old_input_state = 0;
|
menu->old_input_state = 0;
|
||||||
|
@ -78,7 +78,7 @@ void menu_entries_pop(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu_entries_push(menu_handle_t *menu,
|
int menu_entries_push_list(menu_handle_t *menu,
|
||||||
const char *path, const char *label,
|
const char *path, const char *label,
|
||||||
unsigned menu_type)
|
unsigned menu_type)
|
||||||
{
|
{
|
||||||
@ -596,7 +596,7 @@ int menu_parse_and_resolve(void)
|
|||||||
menu_type == MENU_SETTINGS_DEFERRED_CORE ||
|
menu_type == MENU_SETTINGS_DEFERRED_CORE ||
|
||||||
menu_type == MENU_SETTINGS_OPEN_HISTORY
|
menu_type == MENU_SETTINGS_OPEN_HISTORY
|
||||||
)
|
)
|
||||||
return menu_entries_push(driver.menu, dir, label, menu_type);
|
return menu_entries_push_list(driver.menu, dir, label, menu_type);
|
||||||
|
|
||||||
if (menu_parse_check(menu_type) == -1)
|
if (menu_parse_check(menu_type) == -1)
|
||||||
return - 1;
|
return - 1;
|
||||||
@ -764,7 +764,7 @@ int menu_parse_and_resolve(void)
|
|||||||
is_dir ? menu_type : MENU_FILE_PLAIN, 0);
|
is_dir ? menu_type : MENU_FILE_PLAIN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_entries_push(driver.menu, dir, label, menu_type);
|
menu_entries_push_list(driver.menu, dir, label, menu_type);
|
||||||
string_list_free(str_list);
|
string_list_free(str_list);
|
||||||
|
|
||||||
switch (menu_type)
|
switch (menu_type)
|
||||||
@ -829,3 +829,15 @@ void menu_flush_stack_type(unsigned final_type)
|
|||||||
file_list_get_last(driver.menu->menu_stack, &path, &label, &type);
|
file_list_get_last(driver.menu->menu_stack, &path, &label, &type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_entries_push(file_list_t *list,
|
||||||
|
const char *path, const char *label, unsigned type,
|
||||||
|
size_t directory_ptr, unsigned action)
|
||||||
|
{
|
||||||
|
if (action == MENU_ACTION_OK)
|
||||||
|
{
|
||||||
|
file_list_push(list, path, label, type, directory_ptr);
|
||||||
|
menu_clear_navigation(driver.menu);
|
||||||
|
driver.menu->need_refresh = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -19,7 +19,10 @@
|
|||||||
|
|
||||||
#include "menu_common.h"
|
#include "menu_common.h"
|
||||||
|
|
||||||
int menu_entries_push(menu_handle_t *menu, const char *path,
|
void menu_entries_push(file_list_t *list,
|
||||||
|
const char *path, const char *label, unsigned type,
|
||||||
|
size_t directory_ptr, unsigned action);
|
||||||
|
int menu_entries_push_list(menu_handle_t *menu, const char *path,
|
||||||
const char *label, unsigned menu_type);
|
const char *label, unsigned menu_type);
|
||||||
void menu_entries_push_info(void);
|
void menu_entries_push_info(void);
|
||||||
int menu_parse_check(unsigned menu_type);
|
int menu_parse_check(unsigned menu_type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user