diff --git a/Content.Client/UserInterface/Systems/Storage/Controls/StorageWindow.cs b/Content.Client/UserInterface/Systems/Storage/Controls/StorageWindow.cs index a4afebc217..39ffd883bb 100644 --- a/Content.Client/UserInterface/Systems/Storage/Controls/StorageWindow.cs +++ b/Content.Client/UserInterface/Systems/Storage/Controls/StorageWindow.cs @@ -42,6 +42,9 @@ public sealed class StorageWindow : BaseWindow private ValueList _contained = new(); private ValueList _toRemove = new(); + // Manually store this because you can't have a 0x0 GridContainer but we still need to add child controls for 1x1 containers. + private Vector2i _pieceGridSize; + private TextureButton? _backButton; private bool _isDirty; @@ -408,11 +411,14 @@ public sealed class StorageWindow : BaseWindow _contained.Clear(); _contained.AddRange(storageComp.Container.ContainedEntities.Reverse()); + var width = boundingGrid.Width + 1; + var height = boundingGrid.Height + 1; + // Build the grid representation - if (_pieceGrid.Rows - 1 != boundingGrid.Height || _pieceGrid.Columns - 1 != boundingGrid.Width) + if (_pieceGrid.Rows != _pieceGridSize.Y || _pieceGrid.Columns != _pieceGridSize.X) { - _pieceGrid.Rows = boundingGrid.Height + 1; - _pieceGrid.Columns = boundingGrid.Width + 1; + _pieceGrid.Rows = height; + _pieceGrid.Columns = width; _controlGrid.Clear(); for (var y = boundingGrid.Bottom; y <= boundingGrid.Top; y++) @@ -430,6 +436,7 @@ public sealed class StorageWindow : BaseWindow } } + _pieceGridSize = new(width, height); _toRemove.Clear(); // Remove entities no longer relevant / Update existing ones diff --git a/Content.Server/Chat/Managers/ChatManager.cs b/Content.Server/Chat/Managers/ChatManager.cs index 75c46abe37..c86ff802ce 100644 --- a/Content.Server/Chat/Managers/ChatManager.cs +++ b/Content.Server/Chat/Managers/ChatManager.cs @@ -246,7 +246,7 @@ internal sealed partial class ChatManager : IChatManager Color? colorOverride = null; var wrappedMessage = Loc.GetString("chat-manager-send-ooc-wrap-message", ("playerName",player.Name), ("message", FormattedMessage.EscapeText(message))); - if (_adminManager.HasAdminFlag(player, AdminFlags.Admin)) + if (_adminManager.HasAdminFlag(player, AdminFlags.NameColor)) { var prefs = _preferencesManager.GetPreferences(player.UserId); colorOverride = prefs.AdminOOCColor; diff --git a/Content.Server/Teleportation/HandTeleporterSystem.cs b/Content.Server/Teleportation/HandTeleporterSystem.cs index 5c9baf1854..aa4f7eec82 100644 --- a/Content.Server/Teleportation/HandTeleporterSystem.cs +++ b/Content.Server/Teleportation/HandTeleporterSystem.cs @@ -95,6 +95,10 @@ public sealed class HandTeleporterSystem : EntitySystem var timeout = EnsureComp(user); timeout.EnteredPortal = null; component.FirstPortal = Spawn(component.FirstPortalPrototype, Transform(user).Coordinates); + + if (component.AllowPortalsOnDifferentMaps && TryComp(component.FirstPortal, out var portal)) + portal.CanTeleportToOtherMaps = true; + _adminLogger.Add(LogType.EntitySpawn, LogImpact.High, $"{ToPrettyString(user):player} opened {ToPrettyString(component.FirstPortal.Value)} at {Transform(component.FirstPortal.Value).Coordinates} using {ToPrettyString(uid)}"); _audio.PlayPvs(component.NewPortalSound, uid); } @@ -113,6 +117,10 @@ public sealed class HandTeleporterSystem : EntitySystem var timeout = EnsureComp(user); timeout.EnteredPortal = null; component.SecondPortal = Spawn(component.SecondPortalPrototype, Transform(user).Coordinates); + + if (component.AllowPortalsOnDifferentMaps && TryComp(component.SecondPortal, out var portal)) + portal.CanTeleportToOtherMaps = true; + _adminLogger.Add(LogType.EntitySpawn, LogImpact.High, $"{ToPrettyString(user):player} opened {ToPrettyString(component.SecondPortal.Value)} at {Transform(component.SecondPortal.Value).Coordinates} linked to {ToPrettyString(component.FirstPortal!.Value)} using {ToPrettyString(uid)}"); _link.TryLink(component.FirstPortal!.Value, component.SecondPortal.Value, true); _audio.PlayPvs(component.NewPortalSound, uid); diff --git a/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs b/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs index 6ea29d3fd6..ea1aa492f3 100644 --- a/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs +++ b/Content.Shared/Teleportation/Components/HandTeleporterComponent.cs @@ -21,11 +21,17 @@ public sealed partial class HandTeleporterComponent : Component public EntityUid? SecondPortal = null; /// - /// Portals can't be placed on different grids? + /// Should the portals be able to be placed across grids? /// [DataField] public bool AllowPortalsOnDifferentGrids; + /// + /// Should the portals work across maps? + /// + [DataField] + public bool AllowPortalsOnDifferentMaps; + [DataField("firstPortalPrototype", customTypeSerializer: typeof(PrototypeIdSerializer))] public string FirstPortalPrototype = "PortalRed"; diff --git a/Resources/Prototypes/Entities/Objects/Devices/hand_teleporter.yml b/Resources/Prototypes/Entities/Objects/Devices/hand_teleporter.yml index 192aca65fc..f6e30d1e97 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/hand_teleporter.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/hand_teleporter.yml @@ -28,5 +28,7 @@ - state: icon color: green - type: HandTeleporter + allowPortalsOnDifferentGrids: true + allowPortalsOnDifferentMaps: true firstPortalPrototype: PortalGatewayBlue secondPortalPrototype: PortalGatewayOrange