From d1989437c3938ea7c90dce64263fc9ad4fd551da Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 23 Jul 2026 20:11:36 -0400 Subject: [PATCH 1/3] sins --- Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs index 42605e24821..2ddfb9d327c 100644 --- a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs @@ -554,7 +554,8 @@ private void EnsureClientBui(Entity entity, Enum key, In if (!open) return; - AddQueued(boundUserInterface, QueuedUpdate.Open); + var state = entity.Comp.States.GetValueOrDefault(key); + AddQueued(boundUserInterface, QueuedUpdate.Open, state); } /// From 228fa9f69b3ac90f93b55c71b1144761100be008 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 23 Jul 2026 20:30:48 -0400 Subject: [PATCH 2/3] New AddQueuedState function, comment both --- .../Systems/SharedUserInterfaceSystem.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs index 2ddfb9d327c..9c4b504c4fa 100644 --- a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs @@ -91,11 +91,24 @@ public override void Initialize() SubscribeLocalEvent(OnActorShutdown); } + /// + /// Enqueues a BUI command to be processed in the next Update call. + /// private void AddQueued(BoundUserInterface bui, QueuedUpdate type, BoundUserInterfaceState? state = null) { _queuedBuis.Add((bui, type, state)); } + /// + /// Enqueues a BUI command to be processed in the next Update call, + /// getting the last available state for the given UserInterfaceComponent at the last state. + /// + private void AddQueuedState(BoundUserInterface bui, QueuedUpdate type, Entity ent, Enum key) + { + var state = ent.Comp.States.GetValueOrDefault(key); + _queuedBuis.Add((bui, type, state)); + } + /// /// Validates the received message, and then pass it onto systems/components /// @@ -292,8 +305,7 @@ private void OnUserInterfaceStartup(Entity ent, ref Comp // PlayerAttachedEvent will catch some of these. foreach (var (key, bui) in ent.Comp.ClientOpenInterfaces) { - var state = ent.Comp.States.GetValueOrDefault(key); - AddQueued(bui, QueuedUpdate.Open, state); + AddQueuedState(bui, QueuedUpdate.Open, ent, key); } } @@ -554,8 +566,7 @@ private void EnsureClientBui(Entity entity, Enum key, In if (!open) return; - var state = entity.Comp.States.GetValueOrDefault(key); - AddQueued(boundUserInterface, QueuedUpdate.Open, state); + AddQueuedState(boundUserInterface, QueuedUpdate.Open, entity, key); } /// From 90234583ac906e2819e49ce683f76b3a2d08de39 Mon Sep 17 00:00:00 2001 From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Thu, 23 Jul 2026 20:00:49 -0700 Subject: [PATCH 3/3] I like this name better actually --- .../Systems/SharedUserInterfaceSystem.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs index 9c4b504c4fa..0e0688ce988 100644 --- a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs @@ -92,20 +92,20 @@ public override void Initialize() } /// - /// Enqueues a BUI command to be processed in the next Update call. + /// Enqueues a BUI command to be processed in the next Update call, + /// getting the last available state for the given UserInterfaceComponent at the last state. /// - private void AddQueued(BoundUserInterface bui, QueuedUpdate type, BoundUserInterfaceState? state = null) + private void AddQueued(BoundUserInterface bui, QueuedUpdate type, Entity ent, Enum key) { + var state = ent.Comp.States.GetValueOrDefault(key); _queuedBuis.Add((bui, type, state)); } /// - /// Enqueues a BUI command to be processed in the next Update call, - /// getting the last available state for the given UserInterfaceComponent at the last state. + /// Enqueues a BUI command to be processed in the next Update call. /// - private void AddQueuedState(BoundUserInterface bui, QueuedUpdate type, Entity ent, Enum key) + private void AddQueued(BoundUserInterface bui, QueuedUpdate type, BoundUserInterfaceState? state = null) { - var state = ent.Comp.States.GetValueOrDefault(key); _queuedBuis.Add((bui, type, state)); } @@ -305,7 +305,7 @@ private void OnUserInterfaceStartup(Entity ent, ref Comp // PlayerAttachedEvent will catch some of these. foreach (var (key, bui) in ent.Comp.ClientOpenInterfaces) { - AddQueuedState(bui, QueuedUpdate.Open, ent, key); + AddQueued(bui, QueuedUpdate.Open, ent, key); } } @@ -566,7 +566,7 @@ private void EnsureClientBui(Entity entity, Enum key, In if (!open) return; - AddQueuedState(boundUserInterface, QueuedUpdate.Open, entity, key); + AddQueued(boundUserInterface, QueuedUpdate.Open, entity, key); } ///