]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Revert "Storage sidebar fix (#34680)"
authorErrant <35878406+Errant-4@users.noreply.github.com>
Wed, 5 Feb 2025 13:12:52 +0000 (14:12 +0100)
committerErrant <35878406+Errant-4@users.noreply.github.com>
Wed, 5 Feb 2025 13:12:52 +0000 (14:12 +0100)
This reverts commit 3e091c4dfaf2c23dd469c3d2b8e0e66b292a596f.

Content.Client/UserInterface/Systems/Storage/Controls/StorageWindow.cs
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs

index 88b4c06d72c01664d7d7d938ada94653e409c271..4527ffd59a901e89fe095abc9d7f75cf16c8529c 100644 (file)
@@ -201,8 +201,7 @@ public sealed class StorageWindow : BaseWindow
 
         #region Sidebar
         _sidebar.Children.Clear();
-        var rows = boundingGrid.Height + 1;
-        _sidebar.Rows = rows;
+        _sidebar.Rows = boundingGrid.Height + 1;
 
         var exitButton = new TextureButton
         {
@@ -244,10 +243,12 @@ public sealed class StorageWindow : BaseWindow
         };
 
         _sidebar.AddChild(exitContainer);
-        var offset = 2;
+        var offset = 1;
 
-        if (_entity.System<StorageSystem>().NestedStorage && rows > 0)
+        if (_entity.System<StorageSystem>().NestedStorage && boundingGrid.Height > 0)
         {
+            offset += 1;
+
             _backButton = new TextureButton
             {
                 TextureNormal = _backTexture,
@@ -279,7 +280,7 @@ public sealed class StorageWindow : BaseWindow
                 {
                     new TextureRect
                     {
-                        Texture = rows > 2 ? _sidebarMiddleTexture : _sidebarBottomTexture,
+                        Texture = boundingGrid.Height > 2 ? _sidebarMiddleTexture : _sidebarBottomTexture,
                         TextureScale = new Vector2(2, 2),
                         Children =
                         {
@@ -292,13 +293,22 @@ public sealed class StorageWindow : BaseWindow
             _sidebar.AddChild(backContainer);
         }
 
-        var fillerRows = rows - offset;
+        var rows = boundingGrid.Height - offset;
+
+        for (var i = 0; i < rows; i++)
+        {
+            _sidebar.AddChild(new TextureRect
+            {
+                Texture = _sidebarMiddleTexture,
+                TextureScale = new Vector2(2, 2),
+            });
+        }
 
-        for (var i = 0; i < fillerRows; i++)
+        if (rows > 0)
         {
             _sidebar.AddChild(new TextureRect
             {
-                Texture = i != (fillerRows - 1) ? _sidebarMiddleTexture : _sidebarBottomTexture,
+                Texture = _sidebarBottomTexture,
                 TextureScale = new Vector2(2, 2),
             });
         }
index 7bf6d74c60b4d52ebc7de8772aeeda0c49de04f5..f156db506ad0cc875da6bc34d97c25397f5487a9 100644 (file)
@@ -1314,7 +1314,6 @@ public abstract class SharedStorageSystem : EntitySystem
         }
 
         Dirty(ent, ent.Comp);
-        UpdateUI((ent.Owner, ent.Comp));
     }
 
     /// <summary>