Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop

This commit is contained in:
EvilFactory
2023-10-19 12:18:30 -03:00
613 changed files with 22122 additions and 11481 deletions
@@ -16,6 +16,9 @@ namespace Barotrauma
{
class SubEditorScreen : EditorScreen
{
public const string CircuitBoxDeletionWarningHeader = "Selection contains circuit boxes",
CircuitBoxDeletionWarningBody = "Are you sure you want to delete the selection? Any wiring inside circuit boxes will be lost and cannot be recovered.";
public const int MaxStructures = 2000;
public const int MaxWalls = 500;
public const int MaxItems = 5000;
@@ -75,6 +78,7 @@ namespace Barotrauma
NoCargoSpawnpoints,
NoBallastTag,
NonLinkedGaps,
NoHiddenContainers,
StructureCount,
WallCount,
ItemCount,
@@ -232,6 +236,8 @@ namespace Barotrauma
public override Camera Cam => cam;
public bool DrawCharacterInventory => dummyCharacter != null && WiringMode;
public static XDocument AutoSaveInfo;
private static readonly string autoSavePath = Path.Combine("Submarines", ".AutoSaves");
private static readonly string autoSaveInfoPath = Path.Combine(autoSavePath, "autosaves.xml");
@@ -583,7 +589,7 @@ namespace Barotrauma
if (!(o is string layer)) { return false; }
MapEntity.SelectedList.Clear();
foreach (MapEntity entity in MapEntity.mapEntityList.Where(me => !me.Removed && me.Layer == layer))
foreach (MapEntity entity in MapEntity.MapEntityList.Where(me => !me.Removed && me.Layer == layer))
{
if (entity.IsSelected) { continue; }
@@ -842,7 +848,7 @@ namespace Barotrauma
var structureCount = new GUITextBlock(new RectTransform(new Vector2(0.33f, 1.0f), structureCountText.RectTransform, Anchor.TopRight, Pivot.TopLeft), "", textAlignment: Alignment.CenterRight);
structureCount.TextGetter = () =>
{
int count = MapEntity.mapEntityList.Count - Item.ItemList.Count - Hull.HullList.Count - WayPoint.WayPointList.Count - Gap.GapList.Count;
int count = MapEntity.MapEntityList.Count - Item.ItemList.Count - Hull.HullList.Count - WayPoint.WayPointList.Count - Gap.GapList.Count;
structureCount.TextColor = count > MaxStructures ? GUIStyle.Red : Color.Lerp(GUIStyle.Green, GUIStyle.Orange, count / (float)MaxStructures);
return count.ToString();
};
@@ -1164,7 +1170,7 @@ namespace Barotrauma
foreach (MapEntityPrefab ep in entityLists[categoryKey])
{
#if !DEBUG
if (ep.HideInMenus && !GameMain.DebugDraw) { continue; }
if ((ep.HideInMenus || ep.HideInEditors) && !GameMain.DebugDraw) { continue; }
#endif
CreateEntityElement(ep, entitiesPerRow, entityListInner.Content);
}
@@ -1183,7 +1189,7 @@ namespace Barotrauma
foreach (MapEntityPrefab ep in MapEntityPrefab.List)
{
#if !DEBUG
if (ep.HideInMenus && !GameMain.DebugDraw) { continue; }
if ((ep.HideInMenus || ep.HideInEditors) && !GameMain.DebugDraw) { continue; }
#endif
CreateEntityElement(ep, entitiesPerRow, allEntityList.Content);
}
@@ -1221,7 +1227,7 @@ namespace Barotrauma
frame.Color = Color.Magenta;
frame.ToolTip = $"{frame.ToolTip}\n‖color:{XMLExtensions.ToStringHex(Color.MediumPurple)}‖{ep.ContentPackage?.Name}‖color:end‖";
}
if (ep.HideInMenus)
if (ep.HideInMenus || ep.HideInEditors)
{
frame.Color = Color.Red;
name = "[HIDDEN] " + name;
@@ -1641,7 +1647,7 @@ namespace Barotrauma
/// <remarks>The saving is ran in another thread to avoid lag spikes</remarks>
private static void AutoSave()
{
if (MapEntity.mapEntityList.Any() && GameSettings.CurrentConfig.EnableSubmarineAutoSave && !isAutoSaving)
if (MapEntity.MapEntityList.Any() && GameSettings.CurrentConfig.EnableSubmarineAutoSave && !isAutoSaving)
{
if (MainSub != null)
{
@@ -1942,7 +1948,7 @@ namespace Barotrauma
var matchingFile = modProject.Files.FirstOrDefault(f => f.Type == subFileType && filePath.CleanUpPath().Equals(f.Path.CleanUpPath(), StringComparison.OrdinalIgnoreCase));
if (matchingFile != null)
{
File.Delete(matchingFile.Path.Replace(ContentPath.ModDirStr, packageDir));
File.Delete(matchingFile.Path.Replace(ContentPath.ModDirStr, packageDir, StringComparison.OrdinalIgnoreCase));
modProject.RemoveFile(matchingFile);
}
var newFile = ModProject.File.FromPath(filePath, subFileType);
@@ -2855,7 +2861,7 @@ namespace Barotrauma
{
OnClicked = (button, o) =>
{
var requiredPackages = MapEntity.mapEntityList.Select(e => e?.Prefab?.ContentPackage)
var requiredPackages = MapEntity.MapEntityList.Select(e => e?.Prefab?.ContentPackage)
.Where(cp => cp != null)
.Distinct().OfType<ContentPackage>().Select(p => p.Name).ToHashSet();
var tickboxes = requiredContentPackList.Content.Children.OfType<GUITickBox>().ToArray();
@@ -3496,7 +3502,15 @@ namespace Barotrauma
var ownerPackage = GetLocalPackageThatOwnsSub(selectedSubInfo);
if (ownerPackage is null)
{
if (GetWorkshopPackageThatOwnsSub(selectedSubInfo) is ContentPackage workshopPackage)
if (IsVanillaSub(selectedSubInfo))
{
#if DEBUG
LoadSub(selectedSubInfo);
#else
AskLoadVanillaSub(selectedSubInfo);
#endif
}
else if (GetWorkshopPackageThatOwnsSub(selectedSubInfo) is ContentPackage workshopPackage)
{
if (workshopPackage.TryExtractSteamWorkshopId(out var workshopId)
&& publishedWorkshopItemIds.Contains(workshopId.Value))
@@ -3508,14 +3522,6 @@ namespace Barotrauma
AskLoadSubscribedSub(selectedSubInfo);
}
}
else if (IsVanillaSub(selectedSubInfo))
{
#if DEBUG
LoadSub(selectedSubInfo);
#else
AskLoadVanillaSub(selectedSubInfo);
#endif
}
}
else
{
@@ -3795,10 +3801,7 @@ namespace Barotrauma
wiringModeTickBox.Selected = newMode == Mode.Wiring;
lockMode = false;
foreach (MapEntity me in MapEntity.mapEntityList)
{
me.IsHighlighted = false;
}
MapEntity.ClearHighlightedEntities();
MapEntity.DeselectAll();
MapEntity.FilteredSelectedList.Clear();
@@ -3809,7 +3812,8 @@ namespace Barotrauma
{
var item = new Item(MapEntityPrefab.Find(null, "screwdriver") as ItemPrefab, Vector2.Zero, null);
dummyCharacter.Inventory.TryPutItem(item, null, new List<InvSlotType>() { InvSlotType.RightHand });
wiringToolPanel = CreateWiringPanel();
Point wirePos = new Point((int)(10 * GUI.Scale), TopPanel.Rect.Height + entityCountPanel.Rect.Height + (int)(10 * GUI.Scale));
wiringToolPanel = CreateWiringPanel(wirePos, SelectWire);
}
}
@@ -3833,11 +3837,11 @@ namespace Barotrauma
Item target = null;
var single = targets.Count == 1 ? targets.Single() : null;
if (single is Item item && item.Components.Any(ic => !(ic is ConnectionPanel) && ic is not Repairable && ic.GuiFrame != null))
if (single is Item item && item.Components.Any(static ic => ic is not ConnectionPanel && ic is not Repairable && ic.GuiFrame != null))
{
// Do not offer the ability to open the inventory if the inventory should never be drawn
var container = item.GetComponent<ItemContainer>();
if (container == null || container.DrawInventory) { target = item; }
var containers = item.GetComponents<ItemContainer>();
if (containers.Any(static c => c.DrawInventory) || item.GetComponent<CircuitBox>() is not null) { target = item; }
}
bool hasTargets = targets.Count > 0;
@@ -3853,7 +3857,7 @@ namespace Barotrauma
new ContextMenuOption("Editor.SelectSame", isEnabled: hasTargets, onSelected: delegate
{
bool doorGapSelected = targets.Any(t => t is Gap gap && gap.ConnectedDoor != null);
foreach (MapEntity match in MapEntity.mapEntityList.Where(e => e.Prefab != null && targets.Any(t => t.Prefab?.Identifier == e.Prefab.Identifier) && !MapEntity.SelectedList.Contains(e)))
foreach (MapEntity match in MapEntity.MapEntityList.Where(e => e.Prefab != null && targets.Any(t => t.Prefab?.Identifier == e.Prefab.Identifier) && !MapEntity.SelectedList.Contains(e)))
{
if (MapEntity.SelectedList.Contains(match)) { continue; }
if (match is Gap gap)
@@ -3895,7 +3899,7 @@ namespace Barotrauma
new ContextMenuOption("editor.layer.createlayer", isEnabled: hasTargets, onSelected: () => { CreateNewLayer(null, targets); }),
new ContextMenuOption("editor.layer.selectall", isEnabled: hasTargets, onSelected: () =>
{
foreach (MapEntity match in MapEntity.mapEntityList.Where(e => targets.Any(t => !string.IsNullOrWhiteSpace(t.Layer) && t.Layer == e.Layer && !MapEntity.SelectedList.Contains(e))))
foreach (MapEntity match in MapEntity.MapEntityList.Where(e => targets.Any(t => !string.IsNullOrWhiteSpace(t.Layer) && t.Layer == e.Layer && !MapEntity.SelectedList.Contains(e))))
{
if (MapEntity.SelectedList.Contains(match)) { continue; }
MapEntity.SelectedList.Add(match);
@@ -3917,18 +3921,31 @@ namespace Barotrauma
new ContextMenuOption("editor.cut", isEnabled: hasTargets, onSelected: () => MapEntity.Cut(targets)),
new ContextMenuOption("editor.copytoclipboard", isEnabled: hasTargets, onSelected: () => MapEntity.Copy(targets)),
new ContextMenuOption("editor.paste", isEnabled: MapEntity.CopiedList.Any(), onSelected: () => MapEntity.Paste(cam.ScreenToWorld(PlayerInput.MousePosition))),
new ContextMenuOption("delete", isEnabled: hasTargets, onSelected: delegate
{
StoreCommand(new AddOrDeleteCommand(targets, true));
foreach (var me in targets)
{
if (!me.Removed) { me.Remove(); }
}
}),
new ContextMenuOption("delete", isEnabled: hasTargets, onSelected: () => RemoveEntitiesWithPossibleWarning(targets)),
new ContextMenuOption(TextManager.Get("editortip.shiftforextraoptions") + '\n' + TextManager.Get("editortip.altforruler"), isEnabled: false, onSelected: null));
}
}
public static void RemoveEntitiesWithPossibleWarning(List<MapEntity> targets)
{
if (targets.Any(static t => t is Item it && it.GetComponent<CircuitBox>() is not null))
{
GUI.AskForConfirmation(CircuitBoxDeletionWarningHeader, CircuitBoxDeletionWarningBody, onConfirm: Delete);
return;
}
Delete();
void Delete()
{
StoreCommand(new AddOrDeleteCommand(targets, true));
foreach (var me in targets)
{
if (!me.Removed) { me.Remove(); }
}
}
}
private void MoveToLayer(string layer, List<MapEntity> content)
{
layer ??= string.Empty;
@@ -3968,7 +3985,7 @@ namespace Barotrauma
{
Layers.Remove(original);
foreach (MapEntity entity in MapEntity.mapEntityList.Where(entity => entity.Layer == original))
foreach (MapEntity entity in MapEntity.MapEntityList.Where(entity => entity.Layer == original))
{
entity.Layer = newName ?? string.Empty;
}
@@ -3983,7 +4000,7 @@ namespace Barotrauma
private void ReconstructLayers()
{
ClearLayers();
foreach (MapEntity entity in MapEntity.mapEntityList)
foreach (MapEntity entity in MapEntity.MapEntityList)
{
if (!string.IsNullOrWhiteSpace(entity.Layer))
{
@@ -4310,15 +4327,15 @@ namespace Barotrauma
static string ColorToHex(Color color) => $"#{(color.R << 16 | color.G << 8 | color.B):X6}";
}
private GUIFrame CreateWiringPanel()
public static GUIFrame CreateWiringPanel(Point offset, GUIListBox.OnSelectedHandler onWireSelected)
{
GUIFrame frame = new GUIFrame(new RectTransform(new Vector2(0.03f, 0.35f), GUI.Canvas)
{ MinSize = new Point(120, 300), AbsoluteOffset = new Point((int)(10 * GUI.Scale), TopPanel.Rect.Height + entityCountPanel.Rect.Height + (int)(10 * GUI.Scale)) });
{ MinSize = new Point(120, 300), AbsoluteOffset = offset });
GUIListBox listBox = new GUIListBox(new RectTransform(new Vector2(0.9f, 0.9f), frame.RectTransform, Anchor.Center))
{
PlaySoundOnSelect = true,
OnSelected = SelectWire,
OnSelected = onWireSelected,
CanTakeKeyBoardFocus = false
};
@@ -4326,12 +4343,14 @@ namespace Barotrauma
foreach (ItemPrefab itemPrefab in ItemPrefab.Prefabs)
{
if (itemPrefab.Name.IsNullOrEmpty() || itemPrefab.HideInMenus) { continue; }
if (!itemPrefab.Tags.Contains("wire")) { continue; }
if (itemPrefab.Name.IsNullOrEmpty() || itemPrefab.HideInMenus || itemPrefab.HideInEditors) { continue; }
if (!itemPrefab.Tags.Contains(Tags.WireItem)) { continue; }
if (CircuitBox.IsInGame() && itemPrefab.Tags.Contains(Tags.Thalamus)) { continue; }
wirePrefabs.Add(itemPrefab);
}
foreach (ItemPrefab itemPrefab in wirePrefabs.OrderBy(w => !w.CanBeBought).ThenBy(w => w.UintIdentifier))
foreach (ItemPrefab itemPrefab in wirePrefabs.OrderBy(static w => !w.CanBeBought).ThenBy(static w => w.UintIdentifier))
{
GUIFrame imgFrame = new GUIFrame(new RectTransform(new Point(listBox.Content.Rect.Width, listBox.Rect.Width / 2), listBox.Content.RectTransform), style: "ListBoxElement")
{
@@ -4396,7 +4415,7 @@ namespace Barotrauma
{
if (dummyCharacter == null || itemContainer == null) { return; }
if (((itemContainer.GetComponent<Holdable>() is { } holdable && !holdable.Attached) || itemContainer.GetComponent<Wearable>() != null) && itemContainer.GetComponent<ItemContainer>() != null)
if ((itemContainer.GetComponent<Holdable>() is { Attached: false } || itemContainer.GetComponent<Wearable>() != null) && itemContainer.GetComponent<ItemContainer>() != null)
{
// We teleport our dummy character to the item so it appears as the entity stays still when in reality the dummy is holding it
oldItemPosition = itemContainer.SimPosition;
@@ -4617,9 +4636,9 @@ namespace Barotrauma
public void AutoHull()
{
for (int i = 0; i < MapEntity.mapEntityList.Count; i++)
for (int i = 0; i < MapEntity.MapEntityList.Count; i++)
{
MapEntity h = MapEntity.mapEntityList[i];
MapEntity h = MapEntity.MapEntityList[i];
if (h is Hull || h is Gap)
{
h.Remove();
@@ -4632,7 +4651,7 @@ namespace Barotrauma
List<MapEntity> mapEntityList = new List<MapEntity>();
foreach (MapEntity e in MapEntity.mapEntityList)
foreach (MapEntity e in MapEntity.MapEntityList)
{
if (e is Item it)
{
@@ -5089,10 +5108,12 @@ namespace Barotrauma
layerGroup.Recalculate();
new GUITextBlock(new RectTransform(new Vector2(0.6f, 1f), layerGroup.RectTransform), layer, textAlignment: Alignment.CenterLeft)
var textBlock = new GUITextBlock(new RectTransform(new Vector2(0.6f, 1f), layerGroup.RectTransform), layer, textAlignment: Alignment.CenterLeft);
if (textBlock.TextSize.X > textBlock.Rect.Width)
{
CanBeFocused = false
};
textBlock.ToolTip = textBlock.Text;
textBlock.Text = ToolBox.LimitString(textBlock.Text, textBlock.Font, textBlock.Rect.Width);
}
layerGroup.Recalculate();
layerChainLayout.Recalculate();
@@ -5215,7 +5236,7 @@ namespace Barotrauma
var highlightedEntities = new List<MapEntity>();
// ReSharper disable once LoopCanBeConvertedToQuery
foreach (Item item in MapEntity.mapEntityList.Where(entity => entity is Item).Cast<Item>())
foreach (Item item in MapEntity.MapEntityList.Where(entity => entity is Item).Cast<Item>())
{
var wire = item.GetComponent<Wire>();
if (wire == null || !wire.IsMouseOn()) { continue; }
@@ -5228,8 +5249,9 @@ namespace Barotrauma
hullVolumeFrame.Visible = MapEntity.SelectedList.Any(s => s is Hull);
hullVolumeFrame.RectTransform.AbsoluteOffset = new Point(Math.Max(showEntitiesPanel.Rect.Right, previouslyUsedPanel.Rect.Right), 0);
saveAssemblyFrame.Visible = MapEntity.SelectedList.Count > 0 && !WiringMode;
snapToGridFrame.Visible = MapEntity.SelectedList.Count > 0 && !WiringMode;
bool isCircuitBoxOpened = dummyCharacter?.SelectedItem?.GetComponent<CircuitBox>() is not null;
saveAssemblyFrame.Visible = MapEntity.SelectedList.Count > 0 && !WiringMode && !isCircuitBoxOpened;
snapToGridFrame.Visible = MapEntity.SelectedList.Count > 0 && !WiringMode && !isCircuitBoxOpened;
var offset = cam.WorldView.Top - cam.ScreenToWorld(new Vector2(0, GameMain.GraphicsHeight - EntityMenu.Rect.Top)).Y;
@@ -5288,7 +5310,7 @@ namespace Barotrauma
{
if (wiringToolPanel.GetChild<GUIListBox>() is { } listBox)
{
if (!dummyCharacter.HeldItems.Any(it => it.HasTag("wire")))
if (!dummyCharacter.HeldItems.Any(it => it.HasTag(Tags.WireItem)))
{
listBox.Deselect();
}
@@ -5397,7 +5419,7 @@ namespace Barotrauma
}
else
{
var selectables = MapEntity.mapEntityList.Where(entity => entity.SelectableInEditor).ToList();
var selectables = MapEntity.MapEntityList.Where(entity => entity.SelectableInEditor).ToList();
foreach (var item in Item.ItemList)
{
//attached wires are not normally selectable (by clicking),
@@ -5421,7 +5443,7 @@ namespace Barotrauma
}
else
{
cam.MoveCamera((float) deltaTime, allowMove: true, allowZoom: GUI.MouseOn == null);
cam.MoveCamera((float) deltaTime, allowMove: !CircuitBox.IsCircuitBoxSelected(dummyCharacter), allowZoom: GUI.MouseOn == null);
}
}
else
@@ -5429,7 +5451,7 @@ namespace Barotrauma
cam.MoveCamera((float) deltaTime, allowMove: false, allowZoom: GUI.MouseOn == null);
}
if (PlayerInput.MidButtonHeld())
if (PlayerInput.MidButtonHeld() && !CircuitBox.IsCircuitBoxSelected(dummyCharacter))
{
Vector2 moveSpeed = PlayerInput.MouseSpeed * (float)deltaTime * 60.0f / cam.Zoom;
moveSpeed.X = -moveSpeed.X;
@@ -5463,10 +5485,7 @@ namespace Barotrauma
{
if (WiringMode)
{
foreach (MapEntity me in MapEntity.mapEntityList)
{
me.IsHighlighted = false;
}
MapEntity.ClearHighlightedEntities();
if (dummyCharacter.SelectedItem == null)
{
@@ -5951,13 +5970,10 @@ namespace Barotrauma
}
}
if (dummyCharacter != null)
if (DrawCharacterInventory)
{
if (WiringMode)
{
dummyCharacter.DrawHUD(spriteBatch, cam, false);
wiringToolPanel.DrawManually(spriteBatch);
}
dummyCharacter.DrawHUD(spriteBatch, cam, false);
wiringToolPanel.DrawManually(spriteBatch);
}
MapEntity.DrawEditor(spriteBatch, cam);
@@ -5994,10 +6010,7 @@ namespace Barotrauma
private void CreateImage(int width, int height, System.IO.Stream stream)
{
MapEntity.SelectedList.Clear();
foreach (MapEntity me in MapEntity.mapEntityList)
{
me.IsHighlighted = false;
}
MapEntity.ClearHighlightedEntities();
var prevScissorRect = GameMain.Instance.GraphicsDevice.ScissorRectangle;
@@ -6040,16 +6053,21 @@ namespace Barotrauma
private void DrawGrid(SpriteBatch spriteBatch)
{
// don't render at high zoom levels because it would just turn the screen white
if (cam.Zoom < 0.5f || !ShouldDrawGrid) { return; }
if (!ShouldDrawGrid) { return; }
var (gridX, gridY) = Submarine.GridSize;
DrawGrid(spriteBatch, cam, gridX, gridY, zoomTreshold: true);
}
public static void DrawGrid(SpriteBatch spriteBatch, Camera cam, float sizeX, float sizeY, bool zoomTreshold)
{
if (zoomTreshold && cam.Zoom < 0.5f) { return; }
int scale = Math.Max(1, GUI.IntScale(1));
float zoom = cam.Zoom / 2f; // Don't ask
float lineThickness = Math.Max(1, scale / zoom);
Color gridColor = gridBaseColor;
if (cam.Zoom < 1.0f)
if (zoomTreshold && cam.Zoom < 1.0f)
{
// fade the grid when zooming out
gridColor *= Math.Max(0, (cam.Zoom - 0.5f) * 2f);
@@ -6057,18 +6075,66 @@ namespace Barotrauma
Rectangle camRect = cam.WorldView;
for (float x = snapX(camRect.X); x < snapX(camRect.X + camRect.Width) + gridX; x += gridX)
for (float x = snapX(camRect.X); x < snapX(camRect.X + camRect.Width) + sizeX; x += sizeX)
{
spriteBatch.DrawLine(new Vector2(x, -camRect.Y), new Vector2(x, -(camRect.Y - camRect.Height)), gridColor, thickness: lineThickness);
}
for (float y = snapY(camRect.Y); y >= snapY(camRect.Y - camRect.Height) - gridY; y -= Submarine.GridSize.Y)
for (float y = snapY(camRect.Y); y >= snapY(camRect.Y - camRect.Height) - sizeY; y -= sizeY)
{
spriteBatch.DrawLine(new Vector2(camRect.X, -y), new Vector2(camRect.Right, -y), gridColor, thickness: lineThickness);
}
float snapX(int x) => (float) Math.Floor(x / gridX) * gridX;
float snapY(int y) => (float) Math.Ceiling(y / gridY) * gridY;
float snapX(int x) => (float) Math.Floor(x / sizeX) * sizeX;
float snapY(int y) => (float) Math.Ceiling(y / sizeY) * sizeY;
}
public static void DrawOutOfBoundsArea(SpriteBatch spriteBatch, Camera cam, float playableAreaSize, Color color)
{
Rectangle camRect = cam.WorldView;
RectangleF playableArea = new RectangleF(
-playableAreaSize / 2f,
-playableAreaSize / 2f,
playableAreaSize,
playableAreaSize
);
RectangleF topRect = new(
camRect.Left,
-camRect.Top,
camRect.Width,
playableArea.Top + camRect.Top
);
// idk why camRect.Bottom doesn't work here
float camRectBottom = -camRect.Top + camRect.Height;
RectangleF bottomRect = new(
camRect.Left,
playableArea.Bottom,
camRect.Width,
camRectBottom + playableArea.Bottom
);
RectangleF rightRect = new(
playableArea.Right,
playableArea.Top,
camRect.Right - playableArea.Right,
playableArea.Height
);
RectangleF leftRect = new(
playableArea.Left,
playableArea.Top,
camRect.Left - playableArea.Left,
playableArea.Height
);
GUI.DrawFilledRectangle(spriteBatch, topRect, color);
GUI.DrawFilledRectangle(spriteBatch, leftRect, color);
GUI.DrawFilledRectangle(spriteBatch, rightRect, color);
GUI.DrawFilledRectangle(spriteBatch, bottomRect, color);
}
public void SaveScreenShot(int width, int height, string filePath)
@@ -6119,7 +6185,7 @@ namespace Barotrauma
public static ImmutableHashSet<MapEntity> GetEntitiesInSameLayer(MapEntity entity)
{
if (string.IsNullOrWhiteSpace(entity.Layer)) { return ImmutableHashSet<MapEntity>.Empty; }
return MapEntity.mapEntityList.Where(me => me.Layer == entity.Layer).ToImmutableHashSet();
return MapEntity.MapEntityList.Where(me => me.Layer == entity.Layer).ToImmutableHashSet();
}
}
}