diff --git a/Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs b/Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs index 0a96dcb19..9e091e34c 100644 --- a/Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs +++ b/Barotrauma/BarotraumaClient/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.8.9.1")] -[assembly: AssemblyFileVersion("0.8.9.1")] +[assembly: AssemblyVersion("0.8.9.2")] +[assembly: AssemblyFileVersion("0.8.9.2")] diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs index 4f0334f2d..e3e003f2f 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs @@ -481,6 +481,7 @@ namespace Barotrauma var toggleWrongOrderBtn = new GUIButton(new RectTransform(new Point((int)(30 * GUI.Scale), wrongOrderList.Rect.Height), wrongOrderList.Content.RectTransform), "", style: "UIToggleButton") { + UserData = "togglewrongorder", CanBeFocused = false }; @@ -490,9 +491,12 @@ namespace Barotrauma wrongOrderList.RectTransform.SetAsLastChild(); new GUIFrame(new RectTransform(new Point( - wrongOrderList.Rect.Width - toggleWrongOrderBtn.Rect.Width - wrongOrderList.Spacing * 2, - wrongOrderList.Rect.Height), wrongOrderList.Content.RectTransform), - style: null); + wrongOrderList.Rect.Width - toggleWrongOrderBtn.Rect.Width - wrongOrderList.Spacing * 2, + wrongOrderList.Rect.Height), wrongOrderList.Content.RectTransform), + style: null) + { + CanBeFocused = false + }; //scale to fit the content orderButtonFrame.RectTransform.NonScaledSize = new Point( @@ -1033,6 +1037,13 @@ namespace Barotrauma bool toggleOpen = characterListBox.Content.Rect.Contains(PlayerInput.MousePosition) && hoverRect.Contains(PlayerInput.MousePosition); + wrongOrderList.CanBeFocused = toggleOpen; + wrongOrderList.Content.CanBeFocused = toggleOpen; + var wrongOrderBtn = wrongOrderList.GetChildByUserData("togglewrongorderbtn"); + if (wrongOrderBtn != null) + { + wrongOrderBtn.CanBeFocused = toggleOpen; + } //order target frame open on this character, check if we're giving any of the orders in wrongOrderList if (!toggleOpen && orderTargetFrame != null && orderTargetFrame.UserData == child.UserData) diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs index 86b0a38d1..a9973fce8 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs @@ -179,9 +179,14 @@ namespace Barotrauma.Items.Components if (item.ParentInventory != inputContainer.Inventory && IsItemValidIngredient(item, requiredItem)) { int availableSlotIndex = Array.IndexOf(item.ParentInventory.Items, item); - if (item.ParentInventory.slots[availableSlotIndex].HighlightTimer <= 0.0f) + //slots are null if the inventory has never been displayed + //(linked item, but the UI is not set to be displayed at the same time) + if (item.ParentInventory.slots != null) { - item.ParentInventory.slots[availableSlotIndex].ShowBorderHighlight(Color.LightGreen * 0.5f, 0.5f, 0.5f); + if (item.ParentInventory.slots[availableSlotIndex].HighlightTimer <= 0.0f) + { + item.ParentInventory.slots[availableSlotIndex].ShowBorderHighlight(Color.LightGreen * 0.5f, 0.5f, 0.5f); + } } } } diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Sonar.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Sonar.cs index 426b55a0b..7f1948ff5 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Sonar.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Sonar.cs @@ -618,6 +618,7 @@ namespace Barotrauma.Items.Components float worldPrevPingRadiusSqr = worldPrevPingRadius * worldPrevPingRadius; disruptedDirections.Clear(); + if (Level.Loaded == null) { return; } foreach (LevelObject levelObject in Level.Loaded.LevelObjectManager.GetAllObjects(pingSource, range * pingState)) { diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameServer.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameServer.cs index 63530bc92..9bb8cf42b 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/GameServer.cs @@ -207,6 +207,10 @@ namespace Barotrauma.Networking void InitUPnP() { server.UPnP.ForwardPort(NetPeerConfiguration.Port, "barotrauma"); + if (Steam.SteamManager.USE_STEAM) + { + server.UPnP.ForwardPort(QueryPort, "barotrauma"); + } upnpBox = new GUIMessageBox(TextManager.Get("PleaseWaitUPnP"), TextManager.Get("AttemptingUPnP"), new string[] { TextManager.Get("Cancel") }); upnpBox.Buttons[0].OnClicked = upnpBox.Close; diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameServerSettings.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameServerSettings.cs index 8d4111c34..145bc0b83 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/GameServerSettings.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/GameServerSettings.cs @@ -546,11 +546,14 @@ namespace Barotrauma.Networking private bool SwitchSubSelection(GUITickBox tickBox) { - subSelectionMode = (SelectionMode)tickBox.UserData; - Voting.AllowSubVoting = subSelectionMode == SelectionMode.Vote; - if (subSelectionMode == SelectionMode.Random) + if (tickBox.Selected) { - GameMain.NetLobbyScreen.SubList.Select(Rand.Range(0, GameMain.NetLobbyScreen.SubList.CountChildren)); + subSelectionMode = (SelectionMode)tickBox.UserData; + Voting.AllowSubVoting = subSelectionMode == SelectionMode.Vote; + if (subSelectionMode == SelectionMode.Random) + { + GameMain.NetLobbyScreen.SubList.Select(Rand.Range(0, GameMain.NetLobbyScreen.SubList.CountChildren)); + } } return true; } @@ -569,11 +572,14 @@ namespace Barotrauma.Networking private bool SwitchModeSelection(GUITickBox tickBox) { - modeSelectionMode = (SelectionMode)tickBox.UserData; - Voting.AllowModeVoting = modeSelectionMode == SelectionMode.Vote; - if (modeSelectionMode == SelectionMode.Random) + if (tickBox.Selected) { - GameMain.NetLobbyScreen.ModeList.Select(Rand.Range(0, GameMain.NetLobbyScreen.ModeList.CountChildren)); + modeSelectionMode = (SelectionMode)tickBox.UserData; + Voting.AllowModeVoting = modeSelectionMode == SelectionMode.Vote; + if (modeSelectionMode == SelectionMode.Random) + { + GameMain.NetLobbyScreen.ModeList.Select(Rand.Range(0, GameMain.NetLobbyScreen.ModeList.CountChildren)); + } } return true; } diff --git a/Barotrauma/BarotraumaClient/Source/Screens/MainMenuScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/MainMenuScreen.cs index e8a4b4163..0525f8ee8 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/MainMenuScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/MainMenuScreen.cs @@ -109,12 +109,12 @@ namespace Barotrauma var minButtonSize = new Point(120, 20); var maxButtonSize = new Point(240, 40); - new GUIButton(new RectTransform(new Vector2(1.0f, 0.1f), buttonsParent.RectTransform), TextManager.Get("TutorialButton"), style: "GUIButtonLarge") + /*new GUIButton(new RectTransform(new Vector2(1.0f, 0.1f), buttonsParent.RectTransform), TextManager.Get("TutorialButton"), style: "GUIButtonLarge") { UserData = Tab.Tutorials, OnClicked = SelectTab, Enabled = false - }; + };*/ new GUIFrame(new RectTransform(new Vector2(1.0f, 0.05f), buttonsParent.RectTransform), style: null); //spacing diff --git a/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs index 17e5f168a..9af609660 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs @@ -1857,7 +1857,10 @@ namespace Barotrauma if (!CharacterMode && !WiringMode) { - if (MapEntityPrefab.Selected != null) MapEntityPrefab.Selected.UpdatePlacing(cam); + if (MapEntityPrefab.Selected != null && GUI.MouseOn == null) + { + MapEntityPrefab.Selected.UpdatePlacing(cam); + } MapEntity.UpdateEditor(cam); } @@ -1951,9 +1954,9 @@ namespace Barotrauma Submarine.Draw(spriteBatch, true); - if (!CharacterMode && !WiringMode) + if (!CharacterMode && !WiringMode && GUI.MouseOn == null) { - if (MapEntityPrefab.Selected != null) MapEntityPrefab.Selected.DrawPlacing(spriteBatch,cam); + MapEntityPrefab.Selected?.DrawPlacing(spriteBatch, cam); MapEntity.DrawSelecting(spriteBatch, cam); } spriteBatch.End(); diff --git a/Barotrauma/BarotraumaServer/Properties/AssemblyInfo.cs b/Barotrauma/BarotraumaServer/Properties/AssemblyInfo.cs index 30326e6af..347b45346 100644 --- a/Barotrauma/BarotraumaServer/Properties/AssemblyInfo.cs +++ b/Barotrauma/BarotraumaServer/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.8.9.1")] -[assembly: AssemblyFileVersion("0.8.9.1")] +[assembly: AssemblyVersion("0.8.9.2")] +[assembly: AssemblyFileVersion("0.8.9.2")] diff --git a/Barotrauma/BarotraumaServer/Source/Networking/GameServer.cs b/Barotrauma/BarotraumaServer/Source/Networking/GameServer.cs index a4bfdf478..ddd60b311 100644 --- a/Barotrauma/BarotraumaServer/Source/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaServer/Source/Networking/GameServer.cs @@ -12,6 +12,10 @@ namespace Barotrauma.Networking void InitUPnP() { server.UPnP.ForwardPort(NetPeerConfiguration.Port, "barotrauma"); + if (Steam.SteamManager.USE_STEAM) + { + server.UPnP.ForwardPort(QueryPort, "barotrauma"); + } } bool DiscoveringUPnP() diff --git a/Barotrauma/BarotraumaShared/BarotraumaShared.projitems b/Barotrauma/BarotraumaShared/BarotraumaShared.projitems index b0e5281a6..30e1573b2 100644 --- a/Barotrauma/BarotraumaShared/BarotraumaShared.projitems +++ b/Barotrauma/BarotraumaShared/BarotraumaShared.projitems @@ -93,7 +93,9 @@ PreserveNewest - + + PreserveNewest + PreserveNewest diff --git a/Barotrauma/BarotraumaShared/Source/Map/Gap.cs b/Barotrauma/BarotraumaShared/Source/Map/Gap.cs index 2fc20bc6f..46904a5d0 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Gap.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Gap.cs @@ -12,6 +12,8 @@ namespace Barotrauma { public static List GapList = new List(); + const float MaxFlowForce = 500.0f; + public static bool ShowGaps = true; const float OutsideColliderRaycastInterval = 0.1f; @@ -259,6 +261,8 @@ namespace Barotrauma UpdateRoomToRoom(deltaTime); } + flowForce.X = MathHelper.Clamp(flowForce.X, -MaxFlowForce, MaxFlowForce); + flowForce.Y = MathHelper.Clamp(flowForce.Y, -MaxFlowForce, MaxFlowForce); lerpedFlowForce = Vector2.Lerp(lerpedFlowForce, flowForce, deltaTime * 5.0f); EmitParticles(deltaTime); @@ -463,7 +467,7 @@ namespace Barotrauma flowForce = new Vector2( hull1.WaveY[hull1.GetWaveIndex(rect.X)] - hull1.WaveY[hull1.GetWaveIndex(rect.Right)], - Math.Max(Math.Max((hull2.Pressure + subOffset.Y - hull1.Pressure) * 10.0f, -200.0f), -delta)); + MathHelper.Clamp(-delta, -200.0f, 0.0f)); if (hull2.WaterVolume > hull2.Volume) { diff --git a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs index 632c28b08..0f5496e93 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs @@ -594,7 +594,10 @@ namespace Barotrauma { FireSources.Remove(fire); - if (GameMain.Server != null) GameMain.Server.CreateEntityEvent(this); + if (GameMain.Server != null && !Removed && !IdFreed) + { + GameMain.Server.CreateEntityEvent(this); + } } public IEnumerable GetConnectedHulls(int? searchDepth) diff --git a/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs b/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs index 34f0bb170..991b28baf 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs @@ -1480,6 +1480,12 @@ namespace Barotrauma } for (int i = 0; i < 2; i++) { + //no outposts at either side of the level when there's more than one main sub (combat missions) + if (Submarine.MainSubs.Length > 1 && Submarine.MainSubs[0] != null && Submarine.MainSubs[1] != null) + { + continue; + } + //only create a starting outpost in campaign mode if (GameMain.GameSession?.GameMode as CampaignMode == null && ((i == 0) == !Mirrored)) { diff --git a/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs b/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs index f607b131f..20c896c68 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs @@ -61,7 +61,7 @@ namespace Barotrauma public static readonly Vector2 GridSize = new Vector2(16.0f, 16.0f); - public static Submarine[] MainSubs = new Submarine[2]; + public static readonly Submarine[] MainSubs = new Submarine[2]; public static Submarine MainSub { get { return MainSubs[0]; } diff --git a/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs b/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs index 35b9e5dc6..34905daec 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/SubmarineBody.cs @@ -113,7 +113,7 @@ namespace Barotrauma ConvertUnits.ToSimUnits(wall.BodyHeight), 50.0f, -wall.BodyRotation, - ConvertUnits.ToSimUnits(new Vector2(rect.X + rect.Width / 2, rect.Y - rect.Height / 2)), + ConvertUnits.ToSimUnits(new Vector2(rect.X + rect.Width / 2, rect.Y - rect.Height / 2) + wall.BodyOffset), farseerBody, this); minExtents.X = Math.Min(rect.X, minExtents.X); diff --git a/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs b/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs index 153c5238c..6da0e8f8f 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs @@ -234,18 +234,22 @@ namespace Barotrauma.Networking } float similarity = 0.0f; - for (int i = 0; i < c.LastSentChatMessages.Count; i++) + //don't do message similarity checks on order messages + if (orderMsg == null) { - float closeFactor = 1.0f / (c.LastSentChatMessages.Count - i); - if (string.IsNullOrEmpty(txt)) + for (int i = 0; i < c.LastSentChatMessages.Count; i++) { - similarity += closeFactor; + float closeFactor = 1.0f / (c.LastSentChatMessages.Count - i); + if (string.IsNullOrEmpty(txt)) + { + similarity += closeFactor; + } + else + { + int levenshteinDist = ToolBox.LevenshteinDistance(txt, c.LastSentChatMessages[i]); + similarity += Math.Max((txt.Length - levenshteinDist) / (float)txt.Length * closeFactor, 0.0f); + } } - else - { - int levenshteinDist = ToolBox.LevenshteinDistance(txt, c.LastSentChatMessages[i]); - similarity += Math.Max((txt.Length - levenshteinDist) / (float)txt.Length * closeFactor, 0.0f); - } } if (similarity + c.ChatSpamSpeed > 5.0f) diff --git a/Barotrauma/BarotraumaShared/Source/Utils/ToolBox.cs b/Barotrauma/BarotraumaShared/Source/Utils/ToolBox.cs index 195f16154..0c1901752 100644 --- a/Barotrauma/BarotraumaShared/Source/Utils/ToolBox.cs +++ b/Barotrauma/BarotraumaShared/Source/Utils/ToolBox.cs @@ -38,6 +38,12 @@ namespace Barotrauma { public static bool IsProperFilenameCase(string filename) { + //File case only matters on Linux where the filesystem is case-sensitive, so we don't need these errors in release builds. + //It also seems Path.GetFullPath may return a path with an incorrect case on Windows when the case of any of the game's + //parent folders have been changed. +#if !DEBUG && !LINUX + return true; +#endif char[] delimiters = { '/', '\\' }; string[] subDirs = filename.Split(delimiters); string originalFilename = filename; diff --git a/Barotrauma/BarotraumaShared/Submarines/Humpback.sub b/Barotrauma/BarotraumaShared/Submarines/Humpback.sub index 0b5a74d41..433eff333 100644 Binary files a/Barotrauma/BarotraumaShared/Submarines/Humpback.sub and b/Barotrauma/BarotraumaShared/Submarines/Humpback.sub differ diff --git a/Barotrauma/BarotraumaShared/Submarines/Orca.sub b/Barotrauma/BarotraumaShared/Submarines/Orca.sub index 56fbfe696..47a340b6f 100644 Binary files a/Barotrauma/BarotraumaShared/Submarines/Orca.sub and b/Barotrauma/BarotraumaShared/Submarines/Orca.sub differ diff --git a/Barotrauma/BarotraumaShared/Submarines/Typhon.sub b/Barotrauma/BarotraumaShared/Submarines/Typhon.sub index 1ee23a547..f8cc03e39 100644 Binary files a/Barotrauma/BarotraumaShared/Submarines/Typhon.sub and b/Barotrauma/BarotraumaShared/Submarines/Typhon.sub differ diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt index 965585ae1..06e3f1c6c 100644 --- a/Barotrauma/BarotraumaShared/changelog.txt +++ b/Barotrauma/BarotraumaShared/changelog.txt @@ -1,3 +1,33 @@ +--------------------------------------------------------------------------------------------------------- +v0.8.9.2 +--------------------------------------------------------------------------------------------------------- + +- Fixed "incorrect filename case" errors. +- Fixed crew UI occasionally overlapping with device interfaces (such as the "passive sonar" checkbox). +- Fixed second submarine overlapping with the outpost at the end of the level in combat missions. +- Steam query port can be automatically forwarded using UPnP if your router supports UPnP. +- Fixed water currents inside the sub occasionally being way too strong to break free from. +- Fixed rewards mentioned in the mission descriptions not matching the actual reward of the mission. +- Fixed "can't create an entity event for Hull - the entity has been removed" errors when removing hulls +with fires inside them. +- Fixed submarine/mode selection tickboxes in the server settings menu. +- Fixed crashing when attempting to select an item in Humpback's fabricator interface. +- Fixed crashing when attempting to use active sonar in the submarine editor. +- Fixed the husk appendage not appearing on huskified humans. +- Fixed order/report messages being flagged as spam way too easily, causing frequent spam kicks. +- Fixed sliders buttons being invisible while pressed in device interfaces. +- Fixed an item being spawned in the submarine editor when selecting an item from the menu while another +one is already selected. +- Fixed submarine colliders not taking into account the body offsets of the wall structures, causing +some items outside the submarine's walls to be impossible to interact with (the most noticeable being the +button that opens Orca's airlock from the outside). +- Added a small stun effect to railgun shells. +- Added a little extra fuel to vanilla subs. +- Slowed down item deterioration rates. +- Moved the position of turrets in Orca and Typhon to prevent players getting caught under them. +- Moved humpback's cargo spawn position a bit to prevent the cargo from falling down the hatch under it. +- Added better visual feedback when reactor is in poor condition. + --------------------------------------------------------------------------------------------------------- v0.8.9.1 (closed alpha) ---------------------------------------------------------------------------------------------------------