@@ -139,6 +139,7 @@ void NetPlayDialog::CreateMainLayout()
139139 m_player_buffer_size_box = new QSpinBox;
140140 m_player_buffer_label = new QLabel (tr (" Player Buffer:" ));
141141 m_quit_button = new QPushButton (tr (" Quit" ));
142+ m_is_spectator = new QCheckBox (tr (" Spectator" ));
142143 m_brawlmusic_off = new QCheckBox (tr (" Client Side Music Off" ));
143144 m_splitter = new QSplitter (Qt::Horizontal);
144145 m_menu_bar = new QMenuBar (this );
@@ -266,8 +267,9 @@ void NetPlayDialog::CreateMainLayout()
266267 options_widget->addWidget (m_minimum_buffer_size_box, 0 , 2 , Qt::AlignVCenter);
267268 options_widget->addWidget (m_player_buffer_label, 0 , 3 , Qt::AlignVCenter);
268269 options_widget->addWidget (m_player_buffer_size_box, 0 , 4 , Qt::AlignVCenter);
269- options_widget->addWidget (m_brawlmusic_off, 0 , 6 , Qt::AlignVCenter);
270- options_widget->addWidget (m_quit_button, 0 , 7 , Qt::AlignVCenter | Qt::AlignRight);
270+ options_widget->addWidget (m_is_spectator, 0 , 6 , Qt::AlignVCenter);
271+ options_widget->addWidget (m_brawlmusic_off, 0 , 7 , Qt::AlignVCenter);
272+ options_widget->addWidget (m_quit_button, 0 , 8 , Qt::AlignVCenter | Qt::AlignRight);
271273 options_widget->setColumnStretch (5 , 1000 );
272274
273275 m_main_layout->addLayout (options_widget, 2 , 0 , 1 , -1 , Qt::AlignRight);
@@ -461,6 +463,14 @@ void NetPlayDialog::SendMessage(const std::string& msg)
461463 " " );
462464}
463465
466+ bool NetPlayDialog::IsSpectator ()
467+ {
468+ std::optional<bool > is_spectator = RunOnObject (m_is_spectator, &QCheckBox::isChecked);
469+ if (is_spectator)
470+ return *is_spectator;
471+ return false ;
472+ }
473+
464474bool NetPlayDialog::IsMusicOff ()
465475{
466476 std::optional<bool > brawlmusic_off = RunOnObject (m_brawlmusic_off, &QCheckBox::isChecked);
@@ -903,6 +913,7 @@ void NetPlayDialog::SetOptionsEnabled(bool enabled)
903913 m_host_input_authority_action->setEnabled (enabled);
904914 m_golf_mode_action->setEnabled (enabled);
905915 m_fixed_delay_action->setEnabled (enabled);
916+ m_is_spectator->setEnabled (enabled);
906917 m_brawlmusic_off->setEnabled (enabled);
907918 }
908919
@@ -1190,6 +1201,7 @@ void NetPlayDialog::LoadSettings()
11901201 const bool strict_settings_sync = Config::Get (Config::NETPLAY_STRICT_SETTINGS_SYNC);
11911202 const bool golf_mode_overlay = Config::Get (Config::NETPLAY_GOLF_MODE_OVERLAY);
11921203 const bool hide_remote_gbas = Config::Get (Config::NETPLAY_HIDE_REMOTE_GBAS);
1204+ const bool is_spectator = Config::Get (Config::NETPLAY_IS_SPECTATOR);
11931205 const bool brawlmusic_off = Config::Get (Config::NETPLAY_BRAWL_MUSIC_OFF);
11941206
11951207 m_minimum_buffer_size_box->setValue (minimum_buffer_size);
@@ -1209,6 +1221,7 @@ void NetPlayDialog::LoadSettings()
12091221 m_golf_mode_overlay_action->setChecked (golf_mode_overlay);
12101222 m_hide_remote_gbas_action->setChecked (hide_remote_gbas);
12111223
1224+ m_is_spectator->setChecked (is_spectator);
12121225 m_brawlmusic_off->setChecked (brawlmusic_off);
12131226
12141227 const std::string network_mode = Config::Get (Config::NETPLAY_NETWORK_MODE);
@@ -1253,6 +1266,7 @@ void NetPlayDialog::SaveSettings()
12531266 Config::SetBase (Config::NETPLAY_STRICT_SETTINGS_SYNC, m_strict_settings_sync_action->isChecked ());
12541267 Config::SetBase (Config::NETPLAY_GOLF_MODE_OVERLAY, m_golf_mode_overlay_action->isChecked ());
12551268 Config::SetBase (Config::NETPLAY_HIDE_REMOTE_GBAS, m_hide_remote_gbas_action->isChecked ());
1269+ Config::SetBase (Config::NETPLAY_IS_SPECTATOR, m_is_spectator->isChecked ());
12561270 Config::SetBase (Config::NETPLAY_BRAWL_MUSIC_OFF, m_brawlmusic_off->isChecked ());
12571271
12581272 std::string network_mode;
0 commit comments