mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Add dropdown lists for Netplay share Digital/Analog
This commit is contained in:
parent
ba9150f7c0
commit
cadb9539b6
@ -1847,86 +1847,6 @@ static void menu_action_setting_disp_set_label_setting_path(file_list_t* list,
|
||||
strlcpy(s2, path, len2);
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
static void menu_action_setting_disp_set_label_netplay_share_digital(file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
const char *label,
|
||||
char *s, size_t len,
|
||||
const char *entry_label,
|
||||
const char *path,
|
||||
char *s2, size_t len2)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *src;
|
||||
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
strlcpy(s2, path, len2);
|
||||
*w = 19;
|
||||
switch (settings->uints.netplay_share_digital)
|
||||
{
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NO_PREFERENCE);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_OR:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_DIGITAL_OR);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_XOR:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_DIGITAL_XOR);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_VOTE:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_DIGITAL_VOTE);
|
||||
break;
|
||||
|
||||
default:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NONE);
|
||||
break;
|
||||
}
|
||||
strlcpy(s, src, len);
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_netplay_share_analog(file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
const char *label,
|
||||
char *s, size_t len,
|
||||
const char *entry_label,
|
||||
const char *path,
|
||||
char *s2, size_t len2)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *src;
|
||||
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
strlcpy(s2, path, len2);
|
||||
*w = 19;
|
||||
switch (settings->uints.netplay_share_analog)
|
||||
{
|
||||
case RARCH_NETPLAY_SHARE_ANALOG_NO_PREFERENCE:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NO_PREFERENCE);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_ANALOG_MAX:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_ANALOG_MAX);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_ANALOG_AVERAGE:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_ANALOG_AVERAGE);
|
||||
break;
|
||||
|
||||
default:
|
||||
src = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NONE);
|
||||
break;
|
||||
}
|
||||
strlcpy(s, src, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int menu_cbs_init_bind_get_string_representation_compare_label(
|
||||
menu_file_list_cbs_t *cbs)
|
||||
{
|
||||
@ -2031,16 +1951,6 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_menu_input_keyboard_gamepad_mapping_type);
|
||||
break;
|
||||
#ifdef HAVE_NETWORKING
|
||||
case MENU_ENUM_LABEL_NETPLAY_SHARE_DIGITAL:
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_netplay_share_digital);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_NETPLAY_SHARE_ANALOG:
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_netplay_share_analog);
|
||||
break;
|
||||
#endif
|
||||
case MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST:
|
||||
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
|
||||
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
||||
|
@ -793,6 +793,64 @@ static void setting_get_string_representation_toggle_gamepad_combo(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
static void setting_get_string_representation_netplay_share_digital(void *data,
|
||||
char *s, size_t len)
|
||||
{
|
||||
rarch_setting_t *setting = (rarch_setting_t*)data;
|
||||
if (!setting)
|
||||
return;
|
||||
|
||||
switch (*setting->value.target.unsigned_integer)
|
||||
{
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NO_PREFERENCE), len);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_OR:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_DIGITAL_OR), len);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_XOR:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_DIGITAL_XOR), len);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_DIGITAL_VOTE:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_DIGITAL_VOTE), len);
|
||||
break;
|
||||
|
||||
default:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NONE), len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void setting_get_string_representation_netplay_share_analog(void *data,
|
||||
char *s, size_t len)
|
||||
{
|
||||
rarch_setting_t *setting = (rarch_setting_t*)data;
|
||||
if (!setting)
|
||||
return;
|
||||
|
||||
switch (*setting->value.target.unsigned_integer)
|
||||
{
|
||||
case RARCH_NETPLAY_SHARE_ANALOG_NO_PREFERENCE:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NO_PREFERENCE), len);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_ANALOG_MAX:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_ANALOG_MAX), len);
|
||||
break;
|
||||
|
||||
case RARCH_NETPLAY_SHARE_ANALOG_AVERAGE:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_ANALOG_AVERAGE), len);
|
||||
break;
|
||||
|
||||
default:
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SHARE_NONE), len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void setting_get_string_representation_poll_type_behavior(void *data,
|
||||
char *s, size_t len)
|
||||
{
|
||||
@ -8123,6 +8181,9 @@ static bool setting_append_list(
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_netplay_share_digital;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, RARCH_NETPLAY_SHARE_DIGITAL_LAST-1, 1, true, true);
|
||||
|
||||
CONFIG_UINT(
|
||||
@ -8136,6 +8197,9 @@ static bool setting_append_list(
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_netplay_share_analog;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, RARCH_NETPLAY_SHARE_ANALOG_LAST-1, 1, true, true);
|
||||
|
||||
for (user = 0; user < MAX_USERS; user++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user