mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Start refactoring action_iterate_help
This commit is contained in:
parent
a59fd029b1
commit
bfb996dbcd
@ -154,7 +154,7 @@ static int load_or_open_zip_iterate(char *s, size_t len, unsigned action)
|
||||
static int action_iterate_help(char *s, size_t len, const char *label)
|
||||
{
|
||||
unsigned i;
|
||||
static const unsigned binds[] = {
|
||||
const unsigned binds[] = {
|
||||
RETRO_DEVICE_ID_JOYPAD_UP,
|
||||
RETRO_DEVICE_ID_JOYPAD_DOWN,
|
||||
RETRO_DEVICE_ID_JOYPAD_A,
|
||||
@ -165,47 +165,61 @@ static int action_iterate_help(char *s, size_t len, const char *label)
|
||||
RETRO_DEVICE_ID_JOYPAD_X,
|
||||
RETRO_DEVICE_ID_JOYPAD_Y,
|
||||
};
|
||||
char desc[ARRAY_SIZE(binds)][64] = {{0}};
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
menu_driver_render();
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(binds); i++)
|
||||
switch (menu->help_screen_type)
|
||||
{
|
||||
const struct retro_keybind *keybind = (const struct retro_keybind*)
|
||||
&settings->input.binds[0][binds[i]];
|
||||
const struct retro_keybind *auto_bind = (const struct retro_keybind*)
|
||||
input_get_auto_bind(0, binds[i]);
|
||||
case MENU_HELP_DEFAULT:
|
||||
{
|
||||
char desc[ARRAY_SIZE(binds)][64] = {{0}};
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
input_get_bind_string(desc[i], keybind, auto_bind, sizeof(desc[i]));
|
||||
for (i = 0; i < ARRAY_SIZE(binds); i++)
|
||||
{
|
||||
const struct retro_keybind *keybind = (const struct retro_keybind*)
|
||||
&settings->input.binds[0][binds[i]];
|
||||
const struct retro_keybind *auto_bind = (const struct retro_keybind*)
|
||||
input_get_auto_bind(0, binds[i]);
|
||||
|
||||
input_get_bind_string(desc[i], keybind, auto_bind, sizeof(desc[i]));
|
||||
}
|
||||
|
||||
snprintf(s, len,
|
||||
"Welcome to RetroArch\n"
|
||||
" \n" /* strtok_r doesn't split empty strings. */
|
||||
|
||||
"Basic Menu controls:\n"
|
||||
" Scroll (Up): %-20s\n"
|
||||
" Scroll (Down): %-20s\n"
|
||||
" Accept/OK: %-20s\n"
|
||||
" Back: %-20s\n"
|
||||
" Info: %-20s\n"
|
||||
"Enter/Exit Menu: %-20s\n"
|
||||
" Exit RetroArch: %-20s\n"
|
||||
"Toggle Keyboard: %-20s\n"
|
||||
" \n"
|
||||
|
||||
"To run content:\n"
|
||||
"Load a libretro core (Core).\n"
|
||||
"Load a content file (Load Content). \n"
|
||||
" \n"
|
||||
"See Path Settings to set directories \n"
|
||||
"for faster access to files.\n"
|
||||
" \n"
|
||||
|
||||
"Press Accept/OK to continue.",
|
||||
desc[0], desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], desc[7]);
|
||||
}
|
||||
break;
|
||||
case MENU_HELP_EXTRACTING:
|
||||
strlcpy(s, "Extracting, please wait...\n", len);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
snprintf(s, len,
|
||||
"Welcome to RetroArch\n"
|
||||
" \n" /* strtok_r doesn't split empty strings. */
|
||||
|
||||
"Basic Menu controls:\n"
|
||||
" Scroll (Up): %-20s\n"
|
||||
" Scroll (Down): %-20s\n"
|
||||
" Accept/OK: %-20s\n"
|
||||
" Back: %-20s\n"
|
||||
" Info: %-20s\n"
|
||||
"Enter/Exit Menu: %-20s\n"
|
||||
" Exit RetroArch: %-20s\n"
|
||||
"Toggle Keyboard: %-20s\n"
|
||||
" \n"
|
||||
|
||||
"To run content:\n"
|
||||
"Load a libretro core (Core).\n"
|
||||
"Load a content file (Load Content). \n"
|
||||
" \n"
|
||||
"See Path Settings to set directories \n"
|
||||
"for faster access to files.\n"
|
||||
" \n"
|
||||
|
||||
"Press Accept/OK to continue.",
|
||||
desc[0], desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], desc[7]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -561,7 +575,7 @@ static int action_iterate_main(const char *label, unsigned action)
|
||||
do_render = true;
|
||||
|
||||
/* Have to defer it so we let settings refresh. */
|
||||
if (menu->push_start_screen)
|
||||
if (menu->push_help_screen)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
|
@ -227,7 +227,7 @@ void *menu_init(const void *data)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
menu->push_start_screen = settings->menu_show_start_screen;
|
||||
menu->push_help_screen = settings->menu_show_start_screen;
|
||||
settings->menu_show_start_screen = false;
|
||||
|
||||
menu_shader_manager_init(menu);
|
||||
|
@ -2170,7 +2170,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
||||
break;
|
||||
case DISPLAYLIST_HELP:
|
||||
menu_list_push(info->list, info->path, info->label, info->type, info->directory_ptr, 0);
|
||||
menu->push_start_screen = false;
|
||||
menu->push_help_screen = false;
|
||||
menu_display_fb_set_dirty();
|
||||
break;
|
||||
case DISPLAYLIST_MAIN_MENU:
|
||||
|
@ -50,13 +50,21 @@ typedef enum
|
||||
MENU_ENVIRON_LAST
|
||||
} menu_environ_cb_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MENU_HELP_DEFAULT = 0,
|
||||
MENU_HELP_EXTRACTING,
|
||||
MENU_HELP_LAST
|
||||
} menu_help_type_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *userdata;
|
||||
|
||||
float scroll_y;
|
||||
|
||||
bool push_start_screen;
|
||||
bool push_help_screen;
|
||||
menu_help_type_t help_screen_type;
|
||||
|
||||
bool defer_core;
|
||||
char deferred_path[PATH_MAX_LENGTH];
|
||||
|
Loading…
x
Reference in New Issue
Block a user