Fixed round ending tickbox not being visible client-side if the client is not controlling character (despite servers now allowing votes from players who've spawned at least once during the round). Closes #500
This commit is contained in:
@@ -188,6 +188,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
controlled = this;
|
controlled = this;
|
||||||
IsRemotePlayer = false;
|
IsRemotePlayer = false;
|
||||||
|
GameMain.Client.HasSpawned = true;
|
||||||
GameMain.Client.Character = this;
|
GameMain.Client.Character = this;
|
||||||
GameMain.LightManager.LosEnabled = true;
|
GameMain.LightManager.LosEnabled = true;
|
||||||
}
|
}
|
||||||
@@ -286,6 +287,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (GameMain.Client.ID == ownerId)
|
if (GameMain.Client.ID == ownerId)
|
||||||
{
|
{
|
||||||
|
GameMain.Client.HasSpawned = true;
|
||||||
GameMain.Client.Character = character;
|
GameMain.Client.Character = character;
|
||||||
Controlled = character;
|
Controlled = character;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
private FileReceiver fileReceiver;
|
private FileReceiver fileReceiver;
|
||||||
|
|
||||||
|
//has the client been given a character to control this round
|
||||||
|
public bool HasSpawned;
|
||||||
|
|
||||||
public byte ID
|
public byte ID
|
||||||
{
|
{
|
||||||
get { return myID; }
|
get { return myID; }
|
||||||
@@ -480,7 +483,7 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
if (gameStarted && Screen.Selected == GameMain.GameScreen)
|
if (gameStarted && Screen.Selected == GameMain.GameScreen)
|
||||||
{
|
{
|
||||||
endVoteTickBox.Visible = Voting.AllowEndVoting && myCharacter != null;
|
endVoteTickBox.Visible = Voting.AllowEndVoting && HasSpawned;
|
||||||
|
|
||||||
if (respawnManager != null)
|
if (respawnManager != null)
|
||||||
{
|
{
|
||||||
@@ -666,6 +669,7 @@ namespace Barotrauma.Networking
|
|||||||
private IEnumerable<object> StartGame(NetIncomingMessage inc)
|
private IEnumerable<object> StartGame(NetIncomingMessage inc)
|
||||||
{
|
{
|
||||||
if (Character != null) Character.Remove();
|
if (Character != null) Character.Remove();
|
||||||
|
HasSpawned = false;
|
||||||
|
|
||||||
GameMain.LightManager.LightingEnabled = true;
|
GameMain.LightManager.LightingEnabled = true;
|
||||||
|
|
||||||
@@ -1281,6 +1285,23 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
base.Draw(spriteBatch);
|
base.Draw(spriteBatch);
|
||||||
|
|
||||||
|
if (Screen.Selected == GameMain.GameScreen && !GUI.DisableHUD)
|
||||||
|
{
|
||||||
|
if (EndVoteCount > 0)
|
||||||
|
{
|
||||||
|
if (!HasSpawned)
|
||||||
|
{
|
||||||
|
GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 180.0f, 40),
|
||||||
|
"Votes to end the round (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 140.0f, 40),
|
||||||
|
"Votes (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fileReceiver != null && fileReceiver.ActiveTransfers.Count > 0)
|
if (fileReceiver != null && fileReceiver.ActiveTransfers.Count > 0)
|
||||||
{
|
{
|
||||||
Vector2 pos = new Vector2(GameMain.NetLobbyScreen.InfoFrame.Rect.X, GameMain.GraphicsHeight - 35);
|
Vector2 pos = new Vector2(GameMain.NetLobbyScreen.InfoFrame.Rect.X, GameMain.GraphicsHeight - 35);
|
||||||
@@ -1564,14 +1585,13 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
if (!gameStarted) return false;
|
if (!gameStarted) return false;
|
||||||
|
|
||||||
if (!Voting.AllowEndVoting || myCharacter==null)
|
if (!Voting.AllowEndVoting || !HasSpawned)
|
||||||
{
|
{
|
||||||
tickBox.Visible = false;
|
tickBox.Visible = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vote(VoteType.EndRound, tickBox.Selected);
|
Vote(VoteType.EndRound, tickBox.Selected);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,15 @@ namespace Barotrauma.Networking
|
|||||||
log.LogFrame.Draw(spriteBatch);
|
log.LogFrame.Draw(spriteBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Screen.Selected == GameMain.GameScreen && !GUI.DisableHUD)
|
||||||
|
{
|
||||||
|
if (EndVoteCount > 0)
|
||||||
|
{
|
||||||
|
GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 180.0f, 40),
|
||||||
|
"Votes to end the round (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!ShowNetStats) return;
|
if (!ShowNetStats) return;
|
||||||
|
|
||||||
GUI.Font.DrawString(spriteBatch, "Unique Events: " + entityEventManager.UniqueEvents.Count, new Vector2(10, 50), Color.White);
|
GUI.Font.DrawString(spriteBatch, "Unique Events: " + entityEventManager.UniqueEvents.Count, new Vector2(10, 50), Color.White);
|
||||||
|
|||||||
@@ -119,20 +119,6 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
inGameHUD.Draw(spriteBatch);
|
inGameHUD.Draw(spriteBatch);
|
||||||
|
|
||||||
if (EndVoteCount > 0)
|
|
||||||
{
|
|
||||||
if (GameMain.NetworkMember.myCharacter == null)
|
|
||||||
{
|
|
||||||
GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 180.0f, 40),
|
|
||||||
"Votes to end the round (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 140.0f, 40),
|
|
||||||
"Votes (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (respawnManager != null)
|
if (respawnManager != null)
|
||||||
{
|
{
|
||||||
string respawnInfo = "";
|
string respawnInfo = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user