Add on-screen statistics toggle hotkey (#13381)

* Add on-screen statistics toggle hotkey

* CHANGES.md: Add technical statistics hotkey
This commit is contained in:
Nikos Chantziaras 2021-12-21 01:03:35 +02:00 committed by GitHub
parent e5215d9e29
commit 0357b6c922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 53 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# Future
- LINUX: Added support for Linux GameMode (https://github.com/FeralInteractive/gamemode), which can be toggled on/off in the Power Management or Latency settings menus.
- Added a hotkey toggle for the on-screen technical statistics.
# 1.9.14
- ANDROID/PLAYSTORE: Implement MANAGE_EXTERNAL_STORAGE permission

View File

@ -119,6 +119,8 @@ enum event_command
CMD_EVENT_AUDIO_MUTE_TOGGLE,
/* Toggles FPS counter. */
CMD_EVENT_FPS_TOGGLE,
/* Toggles statistics display. */
CMD_EVENT_STATISTICS_TOGGLE,
/* Toggle ping counter. */
CMD_EVENT_NETPLAY_PING_TOGGLE,
/* Gathers diagnostic info about the system and RetroArch configuration, then sends it to our servers. */
@ -461,6 +463,7 @@ static const struct cmd_map map[] = {
{ "MUTE", RARCH_MUTE },
{ "OSK", RARCH_OSK },
{ "FPS_TOGGLE", RARCH_FPS_TOGGLE },
{ "STATISTICS_TOGGLE", RARCH_STATISTICS_TOGGLE },
{ "SEND_DEBUG_INFO", RARCH_SEND_DEBUG_INFO },
{ "NETPLAY_HOST_TOGGLE", RARCH_NETPLAY_HOST_TOGGLE },
{ "NETPLAY_GAME_WATCH", RARCH_NETPLAY_GAME_WATCH },

View File

@ -451,6 +451,13 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_FPS_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_STATISTICS_TOGGLE, RETROK_UNKNOWN,
RARCH_STATISTICS_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
@ -1026,6 +1033,13 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_FPS_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_STATISTICS_TOGGLE, RETROK_UNKNOWN,
RARCH_STATISTICS_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
@ -1611,6 +1625,13 @@ static const struct retro_keybind retro_keybinds_1[] = {
RARCH_FPS_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_META_STATISTICS_TOGGLE, RETROK_UNKNOWN,
RARCH_STATISTICS_TOGGLE, NO_BTN, NO_BTN, 0,
true
},
{
NULL, NULL,
AXIS_NONE, AXIS_NONE, AXIS_NONE,

View File

@ -333,6 +333,7 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
DECLARE_META_BIND(2, audio_mute, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE),
DECLARE_META_BIND(2, osk_toggle, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK),
DECLARE_META_BIND(2, fps_toggle, RARCH_FPS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE),
DECLARE_META_BIND(2, toggle_statistics, RARCH_STATISTICS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STATISTICS_TOGGLE),
DECLARE_META_BIND(2, netplay_ping_toggle, RARCH_NETPLAY_PING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PING_TOGGLE),
DECLARE_META_BIND(2, send_debug_info, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO),
DECLARE_META_BIND(2, netplay_host_toggle, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE),

View File

@ -99,6 +99,7 @@ enum
RARCH_MUTE,
RARCH_OSK,
RARCH_FPS_TOGGLE,
RARCH_STATISTICS_TOGGLE,
RARCH_NETPLAY_PING_TOGGLE,
RARCH_SEND_DEBUG_INFO,
RARCH_NETPLAY_HOST_TOGGLE,

View File

@ -109,6 +109,10 @@ int msg_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
snprintf(s, len,
"Toggles frames per second counter.");
break;
case RARCH_STATISTICS_TOGGLE:
snprintf(s, len,
"Toggles display of technical statistics.");
break;
case RARCH_SEND_DEBUG_INFO:
snprintf(s, len,
"Sends diagnostic info about your device and RetroArch configuration to our servers for analysis.");

View File

@ -2666,6 +2666,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_META_FPS_TOGGLE,
"Switches 'frames per second' status indicator on/off."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_STATISTICS_TOGGLE,
"Show Technical Statistics (Toggle)"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_META_STATISTICS_TOGGLE,
"Switches the display of on-screen technical statistics on/off."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PING_TOGGLE,
"Show Netplay Ping (Toggle)"

View File

@ -288,6 +288,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_screenshot, ME
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_mute, MENU_ENUM_SUBLABEL_INPUT_META_MUTE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_osk, MENU_ENUM_SUBLABEL_INPUT_META_OSK)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_fps_toggle, MENU_ENUM_SUBLABEL_INPUT_META_FPS_TOGGLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_statistics_toggle, MENU_ENUM_SUBLABEL_INPUT_META_STATISTICS_TOGGLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_netplay_ping_toggle, MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_PING_TOGGLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_send_debug_info, MENU_ENUM_SUBLABEL_INPUT_META_SEND_DEBUG_INFO)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_netplay_host_toggle, MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_HOST_TOGGLE)
@ -1883,6 +1884,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case RARCH_FPS_TOGGLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_fps_toggle);
return 0;
case RARCH_STATISTICS_TOGGLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_statistics_toggle);
return 0;
case RARCH_NETPLAY_PING_TOGGLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_meta_netplay_ping_toggle);
return 0;

