Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pm window not being initialized for multiplayer game lobby #603

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DXMainClient/DXGUI/Multiplayer/GameLobby/CnCNetGameLobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public CnCNetGameLobby(
GameCollection gameCollection,
CnCNetUserData cncnetUserData,
MapLoader mapLoader,
DiscordHandler discordHandler
) : base(windowManager, "MultiplayerGameLobby", topBar, mapLoader, discordHandler)
DiscordHandler discordHandler,
PrivateMessagingWindow pmWindow
) : base(windowManager, "MultiplayerGameLobby", topBar, mapLoader, discordHandler, pmWindow)
{
this.connectionManager = connectionManager;
localGame = ClientConfiguration.Instance.LocalGame;
Expand Down
5 changes: 3 additions & 2 deletions DXMainClient/DXGUI/Multiplayer/GameLobby/LANGameLobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Net.Sockets;
using System.Text;
using System.Threading;
using DTAClient.DXGUI.Multiplayer.CnCNet;


namespace DTAClient.DXGUI.Multiplayer.GameLobby
Expand All @@ -43,8 +44,8 @@ public class LANGameLobby : MultiplayerGameLobby
public const string PING = "PING";

public LANGameLobby(WindowManager windowManager, string iniName,
TopBar topBar, LANColor[] chatColors, MapLoader mapLoader, DiscordHandler discordHandler) :
base(windowManager, iniName, topBar, mapLoader, discordHandler)
TopBar topBar, LANColor[] chatColors, MapLoader mapLoader, DiscordHandler discordHandler, PrivateMessagingWindow pmWindow) :
base(windowManager, iniName, topBar, mapLoader, discordHandler, pmWindow)
{
this.chatColors = chatColors;
encoding = Encoding.UTF8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using DTAClient.Domain;
using Microsoft.Xna.Framework.Graphics;
using ClientCore.Extensions;
using DTAClient.DXGUI.Multiplayer.CnCNet;

namespace DTAClient.DXGUI.Multiplayer.GameLobby
{
Expand All @@ -27,7 +28,7 @@ public abstract class MultiplayerGameLobby : GameLobbyBase, ISwitchable
private const int MAX_DIE_SIDES = 100;

public MultiplayerGameLobby(WindowManager windowManager, string iniName,
TopBar topBar, MapLoader mapLoader, DiscordHandler discordHandler)
TopBar topBar, MapLoader mapLoader, DiscordHandler discordHandler, PrivateMessagingWindow pmWindow)
: base(windowManager, iniName, mapLoader, true, discordHandler)
{
TopBar = topBar;
Expand Down
4 changes: 3 additions & 1 deletion DXMainClient/DXGUI/Multiplayer/LANLobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using SixLabors.ImageSharp;
using Color = Microsoft.Xna.Framework.Color;
using Rectangle = Microsoft.Xna.Framework.Rectangle;
using DTAClient.DXGUI.Multiplayer.CnCNet;

namespace DTAClient.DXGUI.Multiplayer
{
Expand Down Expand Up @@ -94,6 +95,7 @@
MapLoader mapLoader;

DiscordHandler discordHandler;
PrivateMessagingWindow pmWindow;

Check warning on line 98 in DXMainClient/DXGUI/Multiplayer/LANLobby.cs

View workflow job for this annotation

GitHub Actions / build-clients (TS)

Field 'LANLobby.pmWindow' is never assigned to, and will always have its default value null

Check warning on line 98 in DXMainClient/DXGUI/Multiplayer/LANLobby.cs

View workflow job for this annotation

GitHub Actions / build-clients (YR)

Field 'LANLobby.pmWindow' is never assigned to, and will always have its default value null

bool initSuccess = false;

Expand Down Expand Up @@ -237,7 +239,7 @@
gameCreationPanel.SetPositionAndSize();

lanGameLobby = new LANGameLobby(WindowManager, "MultiplayerGameLobby",
null, chatColors, mapLoader, discordHandler);
null, chatColors, mapLoader, discordHandler, pmWindow);
DarkeningPanel.AddAndInitializeWithControl(WindowManager, lanGameLobby);
lanGameLobby.Disable();

Expand Down
Loading