Add 'Change Virtual Gamepad' help

This commit is contained in:
twinaphex 2015-07-18 14:01:37 +02:00
parent b45c8bf916
commit a919c26b81
6 changed files with 58 additions and 0 deletions

View File

@ -147,6 +147,10 @@ static int action_iterate_help(char *s, size_t len, const char *label)
menu_hash_get_help(MENU_LABEL_LOAD_CONTENT,
s, len);
break;
case MENU_HELP_CHANGE_VIRTUAL_GAMEPAD:
menu_hash_get_help(MENU_LABEL_VALUE_HELP_CHANGE_VIRTUAL_GAMEPAD_DESC,
s, len);
break;
case MENU_HELP_EXTRACT:
menu_hash_get_help(MENU_LABEL_VALUE_EXTRACTING_PLEASE_WAIT,
s, len);
@ -404,6 +408,7 @@ static enum action_iterate_type action_iterate_type(uint32_t hash)
case MENU_LABEL_HELP_CONTROLS:
case MENU_LABEL_HELP_WHAT_IS_A_CORE:
case MENU_LABEL_HELP_LOADING_CONTENT:
case MENU_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD:
return ITERATE_TYPE_HELP;
case MENU_LABEL_INFO_SCREEN:
return ITERATE_TYPE_INFO;

View File

@ -1886,6 +1886,25 @@ static int action_ok_help_what_is_a_core(const char *path,
return menu_displaylist_push_list(&info, DISPLAYLIST_HELP);
}
static int action_ok_help_change_virtual_gamepad(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
menu_displaylist_info_t info = {0};
menu_list_t *menu_list = menu_list_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu_list)
return -1;
info.list = menu_list->menu_stack;
strlcpy(info.label,
menu_hash_to_str(MENU_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD),
sizeof(info.label));
menu->push_help_screen = true;
menu->help_screen_type = MENU_HELP_CHANGE_VIRTUAL_GAMEPAD;
return menu_displaylist_push_list(&info, DISPLAYLIST_HELP);
}
static int action_ok_help_load_content(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@ -2046,6 +2065,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_HELP_WHAT_IS_A_CORE:
cbs->action_ok = action_ok_help_what_is_a_core;
break;
case MENU_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD:
cbs->action_ok = action_ok_help_change_virtual_gamepad;
break;
case MENU_LABEL_HELP_LOADING_CONTENT:
cbs->action_ok = action_ok_help_load_content;
break;

View File

@ -26,6 +26,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
{
switch (hash)
{
case MENU_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD:
return "help_change_virtual_gamepad";
case MENU_LABEL_HELP_WHAT_IS_A_CORE:
return "help_what_is_a_core";
case MENU_LABEL_HELP_LOADING_CONTENT:
@ -644,6 +646,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
switch (hash)
{
case MENU_LABEL_VALUE_HELP_CHANGE_VIRTUAL_GAMEPAD:
return "Changing Virtual Gamepad Overlay";
case MENU_LABEL_VALUE_HELP_WHAT_IS_A_CORE:
return "What Is A Core?";
case MENU_LABEL_VALUE_HELP_LOADING_CONTENT:
@ -2510,6 +2514,22 @@ int menu_hash_get_help_us(uint32_t hash, char *s, size_t len)
menu_hash_to_str(MENU_LABEL_VALUE_LIBRETRO_DIR_PATH)
#endif
);
case MENU_LABEL_VALUE_HELP_CHANGE_VIRTUAL_GAMEPAD_DESC:
snprintf(s, len,
"You can change the virtual gamepad overlay\n"
"by going to '%s' -> '%s'."
" \n"
"From there you can change the overlay,\n"
"change the size and opacity of the buttons, etc.\n"
" \n"
"NOTE: By default, virtual gamepad overlays are\n"
"hidden when in the menu.\n"
"If you'd like to change this behavior,\n"
"you can set '%s' to false.",
menu_hash_to_str(MENU_LABEL_VALUE_SETTINGS),
menu_hash_to_str(MENU_LABEL_VALUE_OVERLAY_SETTINGS),
menu_hash_to_str(MENU_LABEL_VALUE_INPUT_OVERLAY_HIDE_IN_MENU)
);
default:
if (s[0] == '\0')
strlcpy(s, menu_hash_to_str(MENU_LABEL_VALUE_NO_INFORMATION_AVAILABLE), len);

View File

@ -2190,6 +2190,12 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
menu_hash_to_str(MENU_LABEL_VALUE_HELP_LOADING_CONTENT),
menu_hash_to_str(MENU_LABEL_HELP_LOADING_CONTENT),
0, 0, 0);
#ifdef HAVE_OVERLAY
menu_list_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_HELP_CHANGE_VIRTUAL_GAMEPAD),
menu_hash_to_str(MENU_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD),
0, 0, 0);
#endif
need_refresh = true;
need_push = true;
break;

View File

@ -58,6 +58,7 @@ typedef enum
MENU_HELP_CONTROLS,
MENU_HELP_LOADING_CONTENT,
MENU_HELP_WHAT_IS_A_CORE,
MENU_HELP_CHANGE_VIRTUAL_GAMEPAD,
MENU_HELP_LAST
} menu_help_type_t;

View File

@ -1030,6 +1030,10 @@ extern "C" {
#define MENU_LABEL_VALUE_WHAT_IS_A_CORE_DESC 0xc832957eU
#define MENU_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD 0x6e66ef07U
#define MENU_LABEL_VALUE_HELP_CHANGE_VIRTUAL_GAMEPAD 0x27ed0204U
#define MENU_LABEL_VALUE_HELP_CHANGE_VIRTUAL_GAMEPAD_DESC 0x9d0e79dbU
const char *menu_hash_to_str_de(uint32_t hash);
int menu_hash_get_help_de(uint32_t hash, char *s, size_t len);