Netplay / Qt: Added spectator option to join netplay session dialog.

This commit is contained in:
Jamie Meyer 2023-05-30 23:56:36 +02:00
parent 1bdeb7a507
commit 932f6f1b55
No known key found for this signature in database
GPG Key ID: BF30D71B2F1305C7
3 changed files with 30 additions and 6 deletions

View File

@ -159,6 +159,10 @@ static std::bitset<MAX_PLAYERS> s_reset_players;
static Common::Timer s_reset_start_time; static Common::Timer s_reset_start_time;
static Common::Timer s_last_host_connection_attempt; static Common::Timer s_last_host_connection_attempt;
// Spectators
static std::array<Peer, MAX_SPECTATORS> s_spectators;
static bool s_local_spectating;
/// GGPO /// GGPO
static std::string s_local_nickname; static std::string s_local_nickname;
static std::string s_local_session_password; static std::string s_local_session_password;

View File

@ -10,6 +10,9 @@ enum : s32
// Maximum number of emulated controllers. // Maximum number of emulated controllers.
MAX_PLAYERS = 2, MAX_PLAYERS = 2,
// Maximum number of spectators allowed to watch the session.
MAX_SPECTATORS = 4,
// Maximum netplay prediction frames // Maximum netplay prediction frames
MAX_ROLLBACK_FRAMES = 8, MAX_ROLLBACK_FRAMES = 8,

View File

@ -10,7 +10,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>480</width> <width>480</width>
<height>220</height> <height>226</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -145,6 +145,21 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="spectating">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Enable Spectator Mode</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
@ -153,6 +168,8 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
<resources> <resources>
<include location="resources/resources.qrc"/> <include location="resources/resources.qrc"/>