View File

@ -880,6 +880,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE,
MENU_ENUM_LABEL_VALUE_INPUT_META_OSK,
MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE,
MENU_ENUM_LABEL_VALUE_INPUT_META_STATISTICS_TOGGLE,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_PING_TOGGLE,
MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO,
MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE,
@ -940,6 +941,7 @@ enum msg_hash_enums
MENU_ENUM_SUBLABEL_INPUT_META_MUTE,
MENU_ENUM_SUBLABEL_INPUT_META_OSK,
MENU_ENUM_SUBLABEL_INPUT_META_FPS_TOGGLE,
MENU_ENUM_SUBLABEL_INPUT_META_STATISTICS_TOGGLE,
MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_PING_TOGGLE,
MENU_ENUM_SUBLABEL_INPUT_META_SEND_DEBUG_INFO,
MENU_ENUM_SUBLABEL_INPUT_META_NETPLAY_HOST_TOGGLE,

View File

@ -2106,6 +2106,9 @@ bool command_event(enum event_command cmd, void *data)
case CMD_EVENT_FPS_TOGGLE:
settings->bools.video_fps_show = !(settings->bools.video_fps_show);
break;
case CMD_EVENT_STATISTICS_TOGGLE:
settings->bools.video_statistics_show = !(settings->bools.video_statistics_show);
break;
case CMD_EVENT_OVERLAY_NEXT:
/* Switch to the next available overlay screen. */
#ifdef HAVE_OVERLAY

View File

@ -639,6 +639,9 @@
# Toggles menu.
# input_menu_toggle = f1
# Toggles display of on-screen technical statistics.
# input_toggle_statistics =
# RetroPad button combination to toggle menu
# 0: None
# 1: Down + Y + L1 + R1

View File

@ -6827,6 +6827,8 @@ static enum runloop_state_enum runloop_check_state(
/* Check if we have pressed the FPS toggle button */
HOTKEY_CHECK(RARCH_FPS_TOGGLE, CMD_EVENT_FPS_TOGGLE, true, NULL);
HOTKEY_CHECK(RARCH_STATISTICS_TOGGLE, CMD_EVENT_STATISTICS_TOGGLE, true, NULL);
/* Check if we have pressed the netplay host toggle button */
HOTKEY_CHECK(RARCH_NETPLAY_HOST_TOGGLE, CMD_EVENT_NETPLAY_HOST_TOGGLE, true, NULL);