]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove storage hotbar GUI bandaid (#35054)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Thu, 20 Feb 2025 16:51:01 +0000 (03:51 +1100)
committerGitHub <noreply@github.com>
Thu, 20 Feb 2025 16:51:01 +0000 (17:51 +0100)
* Remove storage hotbar GUI bandaid

With BUI deferred opens it also happened to fix this issue which is nice.

* Update Content.Client/Storage/StorageBoundUserInterface.cs

Content.Client/Storage/StorageBoundUserInterface.cs
Content.Client/UserInterface/Systems/Storage/StorageUIController.cs

index 16545c357847535192f6e849744b2592e954f1b0..8cb415dead5db8a22c821d803b277c5494b225c2 100644 (file)
@@ -92,12 +92,5 @@ public sealed class StorageBoundUserInterface : BoundUserInterface
         Show();
         LayoutContainer.SetPosition(_window, position);
     }
-
-    public void ReOpen()
-    {
-        _window?.Orphan();
-        _window = null;
-        Open();
-    }
 }
 
index dbb16ab24acb022b7c0ef8c8f58cd3fb9144417b..768a434d83757757ad46f27bc8740715bc20e517 100644 (file)
@@ -61,39 +61,11 @@ public sealed class StorageUIController : UIController, IOnSystemChanged<Storage
     {
         base.Initialize();
 
-        UIManager.OnScreenChanged += OnScreenChange;
-
         _configuration.OnValueChanged(CCVars.StaticStorageUI, OnStaticStorageChanged, true);
         _configuration.OnValueChanged(CCVars.OpaqueStorageWindow, OnOpaqueWindowChanged, true);
         _configuration.OnValueChanged(CCVars.StorageWindowTitle, OnStorageWindowTitle, true);
     }
 
-    private void OnScreenChange((UIScreen? Old, UIScreen? New) obj)
-    {
-        // Handle reconnects with hotbargui.
-
-        // Essentially HotbarGui / the screen gets loaded AFTER gamestates at the moment (because clientgameticker manually changes it via event)
-        // and changing this may be a massive change.
-        // So instead we'll just manually reload it for now.
-        if (!StaticStorageUIEnabled ||
-            obj.New == null ||
-            !EntityManager.TryGetComponent(_player.LocalEntity, out UserInterfaceUserComponent? userComp))
-        {
-            return;
-        }
-
-        // UISystemDependency not injected at this point so do it the old fashion way, I love ordering issues.
-        var uiSystem = EntityManager.System<SharedUserInterfaceSystem>();
-
-        foreach (var bui in uiSystem.GetActorUis((_player.LocalEntity.Value, userComp)))
-        {
-            if (!uiSystem.TryGetOpenUi<StorageBoundUserInterface>(bui.Entity, StorageComponent.StorageUiKey.Key, out var storageBui))
-                continue;
-
-            storageBui.ReOpen();
-        }
-    }
-
     private void OnStorageWindowTitle(bool obj)
     {
         WindowTitle = obj;