Release 1.11.4.1 (Winter Update)

This commit is contained in:
Markus Isberg
2025-12-08 14:56:47 +00:00
parent 21e34e5cd8
commit 598966f200
121 changed files with 1614 additions and 819 deletions
@@ -354,9 +354,11 @@ namespace Barotrauma
{
List<Mission> availableMissions = currentDisplayLocation.GetMissionsInConnection(connection).Where(m => m.Prefab.ShowInMenus || GameMain.DebugDraw).ToList();
if (!availableMissions.Any()) { availableMissions.Insert(0, null); }
if (availableMissions.None()) { availableMissions.Insert(0, null); }
availableMissions.AddRange(location.AvailableMissions.Where(m => m.Locations[0] == m.Locations[1]));
//show side objectives last
availableMissions.Sort((m1, m2) => (m1?.Prefab.IsSideObjective ?? false).CompareTo(m2?.Prefab.IsSideObjective ?? false));
missionList.Content.ClearChildren();
@@ -390,6 +392,10 @@ namespace Barotrauma
};
LocalizedString missionName = mission?.Name ?? TextManager.Get("NoMission");
if (mission is { Prefab.IsSideObjective: true })
{
missionName = TextManager.AddPunctuation(':', TextManager.Get("sideobjective"), missionName);
}
if (GameMain.DebugDraw && mission != null)
{
if (!mission.Prefab.ShowInMenus) { missionName = $"[HIDDEN] {missionName}"; }
@@ -406,7 +412,7 @@ namespace Barotrauma
else
{
GUITickBox tickBox = null;
if (!isMissionInNextLocation && mission.Prefab.ShowInMenus)
if (!isMissionInNextLocation && mission.Prefab.ShowInMenus && !mission.Prefab.IsSideObjective)
{
tickBox = new GUITickBox(new RectTransform(Vector2.One * 0.9f, missionNameBlock.RectTransform, anchor: Anchor.CenterLeft, scaleBasis: ScaleBasis.Smallest) { AbsoluteOffset = new Point((int)missionNameBlock.Padding.X, 0) }, label: string.Empty)
{
@@ -539,7 +545,7 @@ namespace Barotrauma
int missionCount = 0;
if (GameMain.GameSession != null && Campaign.Map?.CurrentLocation?.SelectedMissions != null)
{
missionCount = Campaign.Map.CurrentLocation.SelectedMissions.Count(m => m.Locations.Contains(location) && !GameMain.GameSession.Missions.Contains(m));
missionCount = Campaign.Map.CurrentLocation.SelectedMissions.Count(m => m.Locations.Contains(location) && !GameMain.GameSession.Missions.Contains(m) && !m.Prefab.IsSideObjective);
}
return TextManager.AddPunctuation(':', TextManager.Get("Missions"), $"{missionCount}/{Campaign.Settings.TotalMaxMissionCount}");
}
@@ -551,9 +557,9 @@ namespace Barotrauma
OnClicked = (GUIButton btn, object obj) =>
{
if (missionList.Content.FindChild(c => c is GUITickBox tickBox && tickBox.Selected, recursive: true) == null &&
missionList.Content.Children.Any(c => c.UserData is Mission { Prefab.ShowInMenus: true } mission && mission.Locations.Contains(Campaign?.Map?.CurrentLocation)))
missionList.Content.Children.Any(c => c.UserData is Mission { Prefab.ShowInMenus: true, Prefab.IsSideObjective: false } mission && mission.Locations.Contains(Campaign?.Map?.CurrentLocation)))
{
var noMissionVerification = new GUIMessageBox(string.Empty, TextManager.Get("nomissionprompt"), new LocalizedString[] { TextManager.Get("yes"), TextManager.Get("no") });
var noMissionVerification = new GUIMessageBox(string.Empty, TextManager.Get("nomissionprompt"), [TextManager.Get("yes"), TextManager.Get("no")]);
noMissionVerification.Buttons[0].OnClicked = (btn, userdata) =>
{
StartRound?.Invoke();
@@ -648,7 +654,7 @@ namespace Barotrauma
private void UpdateMaxMissions(Location location)
{
hasMaxMissions = Campaign.NumberOfMissionsAtLocation(location) >= Campaign.Settings.TotalMaxMissionCount;
hasMaxMissions = Campaign.NumberOfSelectableMissionsAtLocation(location) >= Campaign.Settings.TotalMaxMissionCount;
}
public readonly struct PlayerBalanceElement
@@ -5,7 +5,6 @@ using Microsoft.Xna.Framework.Graphics;
using System;
using System.Diagnostics;
using System.Linq;
using System.Transactions;
namespace Barotrauma
{
@@ -348,14 +347,25 @@ namespace Barotrauma
//------------------------------------------------------------------------
graphics.SetRenderTarget(renderTargetBackground);
if (Level.Loaded == null)
if (Level.Loaded != null)
{
graphics.Clear(new Color(11, 18, 26, 255));
Level.Loaded.DrawBack(graphics, spriteBatch, cam);
}
else if (GameMain.GameSession.GameMode is TestGameMode testMode)
{
graphics.Clear(testMode.BackgroundParams.BackgroundColor);
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearWrap);
testMode.BackgroundParams.DrawBackgrounds(spriteBatch, cam);
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearWrap, DepthStencilState.DepthRead, null, null, cam.Transform);
testMode.BackgroundParams.DrawWaterParticles(spriteBatch, cam, testMode.WaterParticleOffset);
spriteBatch.End();
}
else
{
//graphics.Clear(new Color(255, 255, 255, 255));
Level.Loaded.DrawBack(graphics, spriteBatch, cam);
graphics.Clear(new Color(11, 18, 26, 255));
}
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.NonPremultiplied, depthStencilState: DepthStencilState.None, transformMatrix: cam.Transform);
@@ -380,6 +380,10 @@ namespace Barotrauma
GameMain.NetLobbyScreen.Select();
}
}
else if (GameMain.Client.FileReceiver.ActiveTransfers.None())
{
GameMain.Client.RequestFile(FileTransferType.Mod, currentDownload.Name, currentDownload.Hash.StringRepresentation);
}
}
public void CurrentDownloadFinished(FileReceiver.FileTransferIn transfer)
@@ -2221,11 +2221,7 @@ namespace Barotrauma
if (GameMain.Client == null) { return true; }
//the player presumably no longer wants to be afk if they clicked the start button
if (afkBox.Selected)
{
afkBox.Flash(GUIStyle.Green);
}
afkBox.Selected = false;
SetAFKSelected(false);
if (CampaignSetupFrame.Visible && CampaignSetupUI != null)
{
@@ -2357,7 +2353,7 @@ namespace Barotrauma
if (GameMain.Client != null)
{
afkBox.Visible = !GameMain.Client.IsServerOwner && GameMain.Client.ServerSettings.AllowAFK;
afkBox.Visible = GameMain.Client.IsServerOwner || GameMain.Client.ServerSettings.AllowAFK;
GameMain.Client.Voting.ResetVotes(GameMain.Client.ConnectedClients);
joinOnGoingRoundButton.OnClicked = (btn, userdata) =>
{
@@ -3082,6 +3078,15 @@ namespace Barotrauma
}
}
public void SetAFKSelected(bool selected)
{
if (afkBox.Selected != selected)
{
afkBox.Flash(GUIStyle.Green);
afkBox.Selected = selected;
}
}
public void SetAutoRestart(bool enabled, float timer = 0.0f)
{
autoRestartBox.Selected = enabled;
@@ -4994,7 +4999,7 @@ namespace Barotrauma
};
micIcon = new GUIImage(new RectTransform(new Vector2(0.05f, 1.0f), chatRow.RectTransform), style: "GUIMicrophoneUnavailable");
chatInput.Select();
chatInput.Select(ignoreSelectSound: true);
}
//this needs to be done even if we're using the existing chatinput instance instead of creating a new one,
@@ -1126,6 +1126,10 @@ namespace Barotrauma
{
new GUIMessageBox(TextManager.Get("error"), TextManager.Get("CannotJoinSteamServer.SteamNotInitialized"));
}
else if (endpoint is EosP2PEndpoint && !EosInterface.Core.IsInitialized)
{
new GUIMessageBox(TextManager.Get("error"), TextManager.Get("EosStatus.NotInitialized"));
}
else
{
JoinServer(endpoint.ToEnumerable().ToImmutableArray(), "");
@@ -1183,9 +1187,29 @@ namespace Barotrauma
endpointBox.OnTextChanged += (textBox, text) =>
{
okButton.Enabled = favoriteButton.Enabled = !string.IsNullOrEmpty(text);
okButton.Enabled = favoriteButton.Enabled = !string.IsNullOrEmpty(text);
return true;
};
// Connect on enter press, gotta go fast
endpointBox.OnEnterPressed += (textBox, text) =>
{
if (okButton.Enabled)
{
if (okButton.PlaySoundOnSelect)
{
SoundPlayer.PlayUISound(okButton.ClickSound);
}
okButton.OnClicked.Invoke(okButton, okButton.UserData);
}
return true;
};
// Focus on and select all the text, for easier input/deletion (after the dialog is shown, apparently it takes a moment)
CoroutineManager.Invoke(() =>
{
endpointBox.Select(ignoreSelectSound: true);
}, 0.1f);
}
private void RemoveMsgFromServerList()
@@ -40,6 +40,8 @@ namespace Barotrauma
#region Transform Editor
private const float TransformWidgetOffset = 300f;
private const float RotationSnapIncrement = MathF.PI / 36f;
private const float ScaleSnapIncrement = 0.1f;
private GUITickBox rotateToolToggle, scaleToolToggle;
public bool TransformWidgetSelected => TransformWidget.IsSelected;
@@ -141,6 +143,7 @@ namespace Barotrauma
if (rotateToolToggle.Selected)
{
transformCommand.RotationRad = MathUtils.VectorToAngle(PlayerInput.MousePosition - Cam.WorldToScreen(transformCommand.Pivot));
if (!PlayerInput.IsShiftDown()) { transformCommand.RotationRad = MathUtils.RoundTowardsClosest(transformCommand.RotationRad.Value, RotationSnapIncrement); }
rotationString = TextManager.GetWithVariable("SubEditor.TransformWidget.Rotation", "[value]", MathHelper.ToDegrees(transformCommand.RotationRad.Value).ToString("0.000", CultureInfo.CurrentCulture));
}
@@ -148,7 +151,9 @@ namespace Barotrauma
LocalizedString scaleString = null;
if (scaleToolToggle.Selected)
{
transformCommand.ScaleMult = Math.Clamp(Vector2.Distance(PlayerInput.MousePosition, Cam.WorldToScreen(transformCommand.Pivot)) / (TransformWidgetOffset * GUI.Scale), transformCommand.MinScale, transformCommand.MaxScale);
transformCommand.ScaleMult = Vector2.Distance(PlayerInput.MousePosition, Cam.WorldToScreen(transformCommand.Pivot)) / (TransformWidgetOffset * GUI.Scale);
if (!PlayerInput.IsShiftDown()) { transformCommand.ScaleMult = MathUtils.RoundTowardsClosest(transformCommand.ScaleMult.Value, ScaleSnapIncrement); }
transformCommand.ScaleMult = Math.Clamp(transformCommand.ScaleMult.Value, transformCommand.MinScale, transformCommand.MaxScale);
scaleString = TextManager.GetWithVariable("SubEditor.TransformWidget.Scale", "[value]", transformCommand.ScaleMult.Value.ToString("0.000", CultureInfo.CurrentCulture));
}