Added option to change controller port to listen to for showing overlay input.

This commit is contained in:
denu8thell 2017-08-08 09:56:27 -05:00
parent c07380293e
commit c5b36320df
10 changed files with 36 additions and 2 deletions

View file

@ -1374,6 +1374,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
#endif
SETTING_UINT("bundle_assets_extract_version_current", &settings->uints.bundle_assets_extract_version_current, true, 0, false);
SETTING_UINT("bundle_assets_extract_last_version", &settings->uints.bundle_assets_extract_last_version, true, 0, false);
SETTING_UINT("input_overlay_show_physical_inputs_port", &settings->uints.input_overlay_show_physical_inputs_port, true, 0, false);
*size = count;

View file

@ -329,6 +329,8 @@ typedef struct settings
unsigned camera_width;
unsigned camera_height;
unsigned input_overlay_show_physical_inputs_port;
} uints;
struct

View file

@ -706,7 +706,7 @@ void input_poll_overlay(input_overlay_t *ol, float opacity, unsigned analog_dpad
break;
}
if(settings->bools.input_overlay_show_physical_inputs){
button_pressed = input_overlay_add_inputs(ol, 0, analog_dpad_mode);
button_pressed = input_overlay_add_inputs(ol, settings->uints.input_overlay_show_physical_inputs_port, analog_dpad_mode);
}
if (button_pressed || polled)
input_overlay_post_poll(ol, opacity);

View file

@ -481,6 +481,8 @@ MSG_HASH(MENU_ENUM_LABEL_INPUT_OVERLAY_HIDE_IN_MENU,
"overlay_hide_in_menu")
MSG_HASH(MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS,
"overlay_show_physical_inputs")
MSG_HASH(MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
"overlay_show_physical_inputs_port")
MSG_HASH(MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE,
"input_player%u_analog_dpad_mode")
MSG_HASH(MENU_ENUM_LABEL_INPUT_POLL_TYPE_BEHAVIOR,

View file

@ -577,6 +577,11 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) {
"Show keyboard/controller button presses on \n"
"the onscreen overlay.");
break;
case MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT:
snprintf(s, len,
"Select the port to listen for controller input \n"
"to display on the onscreen overlay.");
break;
case MENU_ENUM_LABEL_OVERLAY_PRESET:
snprintf(s, len,
"Path to input overlay.");

View file

@ -829,6 +829,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_HIDE_IN_MENU,
"Hide Overlay In Menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS,
"Show Inputs On Overlay")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
"Show Inputs Listen Port")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR,
"Poll Type Behavior")
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_EARLY,
@ -2516,6 +2518,8 @@ MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_OVERLAY_HIDE_IN_MENU,
"Hide the overlay while inside the menu, and show it again when exiting the menu.")
MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS,
"Show keyboard/controller inputs on the onscreen overlay.")
MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
"Select the port for the overlay to listen to if Show Inputs On Overlay is enabled.")
MSG_HASH(
MENU_ENUM_SUBLABEL_CONTENT_COLLECTION_LIST,
"Scanned content will appear here."

View file

@ -226,6 +226,7 @@ default_sublabel_macro(action_bind_sublabel_sort_savestates_enable, MENU_
default_sublabel_macro(action_bind_sublabel_netplay_client_swap_input, MENU_ENUM_SUBLABEL_NETPLAY_CLIENT_SWAP_INPUT)
default_sublabel_macro(action_bind_sublabel_core_updater_buildbot_url, MENU_ENUM_SUBLABEL_CORE_UPDATER_BUILDBOT_URL)
default_sublabel_macro(action_bind_sublabel_input_overlay_show_physical_inputs, MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS)
default_sublabel_macro(action_bind_sublabel_input_overlay_show_physical_inputs_port, MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT)
default_sublabel_macro(action_bind_sublabel_core_updater_buildbot_assets_url, MENU_ENUM_SUBLABEL_BUILDBOT_ASSETS_URL)
default_sublabel_macro(action_bind_sublabel_core_updater_auto_extract_archive, MENU_ENUM_SUBLABEL_CORE_UPDATER_AUTO_EXTRACT_ARCHIVE)
default_sublabel_macro(action_bind_sublabel_netplay_refresh_rooms, MENU_ENUM_SUBLABEL_NETPLAY_REFRESH_ROOMS)
@ -953,6 +954,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_overlay_show_physical_inputs);
break;
case MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_overlay_show_physical_inputs_port);
break;
case MENU_ENUM_LABEL_VIDEO_FONT_SIZE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_font_size);
break;

View file

@ -5010,6 +5010,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_OVERLAY_PRESET,
PARSE_ONLY_PATH, false);

View file

@ -4906,7 +4906,19 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE
);
CONFIG_UINT(
list, list_info,
&settings->uints.input_overlay_show_physical_inputs_port,
MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
0,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler
);
menu_settings_list_current_add_range(list, list_info, 0, MAX_USERS - 1, 1, true, true);
CONFIG_PATH(
list, list_info,
settings->paths.path_overlay,

View file

@ -599,6 +599,7 @@ enum msg_hash_enums
MENU_LABEL(INPUT_MENU_ENUM_TOGGLE_GAMEPAD_COMBO),
MENU_LABEL(INPUT_OVERLAY_HIDE_IN_MENU),
MENU_LABEL(INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS),
MENU_LABEL(INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT),
MENU_LABEL(INPUT_KEYBOARD_GAMEPAD_MAPPING_TYPE),
MENU_LABEL(INPUT_SMALL_KEYBOARD_ENABLE),
MENU_LABEL(INPUT_TOUCH_ENABLE),