Release 1.10.5.0 - Autumn Update 2025

This commit is contained in:
Regalis11
2025-09-17 13:44:21 +03:00
parent d13836ce87
commit caa0326cf8
120 changed files with 2584 additions and 635 deletions
@@ -197,8 +197,8 @@ namespace Barotrauma.Items.Components
};
LocalizedString labelText = GetUILabel();
GUITextBlock label = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), content.RectTransform, Anchor.TopCenter),
labelText, font: GUIStyle.SubHeadingFont, textAlignment: Alignment.CenterLeft, wrap: true)
GUITextBlock label = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), content.RectTransform, Anchor.TopLeft),
labelText, font: GUIStyle.SubHeadingFont, textAlignment: Alignment.TopLeft, wrap: true)
{
IgnoreLayoutGroups = true
};
@@ -206,6 +206,8 @@ namespace Barotrauma.Items.Components
int buttonSize = GUIStyle.ItemFrameTopBarHeight;
Point margin = new Point(buttonSize / 4, buttonSize / 6);
int buttonCount = 0;
GUILayoutGroup buttonArea = new GUILayoutGroup(new RectTransform(new Point(content.Rect.Width, buttonSize - margin.Y * 2), content.RectTransform, Anchor.TopRight) { AbsoluteOffset = new Point(0, margin.Y) },
isHorizontal: true, childAnchor: Anchor.TopRight)
{
@@ -213,24 +215,37 @@ namespace Barotrauma.Items.Components
};
if (Inventory.Capacity > 1)
{
new GUIButton(new RectTransform(Vector2.One, buttonArea.RectTransform, scaleBasis: ScaleBasis.Smallest), style: "SortItemsButton")
if (ShowSortButton)
{
ToolTip = TextManager.Get("SortItemsAlphabetically"),
OnClicked = (btn, userdata) =>
buttonCount++;
new GUIButton(new RectTransform(Vector2.One, buttonArea.RectTransform, scaleBasis: ScaleBasis.Smallest), style: "SortItemsButton")
{
SortItems();
return true;
}
};
new GUIButton(new RectTransform(Vector2.One, buttonArea.RectTransform, scaleBasis: ScaleBasis.Smallest), style: "MergeStacksButton")
ToolTip = TextManager.Get("SortItemsAlphabetically"),
OnClicked = (btn, userdata) =>
{
SortItems();
return true;
}
};
}
if (ShowMergeButton)
{
ToolTip = TextManager.Get("MergeItemStacks"),
OnClicked = (btn, userdata) =>
buttonCount++;
new GUIButton(new RectTransform(Vector2.One, buttonArea.RectTransform, scaleBasis: ScaleBasis.Smallest), style: "MergeStacksButton")
{
MergeStacks();
return true;
}
};
ToolTip = TextManager.Get("MergeItemStacks"),
OnClicked = (btn, userdata) =>
{
MergeStacks();
return true;
}
};
}
}
if (buttonCount > 0)
{
label.RectTransform.MaxSize = new Point(label.Parent.Rect.Width - buttonCount * buttonSize, int.MaxValue);
}
float minInventoryAreaSize = 0.5f;
@@ -1078,7 +1078,7 @@ namespace Barotrauma.Items.Components
if (hullData is null)
{
hullData = new HullData();
GetLinkedHulls(hull, hullData.LinkedHulls);
hull.GetLinkedHulls(hullData.LinkedHulls);
hullDatas.Add(hull, hullData);
}
@@ -1586,19 +1586,6 @@ namespace Barotrauma.Items.Components
}
}
public static void GetLinkedHulls(Hull hull, List<Hull> linkedHulls)
{
foreach (var linkedEntity in hull.linkedTo)
{
if (linkedEntity is Hull linkedHull)
{
if (linkedHulls.Contains(linkedHull) || linkedHull.IsHidden) { continue; }
linkedHulls.Add(linkedHull);
GetLinkedHulls(linkedHull, linkedHulls);
}
}
}
public static GUIFrame CreateMiniMap(Submarine sub, GUIComponent parent, MiniMapSettings settings)
{
return CreateMiniMap(sub, parent, settings, null, out _);
@@ -1791,7 +1778,7 @@ namespace Barotrauma.Items.Components
if (combinedHulls.ContainsKey(hull) || combinedHulls.Values.Any(hh => hh.Contains(hull))) { continue; }
List<Hull> linkedHulls = new List<Hull>();
GetLinkedHulls(hull, linkedHulls);
hull.GetLinkedHulls(linkedHulls);
linkedHulls.Remove(hull);
@@ -133,7 +133,7 @@ namespace Barotrauma.Items.Components
partial void UpdateProjSpecific(float deltaTime)
{
if (FlowPercentage < 0.0f)
if (currFlow < 0f)
{
foreach (var (position, emitter) in pumpOutEmitters)
{
@@ -154,10 +154,10 @@ namespace Barotrauma.Items.Components
}
emitter.Emit(deltaTime, item.WorldPosition + relativeParticlePos, item.CurrentHull, angle,
velocityMultiplier: MathHelper.Lerp(0.5f, 1.0f, -FlowPercentage / 100.0f));
velocityMultiplier: MathHelper.Lerp(0.5f, 1.0f, -currFlow / maxFlow));
}
}
else if (FlowPercentage > 0.0f)
else if (currFlow > 0f)
{
foreach (var (position, emitter) in pumpInEmitters)
{
@@ -174,7 +174,7 @@ namespace Barotrauma.Items.Components
relativeParticlePos.Y = -relativeParticlePos.Y;
}
emitter.Emit(deltaTime, item.WorldPosition + relativeParticlePos, item.CurrentHull, angle,
velocityMultiplier: MathHelper.Lerp(0.5f, 1.0f, FlowPercentage / 100.0f));
velocityMultiplier: MathHelper.Lerp(0.5f, 1.0f, currFlow / maxFlow));
}
}
}
@@ -185,7 +185,7 @@ namespace Barotrauma.Items.Components
{
autoControlIndicator.Selected = IsAutoControlled;
PowerButton.Enabled = isActiveLockTimer <= 0.0f;
if (HasPower)
if (HasPower && !Disabled)
{
flickerTimer = 0;
powerLight.Selected = IsActive;
@@ -229,6 +229,7 @@ namespace Barotrauma.Items.Components
float flowPercentage = msg.ReadRangedInteger(-10, 10) * 10.0f;
bool isActive = msg.ReadBoolean();
bool hijacked = msg.ReadBoolean();
bool disabled = msg.ReadBoolean();
float? targetLevel;
if (msg.ReadBoolean())
{
@@ -250,6 +251,7 @@ namespace Barotrauma.Items.Components
FlowPercentage = flowPercentage;
IsActive = isActive;
Hijacked = hijacked;
Disabled = disabled;
TargetLevel = targetLevel;
}
}
@@ -34,8 +34,8 @@ namespace Barotrauma.Items.Components
set;
}
[Serialize("0.5,0.5)", IsPropertySaveable.No)]
public Vector2 Origin { get; set; } = new Vector2(0.5f, 0.5f);
[Serialize("0.5,0.5", IsPropertySaveable.No)]
public Vector2 Origin { get; set; }
[Serialize(true, IsPropertySaveable.No, description: "")]
public bool BreakFromMiddle
@@ -314,9 +314,12 @@ namespace Barotrauma.Items.Components
textColors.Add(GUIStyle.Orange);
}
int oxygenTextIndex = MathHelper.Clamp((int)Math.Floor((1.0f - (target.Oxygen / 100.0f)) * OxygenTexts.Length), 0, OxygenTexts.Length - 1);
texts.Add(OxygenTexts[oxygenTextIndex]);
textColors.Add(Color.Lerp(GUIStyle.Red, GUIStyle.Green, target.Oxygen / 100.0f));
if (target.NeedsOxygen)
{
int oxygenTextIndex = MathHelper.Clamp((int)Math.Floor((1.0f - (target.Oxygen / 100.0f)) * OxygenTexts.Length), 0, OxygenTexts.Length - 1);
texts.Add(OxygenTexts[oxygenTextIndex]);
textColors.Add(Color.Lerp(GUIStyle.Red, GUIStyle.Green, target.Oxygen / 100.0f));
}
if (target.Bleeding > 0.0f)
{