diff --git a/Content.Client/Buckle/BuckleSystem.cs b/Content.Client/Buckle/BuckleSystem.cs index 4429996aca3..c26976ffbe4 100644 --- a/Content.Client/Buckle/BuckleSystem.cs +++ b/Content.Client/Buckle/BuckleSystem.cs @@ -15,9 +15,41 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnHandleState); SubscribeLocalEvent(OnAppearanceChange); SubscribeLocalEvent(OnStrapMoveEvent); + SubscribeLocalEvent(OnBuckledEvent); + SubscribeLocalEvent(OnUnbuckledEvent); + } + + /// + /// Is the strap entity already rotated north? Lower the draw depth of the buckled entity. + /// + private void OnBuckledEvent(Entity ent, ref BuckledEvent args) + { + if (!TryComp(args.Strap, out var strapSprite) || + !TryComp(ent.Owner, out var buckledSprite)) + return; + + if (Transform(args.Strap.Owner).LocalRotation.GetCardinalDir() == Direction.North) + { + ent.Comp.OriginalDrawDepth ??= buckledSprite.DrawDepth; + buckledSprite.DrawDepth = strapSprite.DrawDepth - 1; + } + } + + /// + /// Was the draw depth of the buckled entity lowered? Reset it upon unbuckling. + /// + private void OnUnbuckledEvent(Entity ent, ref UnbuckledEvent args) + { + if (!TryComp(ent.Owner, out var buckledSprite)) + return; + + if (ent.Comp.OriginalDrawDepth.HasValue) + { + buckledSprite.DrawDepth = ent.Comp.OriginalDrawDepth.Value; + ent.Comp.OriginalDrawDepth = null; + } } private void OnStrapMoveEvent(EntityUid uid, StrapComponent component, ref MoveEvent args) @@ -57,21 +89,6 @@ private void OnStrapMoveEvent(EntityUid uid, StrapComponent component, ref MoveE } } - private void OnHandleState(Entity ent, ref ComponentHandleState args) - { - if (args.Current is not BuckleState state) - return; - - ent.Comp.DontCollide = state.DontCollide; - ent.Comp.BuckleTime = state.BuckleTime; - var strapUid = EnsureEntity(state.BuckledTo, ent); - - SetBuckledTo(ent, strapUid == null ? null : new (strapUid.Value, null)); - - var (uid, component) = ent; - - } - private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args) { if (!TryComp(uid, out var rotVisuals) diff --git a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs index 5a800d5c0eb..8e47d2ef267 100644 --- a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs +++ b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs @@ -340,6 +340,7 @@ private void UpdateAnchored(EntityUid uid, DisposalTubeComponent component, bool { if (!Resolve(target, ref targetTube)) return null; + var oppositeDirection = nextDirection.GetOpposite(); var xform = Transform(target); @@ -347,7 +348,7 @@ private void UpdateAnchored(EntityUid uid, DisposalTubeComponent component, bool return null; var position = xform.Coordinates; - var entities = _mapSystem.GetInDir(target, grid, position, nextDirection); + var entities = _mapSystem.GetInDir((EntityUid) xform.GridUid, grid, position, nextDirection); foreach (var entity in entities) { diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs index 38e39238039..e7c83c8ac6a 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs @@ -88,11 +88,13 @@ public void ExitDisposals(EntityUid uid, DisposalHolderComponent? holder = null, if (!Resolve(uid, ref holder, ref holderTransform)) return; + if (holder.IsExitingDisposals) { Log.Error("Tried exiting disposals twice. This should never happen."); return; } + holder.IsExitingDisposals = true; // Check for a disposal unit to throw them into and then eject them from it. @@ -164,11 +166,13 @@ public bool EnterTube(EntityUid holderUid, EntityUid toUid, DisposalHolderCompon { if (!Resolve(holderUid, ref holder, ref holderTransform)) return false; + if (holder.IsExitingDisposals) { Log.Error("Tried entering tube after exiting disposals. This should never happen."); return false; } + if (!Resolve(toUid, ref to, ref toTransform)) { ExitDisposals(holderUid, holder, holderTransform); @@ -193,6 +197,7 @@ public bool EnterTube(EntityUid holderUid, EntityUid toUid, DisposalHolderCompon holder.PreviousTube = holder.CurrentTube; holder.PreviousDirection = holder.CurrentDirection; } + holder.CurrentTube = toUid; var ev = new GetDisposalsNextDirectionEvent(holder); RaiseLocalEvent(toUid, ref ev); @@ -212,9 +217,7 @@ public bool EnterTube(EntityUid holderUid, EntityUid toUid, DisposalHolderCompon if (holder.CurrentDirection != holder.PreviousDirection) { foreach (var ent in holder.Container.ContainedEntities) - { _damageable.TryChangeDamage(ent, to.DamageOnTurn); - } _audio.PlayPvs(to.ClangSound, toUid); } @@ -225,9 +228,7 @@ public override void Update(float frameTime) { var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var holder)) - { UpdateComp(uid, holder, frameTime); - } } private void UpdateComp(EntityUid uid, DisposalHolderComponent holder, float frameTime) @@ -236,9 +237,7 @@ private void UpdateComp(EntityUid uid, DisposalHolderComponent holder, float fra { var time = frameTime; if (time > holder.TimeLeft) - { time = holder.TimeLeft; - } holder.TimeLeft -= time; frameTime -= time; @@ -268,7 +267,7 @@ private void UpdateComp(EntityUid uid, DisposalHolderComponent holder, float fra // Find next tube var nextTube = _disposalTubeSystem.NextTubeFor(currentTube, holder.CurrentDirection); - if (!EntityManager.EntityExists(nextTube)) + if (!EntityManager.EntityExists(nextTube)) { ExitDisposals(uid, holder); break; @@ -276,9 +275,7 @@ private void UpdateComp(EntityUid uid, DisposalHolderComponent holder, float fra // Perform remainder of entry process if (!EnterTube(uid, nextTube!.Value, holder)) - { break; - } } } } diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index 3c7636cfd07..842463140e4 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -517,7 +517,7 @@ public bool TryFlush(EntityUid uid, SharedDisposalUnitComponent component) return false; var coords = xform.Coordinates; - var entry = _sharedMapSystem.GetLocal(uid, grid, coords) + var entry = _sharedMapSystem.GetLocal((EntityUid) xform.GridUid, grid, coords) .FirstOrDefault(HasComp); if (entry == default || component is not DisposalUnitComponent sDisposals) diff --git a/Content.Server/MagicMirror/MagicMirrorSystem.cs b/Content.Server/MagicMirror/MagicMirrorSystem.cs index 6cbfc55cac0..b11e8ca707c 100644 --- a/Content.Server/MagicMirror/MagicMirrorSystem.cs +++ b/Content.Server/MagicMirror/MagicMirrorSystem.cs @@ -1,15 +1,12 @@ using System.Linq; using Content.Server.DoAfter; using Content.Server.Humanoid; -using Content.Shared.UserInterface; using Content.Shared.DoAfter; using Content.Shared.Humanoid; using Content.Shared.Humanoid.Markings; using Content.Shared.Interaction; using Content.Shared.MagicMirror; -using Robust.Server.GameObjects; using Robust.Shared.Audio.Systems; -using Robust.Shared.Player; namespace Content.Server.MagicMirror; @@ -22,14 +19,13 @@ public sealed class MagicMirrorSystem : SharedMagicMirrorSystem [Dependency] private readonly DoAfterSystem _doAfterSystem = default!; [Dependency] private readonly MarkingManager _markings = default!; [Dependency] private readonly HumanoidAppearanceSystem _humanoid = default!; - [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnOpenUIAttempt); - Subs.BuiEvents(MagicMirrorUiKey.Key, subs => + Subs.BuiEvents(MagicMirrorUiKey.Key, + subs => { subs.Event(OnUiClosed); subs.Event(OnMagicMirrorSelect); @@ -38,7 +34,6 @@ public override void Initialize() subs.Event(OnTryMagicMirrorRemoveSlot); }); - SubscribeLocalEvent(OnMagicMirrorInteract); SubscribeLocalEvent(OnSelectSlotDoAfter); SubscribeLocalEvent(OnChangeColorDoAfter); @@ -46,23 +41,6 @@ public override void Initialize() SubscribeLocalEvent(OnAddSlotDoAfter); } - private void OnMagicMirrorInteract(Entity mirror, ref AfterInteractEvent args) - { - if (!args.CanReach || args.Target == null) - return; - - if (!_uiSystem.TryOpenUi(mirror.Owner, MagicMirrorUiKey.Key, args.User)) - return; - - UpdateInterface(mirror.Owner, args.Target.Value, mirror.Comp); - } - - private void OnOpenUIAttempt(EntityUid uid, MagicMirrorComponent mirror, ActivatableUIOpenAttemptEvent args) - { - if (!HasComp(args.User)) - args.Cancel(); - } - private void OnMagicMirrorSelect(EntityUid uid, MagicMirrorComponent component, MagicMirrorSelectMessage message) { if (component.Target is not { } target) @@ -87,7 +65,8 @@ private void OnMagicMirrorSelect(EntityUid uid, MagicMirrorComponent component, BreakOnUserMove = true, BreakOnWeightlessMove = false, NeedHand = true - }, out var doAfterId); + }, + out var doAfterId); component.DoAfter = doAfterId; _audio.PlayPvs(component.ChangeHairSound, uid); @@ -143,7 +122,8 @@ private void OnTryMagicMirrorChangeColor(EntityUid uid, MagicMirrorComponent com BreakOnUserMove = true, BreakOnWeightlessMove = false, NeedHand = true - }, out var doAfterId); + }, + out var doAfterId); component.DoAfter = doAfterId; } @@ -198,7 +178,8 @@ private void OnTryMagicMirrorRemoveSlot(EntityUid uid, MagicMirrorComponent comp BreakOnUserMove = true, BreakOnWeightlessMove = false, NeedHand = true - }, out var doAfterId); + }, + out var doAfterId); component.DoAfter = doAfterId; _audio.PlayPvs(component.ChangeHairSound, uid); @@ -252,7 +233,8 @@ private void OnTryMagicMirrorAddSlot(EntityUid uid, MagicMirrorComponent compone BreakOnUserMove = true, BreakOnWeightlessMove = false, NeedHand = true - }, out var doAfterId); + }, + out var doAfterId); component.DoAfter = doAfterId; _audio.PlayPvs(component.ChangeHairSound, uid); @@ -287,32 +269,6 @@ private void OnAddSlotDoAfter(EntityUid uid, MagicMirrorComponent component, Mag } - private void UpdateInterface(EntityUid mirrorUid, EntityUid targetUid, MagicMirrorComponent component) - { - if (!TryComp(targetUid, out var humanoid)) - return; - - var hair = humanoid.MarkingSet.TryGetCategory(MarkingCategories.Hair, out var hairMarkings) - ? new List(hairMarkings) - : new(); - - var facialHair = humanoid.MarkingSet.TryGetCategory(MarkingCategories.FacialHair, out var facialHairMarkings) - ? new List(facialHairMarkings) - : new(); - - var state = new MagicMirrorUiState( - humanoid.Species, - hair, - humanoid.MarkingSet.PointsLeft(MarkingCategories.Hair) + hair.Count, - facialHair, - humanoid.MarkingSet.PointsLeft(MarkingCategories.FacialHair) + facialHair.Count); - - // TODO: Component states - component.Target = targetUid; - _uiSystem.SetUiState(mirrorUid, MagicMirrorUiKey.Key, state); - Dirty(mirrorUid, component); - } - private void OnUiClosed(Entity ent, ref BoundUIClosedEvent args) { ent.Comp.Target = null; diff --git a/Content.Server/StationEvents/Events/PirateRadioSpawnRule.cs b/Content.Server/StationEvents/Events/PirateRadioSpawnRule.cs index 60bf29b8f01..518d6409bf5 100644 --- a/Content.Server/StationEvents/Events/PirateRadioSpawnRule.cs +++ b/Content.Server/StationEvents/Events/PirateRadioSpawnRule.cs @@ -25,7 +25,7 @@ public sealed class PirateRadioSpawnRule : StationEventSystem().ToList()); + var salvPrototypes = _prototypeManager.EnumeratePrototypes().ToList(); + var salvageProto = _random.Pick(salvPrototypes); + + if (!_mapSystem.MapExists(GameTicker.DefaultMap)) + return; + + // Round didn't start before running this, leading to a null-space test fail. + if (GameTicker.DefaultMap == MapId.Nullspace) + return; + if (!_map.TryLoad(GameTicker.DefaultMap, salvageProto.MapPath.ToString(), out _, debrisOptions)) return; diff --git a/Content.Shared/Buckle/Components/BuckleComponent.cs b/Content.Shared/Buckle/Components/BuckleComponent.cs index ee86e6d4de0..55831515ede 100644 --- a/Content.Shared/Buckle/Components/BuckleComponent.cs +++ b/Content.Shared/Buckle/Components/BuckleComponent.cs @@ -9,7 +9,7 @@ namespace Content.Shared.Buckle.Components; /// /// This component allows an entity to be buckled to an entity with a . /// -[RegisterComponent, NetworkedComponent] +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause] [Access(typeof(SharedBuckleSystem))] public sealed partial class BuckleComponent : Component { @@ -19,7 +19,7 @@ public sealed partial class BuckleComponent : Component /// across a table two tiles away" problem. /// [DataField] - public float Range = SharedInteractionSystem.InteractionRange / 1.4f; + public float Range = SharedInteractionSystem.InteractionRange; /// /// True if the entity is buckled, false otherwise. @@ -30,7 +30,7 @@ public sealed partial class BuckleComponent : Component /// /// Whether or not collisions should be possible with the entity we are strapped to /// - [DataField] + [DataField, AutoNetworkedField] public bool DontCollide; /// @@ -49,13 +49,13 @@ public sealed partial class BuckleComponent : Component /// /// The time that this entity buckled at. /// - [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] + [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField, AutoNetworkedField] public TimeSpan? BuckleTime; /// /// The strap that this component is buckled to. /// - [DataField] + [DataField, AutoNetworkedField] public EntityUid? BuckledTo; /// @@ -71,15 +71,6 @@ public sealed partial class BuckleComponent : Component [ViewVariables] public int? OriginalDrawDepth; } -[Serializable, NetSerializable] -public sealed class BuckleState(NetEntity? buckledTo, bool dontCollide, TimeSpan? buckleTime) : ComponentState -{ - public readonly NetEntity? BuckledTo = buckledTo; - public readonly bool DontCollide = dontCollide; - public readonly TimeSpan? BuckleTime = buckleTime; -} - - /// /// Event raised directed at a strap entity before some entity gets buckled to it. /// diff --git a/Content.Shared/Buckle/Components/StrapComponent.cs b/Content.Shared/Buckle/Components/StrapComponent.cs index 0fbdae693de..79dc686c7d8 100644 --- a/Content.Shared/Buckle/Components/StrapComponent.cs +++ b/Content.Shared/Buckle/Components/StrapComponent.cs @@ -15,7 +15,7 @@ public sealed partial class StrapComponent : Component /// /// The entities that are currently buckled to this strap. /// - [ViewVariables] + [ViewVariables, AutoNetworkedField] public HashSet BuckledEntities = new(); /// @@ -61,12 +61,6 @@ public sealed partial class StrapComponent : Component [DataField, AutoNetworkedField] public bool Enabled = true; - /// - /// You can specify the offset the entity will have after unbuckling. - /// - [DataField] - public Vector2 UnbuckleOffset = Vector2.Zero; - /// /// The sound to be played when a mob is buckled /// diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index ed1b3c19906..59241499a11 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -54,9 +54,7 @@ private void InitializeBuckle() } private void OnBuckleComponentShutdown(Entity ent, ref ComponentShutdown args) - { - Unbuckle(ent!, null); - } + => Unbuckle(ent!, null); #region Pulling @@ -351,13 +349,12 @@ private void Buckle(Entity buckle, Entity strap SetBuckledTo(buckle, strap!); Appearance.SetData(strap, StrapVisuals.State, true); Appearance.SetData(buckle, BuckleVisuals.Buckled, true); - _rotationVisuals.SetHorizontalAngle(buckle.Owner, strap.Comp.Rotation); var xform = Transform(buckle); var coords = new EntityCoordinates(strap, strap.Comp.BuckleOffset); - _transform.SetCoordinates(buckle, xform, coords, rotation: Angle.Zero); + _transform.SetCoordinates(buckle, xform, coords, rotation: Angle.Zero); _joints.SetRelay(buckle, strap); switch (strap.Comp.Position) diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs b/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs index 59eff1f8c87..d4fd8eb3af8 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Interaction.cs @@ -19,6 +19,7 @@ private void InitializeInteraction() SubscribeLocalEvent(OnStrapDragDropTarget); SubscribeLocalEvent(OnCanDropTarget); + SubscribeLocalEvent(OnBuckleInteractHand); SubscribeLocalEvent>(AddUnbuckleVerb); } diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs b/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs index eb23aa973b4..bfb0cd9cd6f 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs @@ -57,7 +57,7 @@ private void StrapRemoveAll(EntityUid uid, StrapComponent strapComp) { foreach (var entity in strapComp.BuckledEntities.ToArray()) { - TryUnbuckle(entity, entity, true); + Unbuckle(entity, entity); } } diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 1c4a697cc4e..2bc256fd6ad 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -110,13 +110,17 @@ public override void Initialize() SubscribeLocalEvent(OnDropped); CommandBinds.Builder - .Bind(ContentKeyFunctions.AltActivateItemInWorld, + .Bind( + ContentKeyFunctions.AltActivateItemInWorld, new PointerInputCmdHandler(HandleAltUseInteraction)) - .Bind(EngineKeyFunctions.Use, + .Bind( + EngineKeyFunctions.Use, new PointerInputCmdHandler(HandleUseInteraction)) - .Bind(ContentKeyFunctions.ActivateItemInWorld, + .Bind( + ContentKeyFunctions.ActivateItemInWorld, new PointerInputCmdHandler(HandleActivateItemInWorld)) - .Bind(ContentKeyFunctions.TryPullObject, + .Bind( + ContentKeyFunctions.TryPullObject, new PointerInputCmdHandler(HandleTryPullObject)) .Register(); diff --git a/Content.Shared/MagicMirror/MagicMirrorComponent.cs b/Content.Shared/MagicMirror/MagicMirrorComponent.cs index 63575439052..95b17369795 100644 --- a/Content.Shared/MagicMirror/MagicMirrorComponent.cs +++ b/Content.Shared/MagicMirror/MagicMirrorComponent.cs @@ -47,5 +47,5 @@ public sealed partial class MagicMirrorComponent : Component /// Sound emitted when slots are changed /// [DataField, ViewVariables(VVAccess.ReadWrite)] - public SoundSpecifier ChangeHairSound = new SoundPathSpecifier("/Audio/Items/scissors.ogg"); + public SoundSpecifier? ChangeHairSound = new SoundPathSpecifier("/Audio/Items/scissors.ogg"); } diff --git a/Content.Shared/MagicMirror/SharedMagicMirrorSystem.cs b/Content.Shared/MagicMirror/SharedMagicMirrorSystem.cs index ea5838a723e..ea96d504c6e 100644 --- a/Content.Shared/MagicMirror/SharedMagicMirrorSystem.cs +++ b/Content.Shared/MagicMirror/SharedMagicMirrorSystem.cs @@ -1,6 +1,8 @@ using Content.Shared.DoAfter; +using Content.Shared.Humanoid; using Content.Shared.Humanoid.Markings; using Content.Shared.Interaction; +using Content.Shared.UserInterface; using Robust.Shared.Serialization; using Robust.Shared.Utility; @@ -9,13 +11,27 @@ namespace Content.Shared.MagicMirror; public abstract class SharedMagicMirrorSystem : EntitySystem { [Dependency] private readonly SharedInteractionSystem _interaction = default!; + [Dependency] protected readonly SharedUserInterfaceSystem UISystem = default!; public override void Initialize() { base.Initialize(); + SubscribeLocalEvent(OnMagicMirrorInteract); + SubscribeLocalEvent(OnBeforeUIOpen); SubscribeLocalEvent(OnMirrorRangeCheck); } + private void OnMagicMirrorInteract(Entity mirror, ref AfterInteractEvent args) + { + if (!args.CanReach || args.Target == null) + return; + + if (!UISystem.TryOpenUi(mirror.Owner, MagicMirrorUiKey.Key, args.User)) + return; + + UpdateInterface(mirror, args.Target.Value, mirror); + } + private void OnMirrorRangeCheck(EntityUid uid, MagicMirrorComponent component, ref BoundUserInterfaceCheckRangeEvent args) { if (args.Result == BoundUserInterfaceRangeResult.Fail) @@ -26,6 +42,41 @@ private void OnMirrorRangeCheck(EntityUid uid, MagicMirrorComponent component, r if (!_interaction.InRangeUnobstructed(uid, component.Target.Value)) args.Result = BoundUserInterfaceRangeResult.Fail; } + + private void OnBeforeUIOpen(Entity ent, ref BeforeActivatableUIOpenEvent args) + { + if (args.User != ent.Comp.Target && ent.Comp.Target != null) + return; + + UpdateInterface(ent, args.User, ent); + } + + protected void UpdateInterface(EntityUid mirrorUid, EntityUid targetUid, MagicMirrorComponent component) + { + if (!TryComp(targetUid, out var humanoid)) + return; + component.Target ??= targetUid; + + var hair = humanoid.MarkingSet.TryGetCategory(MarkingCategories.Hair, out var hairMarkings) + ? new List(hairMarkings) + : new(); + + var facialHair = humanoid.MarkingSet.TryGetCategory(MarkingCategories.FacialHair, out var facialHairMarkings) + ? new List(facialHairMarkings) + : new(); + + var state = new MagicMirrorUiState( + humanoid.Species, + hair, + humanoid.MarkingSet.PointsLeft(MarkingCategories.Hair) + hair.Count, + facialHair, + humanoid.MarkingSet.PointsLeft(MarkingCategories.FacialHair) + facialHair.Count); + + // TODO: Component states + component.Target = targetUid; + UISystem.SetUiState(mirrorUid, MagicMirrorUiKey.Key, state); + Dirty(mirrorUid, component); + } } [Serializable, NetSerializable] diff --git a/Content.Shared/Standing/StandingStateSystem.cs b/Content.Shared/Standing/StandingStateSystem.cs index a1b5418941a..562d9fe82b7 100644 --- a/Content.Shared/Standing/StandingStateSystem.cs +++ b/Content.Shared/Standing/StandingStateSystem.cs @@ -24,7 +24,7 @@ public sealed class StandingStateSystem : EntitySystem [Dependency] private readonly ClimbSystem _climb = default!; // If StandingCollisionLayer value is ever changed to more than one layer, the logic needs to be edited. - private const int StandingCollisionLayer = (int)CollisionGroup.MidImpassable; + private const int StandingCollisionLayer = (int) CollisionGroup.MidImpassable; public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null) { diff --git a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs index 2e800c386b9..771eaf023fd 100644 --- a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs @@ -374,13 +374,9 @@ private void OnActivate(EntityUid uid, StorageComponent storageComp, ActivateInW // Toggle if (_ui.IsUiOpen(uid, StorageComponent.StorageUiKey.Key, args.User)) - { _ui.CloseUi(uid, StorageComponent.StorageUiKey.Key, args.User); - } else - { OpenStorageUI(uid, args.User, storageComp); - } args.Handled = true; } diff --git a/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml b/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml index 1cfe98f0f65..e09997720d2 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/rollerbeds.yml @@ -54,7 +54,6 @@ position: Down rotation: -90 buckleOffset: "0,0.15" - unbuckleOffset: "0,0.15" buckleOnInteractHand: False - type: Appearance - type: GenericVisualizer diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml index d02bce020da..1fe3318ef55 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml @@ -11,7 +11,12 @@ - type: Clickable - type: Transform anchored: true - - type: MagicMirror + - type: MagicMirror #instant and silent + changeHairSound: null + addSlotTime: 0 + removeSlotTime: 0 + selectSlotTime: 0 + changeSlotTime: 0 - type: ActivatableUI key: enum.MagicMirrorUiKey.Key - type: UserInterface