diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 7a8b8557b2..73886da4cc 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -593,6 +593,8 @@ MSG_HASH(MENU_ENUM_LABEL_NETPLAY_PASSWORD, "netplay_password") MSG_HASH(MENU_ENUM_LABEL_NETPLAY_SETTINGS, "menu_netplay_settings") +MSG_HASH(MENU_ENUM_LABEL_NETPLAY_SPECTATE_PASSWORD, + "netplay_spectate_password") MSG_HASH(MENU_ENUM_LABEL_NETPLAY_SPECTATOR_MODE_ENABLE, "netplay_spectator_mode_enable") MSG_HASH(MENU_ENUM_LABEL_NETPLAY_TCP_UDP_PORT, diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index 1620d6f4a7..cce55e8447 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -1702,6 +1702,12 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) "The password for connecting to the netplay \n" "host. Used only in host mode."); break; + case MENU_ENUM_LABEL_NETPLAY_SPECTATE_PASSWORD: + snprintf(s, len, + "The password for connecting to the netplay \n" + "host with only spectator privileges. Used \n" + "only in host mode."); + break; case MENU_ENUM_LABEL_STDIN_CMD_ENABLE: snprintf(s, len, "Enable stdin command interface."); diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index dae1823cfd..af1e9544aa 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -924,6 +924,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_PASSWORD, "Server Password") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SETTINGS, "Netplay settings") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATE_PASSWORD, + "Server Spectate-Only Password") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATOR_MODE_ENABLE, "Netplay Spectator Enable") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_TCP_UDP_PORT, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index e19204bd26..048f67be9d 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4693,6 +4693,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_NETPLAY_PASSWORD, PARSE_ONLY_STRING, false) != -1) count++; + if (menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_NETPLAY_SPECTATE_PASSWORD, + PARSE_ONLY_STRING, false) != -1) + count++; if (menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_NETPLAY_DELAY_FRAMES, PARSE_ONLY_UINT, false) != -1) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index f897490a3d..d6cd6a53c4 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5591,6 +5591,20 @@ static bool setting_append_list( general_read_handler); settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT); + CONFIG_STRING( + list, list_info, + settings->netplay.spectate_password, + sizeof(settings->netplay.spectate_password), + MENU_ENUM_LABEL_NETPLAY_SPECTATE_PASSWORD, + MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATE_PASSWORD, + "", + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT); + CONFIG_UINT( list, list_info, &settings->netplay.delay_frames, diff --git a/msg_hash.h b/msg_hash.h index ca879df1ba..7793fd026c 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1004,6 +1004,7 @@ enum msg_hash_enums MENU_LABEL(SORT_SAVESTATES_ENABLE), MENU_LABEL(NETPLAY_IP_ADDRESS), MENU_LABEL(NETPLAY_PASSWORD), + MENU_LABEL(NETPLAY_SPECTATE_PASSWORD), MENU_LABEL(NETPLAY_MODE), MENU_LABEL(PERFCNT_ENABLE), MENU_LABEL(OVERLAY_SCALE),