From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:37:51 +0000 (-0500) Subject: Even spaced hotbar (#22252) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=b37b988ce36cd73cc15f321ecd36c89d84476841;p=space-station-14.git Even spaced hotbar (#22252) * Fix spacing on hotbar * more tweaksies --- diff --git a/Content.Client/UserInterface/Systems/Hands/Controls/HandsContainer.cs b/Content.Client/UserInterface/Systems/Hands/Controls/HandsContainer.cs index 4f97adeca8..1421e302b8 100644 --- a/Content.Client/UserInterface/Systems/Hands/Controls/HandsContainer.cs +++ b/Content.Client/UserInterface/Systems/Hands/Controls/HandsContainer.cs @@ -10,6 +10,8 @@ public sealed class HandsContainer : ItemSlotUIContainer public int ColumnLimit { get => _grid.Columns; set => _grid.Columns = value; } public int MaxButtonCount { get; set; } = 0; + public int MaxButtonsPerRow { get; set; }= 6; + /// /// Indexer. This is used to reference a HandsContainer from the /// controller. @@ -36,6 +38,7 @@ public sealed class HandsContainer : ItemSlotUIContainer _grid.AddChild(newButton); } + _grid.Columns = Math.Min(_grid.ChildCount, MaxButtonsPerRow); return base.AddButton(newButton); } diff --git a/Content.Client/UserInterface/Systems/Hotbar/Widgets/HotbarGui.xaml b/Content.Client/UserInterface/Systems/Hotbar/Widgets/HotbarGui.xaml index a760de7430..04b606de08 100644 --- a/Content.Client/UserInterface/Systems/Hotbar/Widgets/HotbarGui.xaml +++ b/Content.Client/UserInterface/Systems/Hotbar/Widgets/HotbarGui.xaml @@ -24,39 +24,46 @@ Visible="False"/> - - + - - + Margin="0 0 0 4" + /> + + + + + diff --git a/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotUIContainer.cs b/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotUIContainer.cs index 6a2e3fa5cb..d44a4a2d76 100644 --- a/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotUIContainer.cs +++ b/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotUIContainer.cs @@ -68,6 +68,7 @@ public abstract class ItemSlotUIContainer : GridContainer, IItemslotUIContain { if (!Children.Contains(newButton) && newButton.Parent == null && newButton.SlotName != "") AddChild(newButton); + Columns = ChildCount; return AddButtonToDict(newButton); } diff --git a/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml index b41fc3a0ef..b2559d6f17 100644 --- a/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml @@ -53,14 +53,6 @@ uiWindowPos: 1,0 strippingWindowPos: 1,0 displayName: Head - - name: suitstorage - slotTexture: suit_storage - slotFlags: SUITSTORAGE - stripTime: 3 - uiWindowPos: 2,0 - strippingWindowPos: 2,5 - dependsOn: outerClothing - displayName: Suit Storage - name: id slotTexture: id slotFlags: IDCARD @@ -103,11 +95,9 @@ uiWindowPos: 0,4 strippingWindowPos: 0,5 displayName: Pocket 3 - - name: outerClothing slotTexture: suit slotFlags: OUTERCLOTHING - slotGroup: SecondHotbar stripTime: 6 uiWindowPos: 1,2 strippingWindowPos: 1,2 @@ -132,3 +122,12 @@ dependsOn: jumpsuit displayName: Pocket 2 stripHidden: true + - name: suitstorage + slotTexture: suit_storage + slotFlags: SUITSTORAGE + slotGroup: MainHotbar + stripTime: 3 + uiWindowPos: 2,0 + strippingWindowPos: 2,5 + dependsOn: outerClothing + displayName: Suit Storage diff --git a/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml index e980a14bbb..227624c690 100644 --- a/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/corpse_inventory_template.yml @@ -18,7 +18,6 @@ - name: outerClothing slotTexture: suit slotFlags: OUTERCLOTHING - slotGroup: MainHotbar stripTime: 6 uiWindowPos: 1,2 strippingWindowPos: 1,2 @@ -77,6 +76,7 @@ - name: suitstorage slotTexture: suit_storage slotFlags: SUITSTORAGE + slotGroup: MainHotbar stripTime: 3 uiWindowPos: 2,0 strippingWindowPos: 2,5 diff --git a/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml index e7ce6ccfa1..3fcbd8df6b 100644 --- a/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/diona_inventory_template.yml @@ -12,7 +12,6 @@ - name: outerClothing slotTexture: suit slotFlags: OUTERCLOTHING - slotGroup: MainHotbar stripTime: 6 uiWindowPos: 1,2 strippingWindowPos: 1,2 @@ -78,6 +77,7 @@ - name: suitstorage slotTexture: suit_storage slotFlags: SUITSTORAGE + slotGroup: MainHotbar stripTime: 3 uiWindowPos: 2,0 strippingWindowPos: 2,5 diff --git a/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml index 3c7df3cc57..aaf22ac34c 100644 --- a/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/human_inventory_template.yml @@ -18,7 +18,6 @@ - name: outerClothing slotTexture: suit slotFlags: OUTERCLOTHING - slotGroup: MainHotbar stripTime: 6 uiWindowPos: 1,2 strippingWindowPos: 1,2 @@ -84,6 +83,7 @@ - name: suitstorage slotTexture: suit_storage slotFlags: SUITSTORAGE + slotGroup: MainHotbar stripTime: 3 uiWindowPos: 2,0 strippingWindowPos: 2,5 diff --git a/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml index d6b53d0772..121648ebab 100644 --- a/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml +++ b/Resources/Prototypes/InventoryTemplates/monkey_inventory_template.yml @@ -4,14 +4,12 @@ - name: head slotTexture: head slotFlags: HEAD - slotGroup: MainHotbar uiWindowPos: 0,0 strippingWindowPos: 0,0 displayName: Head - name: ears slotTexture: ears slotFlags: EARS - slotGroup: MainHotbar stripTime: 3 uiWindowPos: 1,2 strippingWindowPos: 1,2 @@ -47,6 +45,7 @@ - name: suitstorage slotTexture: suit_storage slotFlags: SUITSTORAGE + slotGroup: MainHotbar stripTime: 3 uiWindowPos: 2,0 strippingWindowPos: 2,5 @@ -55,7 +54,6 @@ - name: outerClothing slotTexture: suit slotFlags: OUTERCLOTHING - slotGroup: MainHotbar stripTime: 6 uiWindowPos: 1,3 strippingWindowPos: 1,3