diff --git a/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterInfo.cs b/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterInfo.cs index 95e85187d..f4820eec0 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterInfo.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterInfo.cs @@ -151,8 +151,9 @@ namespace Barotrauma Stretch = true }; - LocalizedString deadDescription = TextManager.AddPunctuation(':', TextManager.Get("deceased") + "\n" + Character.CauseOfDeath.Affliction?.CauseOfDeathDescription ?? - TextManager.AddPunctuation(':', TextManager.Get("CauseOfDeath"), TextManager.Get("CauseOfDeath." + Character.CauseOfDeath.Type.ToString()))); + LocalizedString deadDescription = + TextManager.Get("deceased") + "\n" + + (Character.CauseOfDeath.Affliction?.CauseOfDeathDescription ?? TextManager.Get("CauseOfDeath." + Character.CauseOfDeath.Type.ToString())); new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), deadArea.RectTransform), deadDescription, textColor: GUIStyle.Red, font: font, textAlignment: Alignment.TopLeft) { Padding = Vector4.Zero }; } diff --git a/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs b/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs index 3c401566c..b819f816c 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs @@ -1,6 +1,9 @@ +using Barotrauma.IO; +using Barotrauma.Media; using Barotrauma.Networking; using Barotrauma.Particles; using Barotrauma.Steam; +using Barotrauma.Transition; using FarseerPhysics; using FarseerPhysics.Dynamics; using Microsoft.Xna.Framework; @@ -11,13 +14,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; -using Barotrauma.IO; using System.Threading; -using Barotrauma.Tutorials; -using Barotrauma.Media; -using Barotrauma.Extensions; -using System.Threading.Tasks; -using Barotrauma.Transition; namespace Barotrauma { @@ -430,7 +427,7 @@ namespace Barotrauma if (TitleScreen.WaitForLanguageSelection) { ContentPackageManager.VanillaCorePackage.LoadFilesOfType(); - TitleScreen.AvailableLanguages = TextManager.AvailableLanguages.ToArray(); + TitleScreen.AvailableLanguages = TextManager.AvailableLanguages.OrderBy(l => l.Value != "english".ToIdentifier()).ThenBy(l => l.Value).ToArray(); while (TitleScreen.WaitForLanguageSelection) { yield return CoroutineStatus.Running; diff --git a/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs b/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs index a3a2867d0..b993de620 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs @@ -1308,17 +1308,8 @@ namespace Barotrauma } break; case EventType.Status: - float prevCondition = condition; - condition = msg.ReadSingle(); - if (prevCondition > 0.0f && condition <= 0.0f) - { - ApplyStatusEffects(ActionType.OnBroken, 1.0f); - foreach (ItemComponent ic in components) - { - ic.PlaySound(ActionType.OnBroken); - } - } - SetActiveSprite(); + float newCondition = msg.ReadSingle(); + SetCondition(newCondition, isNetworkEvent: true); break; case EventType.AssignCampaignInteraction: CampaignInteractionType = (CampaignMode.InteractionType)msg.ReadByte(); diff --git a/Barotrauma/BarotraumaClient/ClientSource/Networking/GameClient.cs b/Barotrauma/BarotraumaClient/ClientSource/Networking/GameClient.cs index 08c87776e..2047cbc46 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Networking/GameClient.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Networking/GameClient.cs @@ -719,6 +719,9 @@ namespace Barotrauma.Networking case ServerPacketHeader.CHEATS_ENABLED: //allow interpreting this packet break; + case ServerPacketHeader.STARTGAME: + GameMain.NetLobbyScreen.ShowSpectateButton(); + return; default: return; //ignore any other packets } diff --git a/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs b/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs index 97398b63d..9f4f61cda 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs @@ -583,17 +583,17 @@ namespace Barotrauma c.ForceLayoutRecalculation(); }); bool serverExePickable = serverExecutableDropdown.ListBox.Content.CountChildren > 1; - serverExecutableDropdown.Parent.Visible - = serverExePickable; - serverExecutableDropdown.Parent.RectTransform.RelativeSize - = (1.0f, serverExePickable ? 0.1f : 0.0f); - serverExecutableDropdown.Parent.ForceLayoutRecalculation(); - (serverExecutableDropdown.Parent.Parent as GUILayoutGroup)?.Recalculate(); - if (serverExecutableDropdown.SelectedComponent is null) + bool wasPickable = serverExecutableDropdown.Parent.Visible; + if (wasPickable != serverExePickable) { - serverExecutableDropdown.Select(0); + serverExecutableDropdown.Parent.Visible = serverExePickable; + serverExecutableDropdown.Parent.IgnoreLayoutGroups = !serverExePickable; + (serverExecutableDropdown.Parent.Parent as GUILayoutGroup)?.Recalculate(); + if (serverExecutableDropdown.SelectedComponent is null) + { + serverExecutableDropdown.Select(0); + } } - break; case Tab.Tutorials: if (!GameSettings.CurrentConfig.CampaignDisclaimerShown) @@ -1132,18 +1132,19 @@ namespace Barotrauma } } - Vector2 textLabelSize = new Vector2(1.0f, 0.1f); + Vector2 textLabelSize = new Vector2(1.0f, 0.05f); Alignment textAlignment = Alignment.CenterLeft; Vector2 textFieldSize = new Vector2(0.5f, 1.0f); - Vector2 tickBoxSize = new Vector2(0.4f, 0.07f); + Vector2 tickBoxSize = new Vector2(0.4f, 0.04f); var content = new GUILayoutGroup(new RectTransform(new Vector2(0.7f, 0.9f), menuTabs[Tab.HostServer].RectTransform, Anchor.Center), childAnchor: Anchor.TopCenter) { - RelativeSpacing = 0.02f, + RelativeSpacing = 0.01f, Stretch = true }; GUIComponent parent = content; - new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("HostServerButton"), textAlignment: Alignment.Center, font: GUIStyle.LargeFont) { ForceUpperCase = ForceUpperCase.Yes }; + var header = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("HostServerButton"), textAlignment: Alignment.Center, font: GUIStyle.LargeFont) { ForceUpperCase = ForceUpperCase.Yes }; + header.RectTransform.IsFixedSize = true; //play style ----------------------------------------------------- @@ -1221,7 +1222,7 @@ namespace Barotrauma MaxTextLength = NetConfig.ServerNameMaxLength, OverflowClip = true }; - label.RectTransform.MaxSize = serverNameBox.RectTransform.MaxSize; + label.RectTransform.IsFixedSize = true; var maxPlayersLabel = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("MaxPlayers"), textAlignment: textAlignment); var buttonContainer = new GUILayoutGroup(new RectTransform(textFieldSize, maxPlayersLabel.RectTransform, Anchor.CenterRight), isHorizontal: true, childAnchor: Anchor.CenterLeft) @@ -1254,14 +1255,14 @@ namespace Barotrauma UserData = 1, OnClicked = ChangeMaxPlayers }; - maxPlayersLabel.RectTransform.MaxSize = maxPlayersBox.RectTransform.MaxSize; + maxPlayersLabel.RectTransform.IsFixedSize = true; label = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("Password"), textAlignment: textAlignment); passwordBox = new GUITextBox(new RectTransform(textFieldSize, label.RectTransform, Anchor.CenterRight), text: password, textAlignment: textAlignment) { Censor = true }; - label.RectTransform.MaxSize = passwordBox.RectTransform.MaxSize; + label.RectTransform.IsFixedSize = true; var serverExecutableLabel = new GUITextBlock(new RectTransform(textLabelSize, parent.RectTransform), TextManager.Get("ServerExecutable"), textAlignment: textAlignment); @@ -1297,7 +1298,8 @@ namespace Barotrauma return true; }; - + serverExecutableLabel.RectTransform.IsFixedSize = true; + // tickbox upper --------------- var tickboxAreaUpper = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, tickBoxSize.Y), parent.RectTransform), isHorizontal: true); @@ -1313,7 +1315,7 @@ namespace Barotrauma Selected = banAfterWrongPassword }; - tickboxAreaUpper.RectTransform.MaxSize = isPublicBox.RectTransform.MaxSize; + tickboxAreaUpper.RectTransform.IsFixedSize = true; // tickbox lower --------------- @@ -1325,7 +1327,7 @@ namespace Barotrauma ToolTip = TextManager.Get("hostserverkarmasettingtooltip") }; - tickboxAreaLower.RectTransform.MaxSize = karmaBox.RectTransform.MaxSize; + tickboxAreaLower.RectTransform.IsFixedSize = true; //spacing new GUIFrame(new RectTransform(new Vector2(1.0f, 0.05f), content.RectTransform), style: null); diff --git a/Barotrauma/BarotraumaClient/ClientSource/Sounds/SoundPlayer.cs b/Barotrauma/BarotraumaClient/ClientSource/Sounds/SoundPlayer.cs index cdd692671..c7d65c9ca 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Sounds/SoundPlayer.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Sounds/SoundPlayer.cs @@ -280,6 +280,7 @@ namespace Barotrauma } else { + if (FlowSounds[i] == null) { continue; } Vector2 soundPos = new Vector2(GameMain.SoundManager.ListenerPosition.X + (flowVolumeRight[i] - flowVolumeLeft[i]) * 100, GameMain.SoundManager.ListenerPosition.Y); if (flowSoundChannels[i] == null || !flowSoundChannels[i].IsPlaying) { diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj index a49d98a1d..e3511893a 100644 --- a/Barotrauma/BarotraumaClient/LinuxClient.csproj +++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 0.17.7.0 + 0.17.8.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj index b8ef2e701..df548bce6 100644 --- a/Barotrauma/BarotraumaClient/MacClient.csproj +++ b/Barotrauma/BarotraumaClient/MacClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 0.17.7.0 + 0.17.8.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/WindowsClient.csproj b/Barotrauma/BarotraumaClient/WindowsClient.csproj index c4137dcdf..59fd1a085 100644 --- a/Barotrauma/BarotraumaClient/WindowsClient.csproj +++ b/Barotrauma/BarotraumaClient/WindowsClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 0.17.7.0 + 0.17.8.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaServer/LinuxServer.csproj b/Barotrauma/BarotraumaServer/LinuxServer.csproj index 6e72c14b2..8fac0fc78 100644 --- a/Barotrauma/BarotraumaServer/LinuxServer.csproj +++ b/Barotrauma/BarotraumaServer/LinuxServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 0.17.7.0 + 0.17.8.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/MacServer.csproj b/Barotrauma/BarotraumaServer/MacServer.csproj index 989b6a1f4..dd0f57e1b 100644 --- a/Barotrauma/BarotraumaServer/MacServer.csproj +++ b/Barotrauma/BarotraumaServer/MacServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 0.17.7.0 + 0.17.8.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/WindowsServer.csproj b/Barotrauma/BarotraumaServer/WindowsServer.csproj index a56b1996b..426b36bdd 100644 --- a/Barotrauma/BarotraumaServer/WindowsServer.csproj +++ b/Barotrauma/BarotraumaServer/WindowsServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 0.17.7.0 + 0.17.8.0 Copyright © FakeFish 2018-2022 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs index 57df4275c..5f992ba83 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs @@ -1778,7 +1778,7 @@ namespace Barotrauma AnimController.Anim != AnimController.Animation.UsingConstruction && AnimController.Anim != AnimController.Animation.CPR && (GameMain.NetworkMember == null || !GameMain.NetworkMember.IsClient || Controlled == this) && - (AnimController.OnGround && !AnimController.InWater || IsKeyDown(InputType.Aim) && HeldItems.None(i => i.RequireAimToUse))) + AnimController.OnGround && !AnimController.InWater) { if (dontFollowCursor) { @@ -1788,30 +1788,13 @@ namespace Barotrauma { // Values lower than this seem to cause constantious flipping when the mouse is near the player and the player is running, because the root collider moves after flipping. float followMargin = 40; - Vector2 diff = CursorPosition - AnimController.Collider.Position; - if (InWater) + if (CursorPosition.X < AnimController.Collider.Position.X - followMargin) { - followMargin = 80; - diff = Vector2.Transform(diff, Matrix.CreateRotationZ(-AnimController.Collider.Rotation)); - if (diff.X < followMargin) - { - AnimController.TargetDir = Direction.Left; - } - else if (diff.X > followMargin) - { - AnimController.TargetDir = Direction.Right; - } + AnimController.TargetDir = Direction.Left; } - else + else if (CursorPosition.X > AnimController.Collider.Position.X + followMargin) { - if (CursorPosition.X < AnimController.Collider.Position.X - followMargin) - { - AnimController.TargetDir = Direction.Left; - } - else if (CursorPosition.X > AnimController.Collider.Position.X + followMargin) - { - AnimController.TargetDir = Direction.Right; - } + AnimController.TargetDir = Direction.Right; } } } diff --git a/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentFile/SubmarineFile.cs b/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentFile/SubmarineFile.cs index dcd3107ff..22c40b0a8 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentFile/SubmarineFile.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentFile/SubmarineFile.cs @@ -21,7 +21,7 @@ namespace Barotrauma public override void UnloadFile() { - SubmarineInfo.RefreshSavedSub(Path.Value); + SubmarineInfo.RemoveSavedSub(Path.Value); } public override void Sort() diff --git a/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackageManager.cs b/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackageManager.cs index 533690a7a..68a695516 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackageManager.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/ContentManagement/ContentPackageManager.cs @@ -469,15 +469,22 @@ namespace Barotrauma } var corePackageElement = contentPackagesElement.GetChildElement(CorePackageElementName); - var configEnabledCorePackage = findPackage(CorePackages, corePackageElement); - if (configEnabledCorePackage == null) + if (corePackageElement == null) { - string packageStr = corePackageElement.GetAttributeString("name", null) ?? corePackageElement.GetAttributeStringUnrestricted("path", "UNKNOWN"); - DebugConsole.ThrowError($"Could not find the selected core package \"{packageStr}\". Switching to the \"{enabledCorePackage.Name}\" package."); + DebugConsole.AddWarning($"No core package selected. Switching to the \"{enabledCorePackage.Name}\" package."); } else { - enabledCorePackage = configEnabledCorePackage; + var configEnabledCorePackage = findPackage(CorePackages, corePackageElement); + if (configEnabledCorePackage == null) + { + string packageStr = corePackageElement.GetAttributeString("name", null) ?? corePackageElement.GetAttributeStringUnrestricted("path", "UNKNOWN"); + DebugConsole.ThrowError($"Could not find the selected core package \"{packageStr}\". Switching to the \"{enabledCorePackage.Name}\" package."); + } + else + { + enabledCorePackage = configEnabledCorePackage; + } } var regularPackagesElement = contentPackagesElement.GetChildElement(RegularPackagesElementName); diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs index df622c16c..693b8c7ce 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs @@ -109,7 +109,7 @@ namespace Barotrauma set { defaultRect = value; } } - private Dictionary connections; + private readonly Dictionary connections; private readonly List repairables; @@ -516,74 +516,7 @@ namespace Barotrauma get { return condition; } set { - if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) { return; } - if (!MathUtils.IsValid(value)) { return; } - if (Indestructible) { return; } - if (InvulnerableToDamage && value <= condition) { return; } - - float prev = condition; - bool wasInFullCondition = IsFullCondition; - - condition = MathHelper.Clamp(value, 0.0f, MaxCondition); - if (condition == 0.0f && prev > 0.0f) - { - //Flag connections to be updated as device is broken - flagChangedConnections(connections); -#if CLIENT - foreach (ItemComponent ic in components) - { - ic.PlaySound(ActionType.OnBroken); - } - if (Screen.Selected == GameMain.SubEditorScreen) { return; } -#endif - ApplyStatusEffects(ActionType.OnBroken, 1.0f, null); - } - else if (condition > 0.0f && prev <= 0.0f) - { - //Flag connections to be updated as device is now working again - flagChangedConnections(connections); - } - - SetActiveSprite(); - - if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer) - { - if (Math.Abs(lastSentCondition - condition) > 1.0f) - { - conditionUpdatePending = true; - isActive = true; - } - else if (wasInFullCondition != IsFullCondition) - { - conditionUpdatePending = true; - isActive = true; - } - else if (!MathUtils.NearlyEqual(lastSentCondition, condition) && (condition <= 0.0f || condition >= MaxCondition)) - { - sendConditionUpdateTimer = 0.0f; - conditionUpdatePending = true; - isActive = true; - } - } - - LastConditionChange = condition - prev; - ConditionLastUpdated = Timing.TotalTime; - - static void flagChangedConnections(Dictionary connections) - { - if (connections == null) { return; } - foreach (Connection c in connections.Values) - { - if (c.IsPower) - { - Powered.ChangedConnections.Add(c); - foreach (Connection conn in c.Recipients) - { - Powered.ChangedConnections.Add(conn); - } - } - } - } + SetCondition(value, isNetworkEvent: false); } } @@ -1667,6 +1600,81 @@ namespace Barotrauma return new AttackResult(damageAmount, null); } + private void SetCondition(float value, bool isNetworkEvent) + { + if (!isNetworkEvent) + { + if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) { return; } + } + if (!MathUtils.IsValid(value)) { return; } + if (Indestructible) { return; } + if (InvulnerableToDamage && value <= condition) { return; } + + float prev = condition; + bool wasInFullCondition = IsFullCondition; + + condition = MathHelper.Clamp(value, 0.0f, MaxCondition); + if (condition == 0.0f && prev > 0.0f) + { + //Flag connections to be updated as device is broken + flagChangedConnections(connections); +#if CLIENT + foreach (ItemComponent ic in components) + { + ic.PlaySound(ActionType.OnBroken); + } + if (Screen.Selected == GameMain.SubEditorScreen) { return; } +#endif + ApplyStatusEffects(ActionType.OnBroken, 1.0f, null); + } + else if (condition > 0.0f && prev <= 0.0f) + { + //Flag connections to be updated as device is now working again + flagChangedConnections(connections); + } + + SetActiveSprite(); + + if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer) + { + if (Math.Abs(lastSentCondition - condition) > 1.0f) + { + conditionUpdatePending = true; + isActive = true; + } + else if (wasInFullCondition != IsFullCondition) + { + conditionUpdatePending = true; + isActive = true; + } + else if (!MathUtils.NearlyEqual(lastSentCondition, condition) && (condition <= 0.0f || condition >= MaxCondition)) + { + sendConditionUpdateTimer = 0.0f; + conditionUpdatePending = true; + isActive = true; + } + } + + LastConditionChange = condition - prev; + ConditionLastUpdated = Timing.TotalTime; + + static void flagChangedConnections(Dictionary connections) + { + if (connections == null) { return; } + foreach (Connection c in connections.Values) + { + if (c.IsPower) + { + Powered.ChangedConnections.Add(c); + foreach (Connection conn in c.Recipients) + { + Powered.ChangedConnections.Add(conn); + } + } + } + } + } + private bool IsInWater() { if (CurrentHull == null) { return true; } diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineInfo.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineInfo.cs index c4e2cf5fa..fb29d2652 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineInfo.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Map/SubmarineInfo.cs @@ -545,7 +545,7 @@ namespace Barotrauma savedSubmarines.Add(subInfo); } - public static void RefreshSavedSub(string filePath) + public static void RemoveSavedSub(string filePath) { string fullPath = Path.GetFullPath(filePath); for (int i = savedSubmarines.Count - 1; i >= 0; i--) @@ -555,7 +555,11 @@ namespace Barotrauma savedSubmarines[i].Dispose(); } } + } + public static void RefreshSavedSub(string filePath) + { + RemoveSavedSub(filePath); if (File.Exists(filePath)) { var subInfo = new SubmarineInfo(filePath); diff --git a/Barotrauma/BarotraumaShared/SharedSource/Text/LocalizedString/ConcatLString.cs b/Barotrauma/BarotraumaShared/SharedSource/Text/LocalizedString/ConcatLString.cs index 8048609fc..06f36cc62 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Text/LocalizedString/ConcatLString.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Text/LocalizedString/ConcatLString.cs @@ -14,7 +14,7 @@ namespace Barotrauma public override bool Loaded => left.Loaded || right.Loaded; public override void RetrieveValue() { - cachedValue = left.Value + right.Value; + cachedValue = (left.Value ?? string.Empty) + (right.Value ?? string.Empty); UpdateLanguage(); } } diff --git a/Barotrauma/BarotraumaShared/SharedSource/Text/TextPack.cs b/Barotrauma/BarotraumaShared/SharedSource/Text/TextPack.cs index e36603dd7..05ead3562 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Text/TextPack.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Text/TextPack.cs @@ -2,7 +2,6 @@ using Barotrauma.Extensions; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using System.Reflection; using System.Text; using System.Xml.Linq; diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt index a0696f27c..47b8ebbe4 100644 --- a/Barotrauma/BarotraumaShared/changelog.txt +++ b/Barotrauma/BarotraumaShared/changelog.txt @@ -1,3 +1,18 @@ +--------------------------------------------------------------------------------------------------------- +v0.17.8.0 +--------------------------------------------------------------------------------------------------------- + +Changes (unstable only): +- Remove flipping in water while aiming (with the changes introduced to aiming in the previous versions, aiming works even better without it). + +Fixes (unstable only): +- Fixed languages being in random order in the initial language selection screen. +- Fixed power grid going crazy client-side when junction boxes break. +- Fixed crashing when clicking on a dead player in the tab menu. +- Fixed spectate button not appearing if the round starts while waiting for mods to download. +- Fixed disabling a submarine mod not actually disabling the sub. +- Fixed host server menu layout changing every time you open it, and the server exe dropdown having a different size than the rest of the elements. + --------------------------------------------------------------------------------------------------------- v0.17.7.0 ---------------------------------------------------------------------------------------------------------