Skip to content

Commit

Permalink
Fix pm window not being initialized for multiplayer game lobby
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBartlett committed Jan 2, 2025
1 parent 42fe343 commit da8d2a8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
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
1 change: 1 addition & 0 deletions DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ DiscordHandler discordHandler
public List<GameLobbyDropDown> DropDowns = new List<GameLobbyDropDown>();

protected DiscordHandler discordHandler;
protected PrivateMessagingWindow pmWindow;

protected MapLoader MapLoader;
/// <summary>
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 @@ DiscordHandler discordHandler
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 (Ares)

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 @@ public override void Initialize()
gameCreationPanel.SetPositionAndSize();

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

Expand Down

0 comments on commit da8d2a8

Please sign in to comment.