diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index 47ffee42f..595743d0d 100644 --- a/Subsurface/Properties/AssemblyInfo.cs +++ b/Subsurface/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.1.1")] -[assembly: AssemblyFileVersion("0.3.1.1")] +[assembly: AssemblyVersion("0.3.1.3")] +[assembly: AssemblyFileVersion("0.3.1.3")] diff --git a/Subsurface/Source/Items/Components/Holdable/Holdable.cs b/Subsurface/Source/Items/Components/Holdable/Holdable.cs index 2cb8b51b2..97770fc74 100644 --- a/Subsurface/Source/Items/Components/Holdable/Holdable.cs +++ b/Subsurface/Source/Items/Components/Holdable/Holdable.cs @@ -259,6 +259,8 @@ namespace Barotrauma.Items.Components { //prevRequiredItems = new List(requiredItems); + if (!attachable) return; + if (Attached) { Use(1.0f); diff --git a/Subsurface/Source/Networking/GameClient.cs b/Subsurface/Source/Networking/GameClient.cs index ac5709976..619822fb2 100644 --- a/Subsurface/Source/Networking/GameClient.cs +++ b/Subsurface/Source/Networking/GameClient.cs @@ -15,7 +15,7 @@ namespace Barotrauma.Networking private ReliableChannel reliableChannel; - private GUIButton endRoundButton; + private GUITickBox endRoundButton; private bool connected; @@ -37,8 +37,8 @@ namespace Barotrauma.Networking public GameClient(string newName) { - endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 170, 20, 150, 25), "End round", Alignment.TopLeft, GUI.Style, inGameHUD); - endRoundButton.OnClicked = EndRoundClicked; + endRoundButton = new GUITickBox(new Rectangle(GameMain.GraphicsWidth - 170, 20, 20, 20), "End round", Alignment.TopLeft, inGameHUD); + endRoundButton.OnSelected = ToggleEndRoundVote; endRoundButton.Visible = false; GameMain.DebugDraw = false; @@ -550,6 +550,8 @@ namespace Barotrauma.Networking { if (Character != null) Character.Remove(); + endRoundButton.Selected = false; + int seed = inc.ReadInt32(); string levelSeed = inc.ReadString(); @@ -732,17 +734,17 @@ namespace Barotrauma.Networking return false; } - public bool EndRoundClicked(GUIButton button, object userData) + public bool ToggleEndRoundVote(GUITickBox tickBox) { if (!gameStarted) return false; - if (!Voting.AllowEndVoting) + if (!Voting.AllowEndVoting || myCharacter==null) { - button.Visible = false; + tickBox.Visible = false; return false; } - Vote(VoteType.EndRound, true); + Vote(VoteType.EndRound, tickBox.Selected); return false; } diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 6bce006b0..3c9bef4e3 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -474,7 +474,8 @@ namespace Barotrauma.Networking case (byte)PacketTypes.Vote: Voting.RegisterVote(inc, ConnectedClients); - if (Voting.AllowEndVoting && + if (Voting.AllowEndVoting && EndVoteMax > 0 && + ((float)EndVoteCount / (float)EndVoteMax) >= EndVoteRequiredRatio) { EndButtonHit(null,null); diff --git a/Subsurface/Source/Networking/NetworkMember.cs b/Subsurface/Source/Networking/NetworkMember.cs index 767a9eaaa..4690236a1 100644 --- a/Subsurface/Source/Networking/NetworkMember.cs +++ b/Subsurface/Source/Networking/NetworkMember.cs @@ -253,7 +253,8 @@ namespace Barotrauma.Networking if (EndVoteCount > 0) { - GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 150.0f, 40), "Votes: " + EndVoteCount + "/" + EndVoteMax, Color.White); + GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 140.0f, 40), + "Votes (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont); } } diff --git a/Subsurface/Source/Screens/NetLobbyScreen.cs b/Subsurface/Source/Screens/NetLobbyScreen.cs index 133383100..347631c86 100644 --- a/Subsurface/Source/Screens/NetLobbyScreen.cs +++ b/Subsurface/Source/Screens/NetLobbyScreen.cs @@ -375,6 +375,9 @@ namespace Barotrauma UpdatePlayerFrame(GameMain.Client.CharacterInfo); } + GameMain.NetworkMember.EndVoteCount = 0; + GameMain.NetworkMember.EndVoteMax = 1; + base.Select(); } diff --git a/Subsurface/Source/Screens/NetLobbyVoting.cs b/Subsurface/Source/Screens/NetLobbyVoting.cs index c4b5a53f6..d69bd5f92 100644 --- a/Subsurface/Source/Screens/NetLobbyVoting.cs +++ b/Subsurface/Source/Screens/NetLobbyVoting.cs @@ -222,8 +222,8 @@ namespace Barotrauma msg.Write(AllowEndVoting); if (AllowEndVoting) { - msg.Write((byte)voters.Count); msg.Write((byte)voters.Count(v => v.GetVote(VoteType.EndRound))); + msg.Write((byte)voters.Count); } } diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 811654252..4b18426f9 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,23 @@ +--------------------------------------------------------------------------------------------------------- +v0.3.1.3 +--------------------------------------------------------------------------------------------------------- + +- round end votes can be toggled off +- less confusing way of displaying the number of votes (yes/no instead of yes/number of voters) + +--------------------------------------------------------------------------------------------------------- +v0.3.1.2 +--------------------------------------------------------------------------------------------------------- + +- players can vote to end a round in multiplayer +- fixed fabricator syncing +- fixed hulls being invisible in the editor +- spectators can only speak to dead players +- minor changes to the map generation algorithm: there's now more variety in the cavern shapes +- added a new type of railgun shell +- diving suits wont protect from the water pressure in the abyss anymore +- added some spare buttons to Vellamo + --------------------------------------------------------------------------------------------------------- v0.3.1.1 --------------------------------------------------------------------------------------------------------- diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 8bc3bace6..bf165a2e7 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