diff --git a/.github/DISCUSSION_TEMPLATE/bug-reports.yml b/.github/DISCUSSION_TEMPLATE/bug-reports.yml index cdefa3753..71271780c 100644 --- a/.github/DISCUSSION_TEMPLATE/bug-reports.yml +++ b/.github/DISCUSSION_TEMPLATE/bug-reports.yml @@ -73,7 +73,7 @@ body: label: Version description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu. options: - - v1.11.5.0 (Winter Update 2025 Hotfix 1) + - v1.12.6.2 (Spring Update 2026) - Other validations: required: true diff --git a/Barotrauma/BarotraumaClient/ClientSource/Settings/SettingsMenu.cs b/Barotrauma/BarotraumaClient/ClientSource/Settings/SettingsMenu.cs index 7f9a9214a..537ad5b60 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Settings/SettingsMenu.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Settings/SettingsMenu.cs @@ -174,9 +174,9 @@ namespace Barotrauma public static RectTransform NewItemRectT(GUILayoutGroup parent) => new RectTransform((1.0f, 0.06f), parent.RectTransform, Anchor.CenterLeft); - public static void Spacer(GUILayoutGroup parent) + public static void Spacer(GUILayoutGroup parent, float height = 0.03f) { - new GUIFrame(new RectTransform((1.0f, 0.03f), parent.RectTransform, Anchor.CenterLeft), style: null); + new GUIFrame(new RectTransform((1.0f, height), parent.RectTransform, Anchor.CenterLeft), style: null); } public static GUITextBlock Label(GUILayoutGroup parent, LocalizedString str, GUIFont font) @@ -507,6 +507,47 @@ namespace Barotrauma return true; } }; +#if OSX + Spacer(voiceChat, 0.003f); + + // On macOS, microphone permission can apparently sometimes end up in a broken state when the app binary changes (eg. after a Steam update). + // The device seems to be there, but won't receive anything, even if the mic permission is fine. + // This button lets the user reset it and reboot the game, so the mic permission check will be retriggered on next run. + new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), voiceChat.RectTransform), + text: TextManager.Get("MacResetMicPermissions"), + style: "GUIButtonSmall") + { + ToolTip = TextManager.Get("MacResetMicPermissionsToolTip"), + OnClicked = (btn, obj) => + { + var confirmBox = new GUIMessageBox( + TextManager.Get("MacResetMicPermissions"), + TextManager.Get("MacResetMicPermissionsConfirm"), + [TextManager.Get("OK"), TextManager.Get("Cancel")]); + confirmBox.Buttons[0].OnClicked = (_, _) => + { + try + { + System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo + { + FileName = "tccutil", + Arguments = "reset Microphone com.FakeFish.Barotrauma", + UseShellExecute = false + }); + } + catch (Exception e) + { + DebugConsole.NewMessage($"Failed to reset microphone permission: {e.Message}", Color.Orange); + } + GameMain.Instance.Exit(); + confirmBox.Close(); + return true; + }; + confirmBox.Buttons[1].OnClicked = confirmBox.Close; + return true; + } + }; +#endif Spacer(voiceChat); Label(voiceChat, TextManager.Get("VCInputMode"), GUIStyle.SubHeadingFont); diff --git a/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs b/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs index 5f33df3bc..dc31dc47c 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Steam/Workshop.cs @@ -18,6 +18,10 @@ namespace Barotrauma.Steam { public const int MaxThumbnailSize = 1024 * 1024; + /// + /// Tags the players can choose for their workshop items. These must match the ones defined in the Steamworks backend. They're case insensitive, but must otherwise match exactly for the tag filtering to work correctly. + /// The localized names for these are fetched from the loca files with the identifier "workshop.contenttag.{tag.RemoveWhitespace()}". + /// public static readonly ImmutableArray Tags = new [] { "submarine", @@ -25,7 +29,7 @@ namespace Barotrauma.Steam "monster", "mission", "outpost", - "beaconstation", + "beacon station", "wreck", "ruin", "weapons", @@ -34,14 +38,14 @@ namespace Barotrauma.Steam "art", "event set", "total conversion", - "gamemode", - "gameplaymechanics", + "game mode", + "gameplay mechanics", "environment", "item assembly", "language", "qol", - "clientside", - "serverside", + "client-side", + "server-side", "outdated", "library" }.ToIdentifiers().ToImmutableArray(); diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj index 2d618918b..20e0c832f 100644 --- a/Barotrauma/BarotraumaClient/LinuxClient.csproj +++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.12.6.2 + 1.12.7.0 Copyright © FakeFish 2018-2024 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj index 921069239..cc877ab15 100644 --- a/Barotrauma/BarotraumaClient/MacClient.csproj +++ b/Barotrauma/BarotraumaClient/MacClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.12.6.2 + 1.12.7.0 Copyright © FakeFish 2018-2024 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/WindowsClient.csproj b/Barotrauma/BarotraumaClient/WindowsClient.csproj index 218cb4b03..9bf9ca415 100644 --- a/Barotrauma/BarotraumaClient/WindowsClient.csproj +++ b/Barotrauma/BarotraumaClient/WindowsClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.12.6.2 + 1.12.7.0 Copyright © FakeFish 2018-2024 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaServer/LinuxServer.csproj b/Barotrauma/BarotraumaServer/LinuxServer.csproj index 680300ddc..411d2e5ee 100644 --- a/Barotrauma/BarotraumaServer/LinuxServer.csproj +++ b/Barotrauma/BarotraumaServer/LinuxServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.12.6.2 + 1.12.7.0 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/MacServer.csproj b/Barotrauma/BarotraumaServer/MacServer.csproj index ecf8c4d7b..fb79c6495 100644 --- a/Barotrauma/BarotraumaServer/MacServer.csproj +++ b/Barotrauma/BarotraumaServer/MacServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.12.6.2 + 1.12.7.0 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/WindowsServer.csproj b/Barotrauma/BarotraumaServer/WindowsServer.csproj index 025fde821..edf236deb 100644 --- a/Barotrauma/BarotraumaServer/WindowsServer.csproj +++ b/Barotrauma/BarotraumaServer/WindowsServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.12.6.2 + 1.12.7.0 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/OxygenDispenserTest.xml b/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/OxygenDispenserTest.xml index 1cf6e86ca..82378a936 100644 --- a/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/OxygenDispenserTest.xml +++ b/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/OxygenDispenserTest.xml @@ -14,7 +14,7 @@ AttachedByDefault="true" DisallowAttachingOverTags="container,planter,refuelableitem" DisallowAttachingOverSize="115,130"> - + diff --git a/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/RotationAndFlippingTests.sub b/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/RotationAndFlippingTests.sub index 7eafd5c1c..10d816db3 100644 Binary files a/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/RotationAndFlippingTests.sub and b/Barotrauma/BarotraumaShared/LocalMods/[DebugOnlyTest]RotationAndFlippingTests/RotationAndFlippingTests.sub differ diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/EnemyAIController.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/EnemyAIController.cs index ce74caefa..eeab5c9b6 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/EnemyAIController.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/EnemyAIController.cs @@ -242,10 +242,13 @@ namespace Barotrauma } /// - /// The monster won't try to damage these submarines + /// The monster won't try to damage these submarines. Applies to hulls, structures and static items (items without a physics body) belonging to these submarines. Does not apply to non-static items, e.g. flares or other provocative items. + /// + private readonly HashSet unattackableSubmarines = []; + + /// + /// Set the submarine(s) the monster won't attack. Applies to hulls, structures and static items (items without a physics body) belonging to these submarines. Does not apply to non-static items, e.g. flares or other provocative items. /// - private readonly HashSet unattackableSubmarines = new HashSet(); - public void SetUnattackableSubmarines(Submarine submarine, bool includeOwnSub = true, bool includeConnectedSubs = true, bool clearExisting = true) { if (clearExisting) @@ -3075,11 +3078,17 @@ namespace Barotrauma } else { - // Ignore all structures, items, and hulls inside these subs. - if (aiTarget.Entity.Submarine != null) + if (aiTarget.Entity.Submarine != null) { + //ignore all items, structures and hulls in wrecks and beacon stations + //(we don't want monsters to be distracted by them during missions, + //nor have monsters inside them attack "their home" rather than the player) if (aiTarget.Entity.Submarine.Info.IsWreck || - aiTarget.Entity.Submarine.Info.IsBeacon || + aiTarget.Entity.Submarine.Info.IsBeacon) + { + continue; + } + if (aiTarget.Entity is Structure or Hull or Item { body: null } && unattackableSubmarines.Contains(aiTarget.Entity.Submarine)) { continue; diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs index 561fa6716..c105aee80 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/ItemContainer.cs @@ -99,7 +99,7 @@ namespace Barotrauma.Items.Components } } - [Serialize("0.0,0.0", IsPropertySaveable.No, description: "The position where the contained items get drawn at. In the case of items with a physics body, the offset is from the center of the body, on items without one from the top-left corner of the sprite. In pixels.")] + [Serialize("0.0,0.0", IsPropertySaveable.No, description: "The position where the contained items get drawn at (offset from the upper left corner of the sprite in pixels).")] public Vector2 ItemPos { get; set; } [Serialize("0.0,0.0", IsPropertySaveable.No, description: "The interval at which the contained items are spaced apart from each other (in pixels).")] @@ -1093,25 +1093,21 @@ namespace Barotrauma.Items.Components { if (item.body == null) { - //if the item is a holdable item currently attached to a wall (i.e. normally has a physics body, but the body is now disabled), - //we must position the contained items using the center as the origin since the item positions have been configured with the assumption the item has a body - bool isAttachedHoldable = item.GetComponent() is { Attached: true }; - bool useCenterAsOrigin = isAttachedHoldable; if (flippedX) { transformedItemPos.X = -transformedItemPos.X; - if (!useCenterAsOrigin) { transformedItemPos.X += item.Rect.Width; } + transformedItemPos.X += item.Rect.Width; transformedItemInterval.X = -transformedItemInterval.X; transformedItemIntervalHorizontal.X = -transformedItemIntervalHorizontal.X; } if (flippedY) { transformedItemPos.Y = -transformedItemPos.Y; - if (!useCenterAsOrigin) { transformedItemPos.Y -= item.Rect.Height; } + transformedItemPos.Y -= item.Rect.Height; transformedItemInterval.Y = -transformedItemInterval.Y; transformedItemIntervalVertical.Y = -transformedItemIntervalVertical.Y; } - transformedItemPos += useCenterAsOrigin ? item.Position : new Vector2(item.Rect.X, item.Rect.Y); + transformedItemPos += new Vector2(item.Rect.X, item.Rect.Y); if (drawPosition) { if (item.Submarine != null) { transformedItemPos += item.Submarine.DrawPosition; } @@ -1129,6 +1125,16 @@ namespace Barotrauma.Items.Components } else { + if (item.GetComponent() is { Attachable: true }) + { + //if the item is attachable to walls, we need a bit of special logic because the item can either + //have or not have a body depending on whether it's attached. + + //since it seems previously the contained item positions have always been configured as if the item had no body (using the top-left corner as the origin), + //let's modify the position here to position the items correctly even when the body is active (moving the origin from the center of the body to the top-left corner) + transformedItemPos -= item.Rect.Size.FlipY().ToVector2() / 2; + } + Matrix transform = Matrix.CreateRotationZ(drawPosition ? item.body.DrawRotation : item.body.Rotation); if (bodyFlipped) { diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Machines/Controller.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Machines/Controller.cs index b9c3222ba..9e2d344fe 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Machines/Controller.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Machines/Controller.cs @@ -862,10 +862,6 @@ namespace Barotrauma.Items.Components } else if (CanBeSelectedByCharacters) { -#if SERVER - GameServer.Log($"{GameServer.CharacterLogName(activator)} entered {item.Name}", ServerLog.MessageType.ItemInteraction); -#endif - activator.DeselectCharacter(); User = activator; diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs index 21a71b22b..ec3bafffc 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/LevelObjects/LevelTrigger.cs @@ -816,7 +816,7 @@ namespace Barotrauma public static float GetDistanceFactor(PhysicsBody triggererBody, PhysicsBody triggerBody, float colliderRadius) { - return 1.0f - ConvertUnits.ToDisplayUnits(Vector2.Distance(triggererBody.SimPosition, triggerBody.SimPosition)) / colliderRadius; + return 1.0f - ConvertUnits.ToDisplayUnits(Vector2.Distance(triggererBody.SimPosition, triggerBody.SimPosition) - triggererBody.GetMaxExtent() / 2) / colliderRadius; } public Vector2 GetWaterFlowVelocity(Vector2 viewPosition) diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt index 3c6b19da0..1e029d35c 100644 --- a/Barotrauma/BarotraumaShared/changelog.txt +++ b/Barotrauma/BarotraumaShared/changelog.txt @@ -1,4 +1,17 @@ ------------------------------------------------------------------------------------------------------------------------------------------------- +v1.12.7.0 +------------------------------------------------------------------------------------------------------------------------------------------------- + +- Reduced how much the new weak points in the reworked subs push bots around to make them more capable of fixing broken weak points. +- Fixed selecting any item that forces the character to some pose (chairs, periscopes) getting logged in the server console. +- Mac only: added a button for settings mic permissions to the audio settings. It seems that on Mac, the game updates may cause the OS to revoke the permissions. +- Fixed some of the Workshop tags you can choose in-game not working on Steam's side. + +Modding: +- Fixed contained items being misaligned on attachable items (e.g. in mods that make diving suit cabinets attachable). +- Fixed monsters spawned by an event inside an outpost being unable to attack any items inside that outpost. To our knowledge, didn't affect vanilla events, but caused issues in certain mods. + +------------------------------------------------------------------------------------------------------------------------------------------------- v1.12.6.2 ------------------------------------------------------------------------------------------------------------------------------------------------- @@ -439,7 +452,6 @@ v1.8.8.1 Modding: - Fixed transferring afflictions to a newly spawned character using status effects causing a crash if the original character had already been removed. Didn't affect any vanilla content. ->>>>>>> master ------------------------------------------------------------------------------------------------------------------------------------------------- v1.8.7.0 diff --git a/README.md b/README.md index 8aa2e40cf..dfde2babb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is a Barotrauma modification that adds Lua and Cs modding support. # Barotrauma -Copyright © FakeFish Ltd 2017-2024 +Copyright © FakeFish Ltd 2017-2026 Before downloading the source code, please read the [EULA](EULA.txt).