mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-23 02:12:14 +00:00
fix bug with multiplayer ui
This commit is contained in:
parent
e43d47007e
commit
41da0b2500
2 changed files with 19 additions and 0 deletions
1
ShiftOS.WinForms/Applications/Pong.Designer.cs
generated
1
ShiftOS.WinForms/Applications/Pong.Designer.cs
generated
|
@ -193,6 +193,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.pnlmultiplayerhandshake.Name = "pnlmultiplayerhandshake";
|
||||
this.pnlmultiplayerhandshake.Size = new System.Drawing.Size(396, 231);
|
||||
this.pnlmultiplayerhandshake.TabIndex = 15;
|
||||
this.pnlmultiplayerhandshake.Visible = false;
|
||||
//
|
||||
// lvotherplayers
|
||||
//
|
||||
|
|
|
@ -374,6 +374,14 @@ namespace ShiftOS.WinForms.Applications
|
|||
LeaderX = pt.X;
|
||||
LeaderY = pt.Y;
|
||||
}
|
||||
else if(msg.Name == "pong_mp_left")
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
AppearanceManager.Close(this);
|
||||
}));
|
||||
Infobox.Show("Opponent has closed Pong.", "The opponent has closed Pong, therefore the connection between you two has dropped.");
|
||||
}
|
||||
else if (msg.Name == "pong_mp_youlose")
|
||||
{
|
||||
LoseMP();
|
||||
|
@ -408,6 +416,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
else if (msg.Name == "pong_handshake_chosen")
|
||||
{
|
||||
IsLeader = false;
|
||||
LeaveMatchmake();
|
||||
OpponentGUID = msg.Contents;
|
||||
YouGUID = ServerManager.thisGuid.ToString();
|
||||
SendFollowerGUID();
|
||||
|
@ -984,6 +993,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
pnlfinalstats.Hide();
|
||||
CenterPanels();
|
||||
lblbeatai.Hide();
|
||||
ServerManager.MessageReceived += this.ServerMessageReceivedHandler;
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
|
@ -997,6 +1007,14 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public bool OnUnload()
|
||||
{
|
||||
if(IsMultiplayerSession == true)
|
||||
{
|
||||
if(!string.IsNullOrWhiteSpace(OpponentGUID))
|
||||
ServerManager.Forward(OpponentGUID, "pong_mp_left", null);
|
||||
}
|
||||
LeaveMatchmake();
|
||||
ServerManager.MessageReceived -= this.ServerMessageReceivedHandler;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue