Unstable 1.8.4.0

This commit is contained in:
Markus Isberg
2025-03-12 12:56:27 +00:00
parent a4c3e868e4
commit a4a3427e4e
627 changed files with 29860 additions and 10018 deletions
@@ -134,7 +134,7 @@ namespace Barotrauma
foreach (Submarine sub in Loaded)
{
Rectangle worldBorders = sub.Borders;
worldBorders.Location += sub.WorldPosition.ToPoint();
worldBorders.Location += (sub.DrawPosition + sub.HiddenSubPosition).ToPoint();
worldBorders.Y = -worldBorders.Y;
GUI.DrawRectangle(spriteBatch, worldBorders, Color.White, false, 0, 5);
@@ -159,46 +159,38 @@ namespace Barotrauma
}
public static float DamageEffectCutoff;
public static Color DamageEffectColor;
private static readonly List<Structure> depthSortedDamageable = new List<Structure>();
public static void DrawDamageable(SpriteBatch spriteBatch, Effect damageEffect, bool editing = false, Predicate<MapEntity> predicate = null)
{
var entitiesToRender = !editing && visibleEntities != null ? visibleEntities : MapEntity.MapEntityList;
depthSortedDamageable.Clear();
//insertion sort according to draw depth
foreach (MapEntity e in entitiesToRender)
if (!editing && visibleEntities != null)
{
if (e is Structure structure && structure.DrawDamageEffect)
foreach (MapEntity e in visibleEntities)
{
if (predicate != null)
if (e is Structure structure && structure.DrawDamageEffect)
{
if (!predicate(e)) { continue; }
if (predicate != null)
{
if (!predicate(structure)) { continue; }
}
structure.DrawDamage(spriteBatch, damageEffect, editing);
}
float drawDepth = structure.GetDrawDepth();
int i = 0;
while (i < depthSortedDamageable.Count)
}
}
else
{
foreach (Structure structure in Structure.WallList)
{
if (structure.DrawDamageEffect)
{
float otherDrawDepth = depthSortedDamageable[i].GetDrawDepth();
if (otherDrawDepth < drawDepth) { break; }
i++;
if (predicate != null)
{
if (!predicate(structure)) { continue; }
}
structure.DrawDamage(spriteBatch, damageEffect, editing);
}
depthSortedDamageable.Insert(i, structure);
}
}
foreach (Structure s in depthSortedDamageable)
{
s.DrawDamage(spriteBatch, damageEffect, editing);
}
if (damageEffect != null)
{
damageEffect.Parameters["aCutoff"].SetValue(0.0f);
damageEffect.Parameters["cCutoff"].SetValue(0.0f);
DamageEffectCutoff = 0.0f;
}
}
public static void DrawPaintedColors(SpriteBatch spriteBatch, bool editing = false, Predicate<MapEntity> predicate = null)
@@ -506,6 +498,16 @@ namespace Barotrauma
warnings.Add(SubEditorScreen.WarningType.WaterInHulls);
Hull.ShowHulls = true;
}
if (Info.IsWreck)
{
Point vanillaBrainSize = new Point(204, 204);
if (WreckAI.GetPotentialBrainRooms(this, WreckAIConfig.GetRandom(), minSize: vanillaBrainSize).None())
{
errorMsgs.Add(TextManager.Get("NoSuitableBrainRoomsWarning").Value);
warnings.Add(SubEditorScreen.WarningType.NoSuitableBrainRooms);
}
}
if (!IsWarningSuppressed(SubEditorScreen.WarningType.NotEnoughContainers))
{
@@ -656,6 +658,7 @@ namespace Barotrauma
errorMsgs.Add(TextManager.GetWithVariables("InsufficientFreeConnectionsWarning",
("[doorcount]", doorLinks.ToString()),
("[freeconnectioncount]", (item.Connections[i].MaxWires - wireCount).ToString())).Value);
warnings.Add(SubEditorScreen.WarningType.InsufficientFreeConnectionsWarning);
break;
}
}
@@ -836,7 +839,7 @@ namespace Barotrauma
subBody.PositionBuffer.Insert(index, posInfo);
}
}
public void ClientEventRead(IReadMessage msg, float sendingTime)
{
Identifier layerIdentifier = msg.ReadIdentifier();