Grid Inventory (#21931)

* Grid Inventory

* oh boy we keep cracking on

* auto insertion is kinda working? gross, too!

* pieces and proper layouts

* fix the sprites

* mousing over grid pieces... finally

* dragging deez nuts all over the screen

* eek!

* dragging is 90% less horrendous

* auto-rotating

* flatten

* Rotation at last

* fix rotation and change keybind for removing items.

* rebinding and keybinding

* wow! look at that! configurable with a button! cool!

* dragging is a bit cooler, eh?

* hover insert, my beloved

* add some grids for storage, fix 1x1 storages, fix multiple inputs at once

* el navigation

* oh yeah some stuff i forgor

* more fixes and QOL stuff

* the griddening

* the last of it (yippee)

* sloth review :)
This commit is contained in:
Nemanja
2023-12-04 18:04:39 -05:00
committed by GitHub
parent 4221ed2d4b
commit cc8984d096
99 changed files with 2014 additions and 619 deletions

View File

@@ -4,6 +4,8 @@ using Content.Client.UserInterface.Systems.Hands.Controls;
using Content.Client.UserInterface.Systems.Hotbar.Widgets;
using Content.Client.UserInterface.Systems.Inventory;
using Content.Client.UserInterface.Systems.Inventory.Controls;
using Content.Client.UserInterface.Systems.Storage;
using Content.Client.UserInterface.Systems.Storage.Controls;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controllers;
@@ -13,6 +15,7 @@ public sealed class HotbarUIController : UIController
{
private InventoryUIController? _inventory;
private HandsUIController? _hands;
private StorageUIController? _storage;
public override void Initialize()
{
@@ -27,12 +30,14 @@ public sealed class HotbarUIController : UIController
ReloadHotbar();
}
public void Setup(HandsContainer handsContainer, ItemSlotButtonContainer inventoryBar, ItemStatusPanel handStatus)
public void Setup(HandsContainer handsContainer, ItemSlotButtonContainer inventoryBar, ItemStatusPanel handStatus, StorageContainer storageContainer)
{
_inventory = UIManager.GetUIController<InventoryUIController>();
_hands = UIManager.GetUIController<HandsUIController>();
_storage = UIManager.GetUIController<StorageUIController>();
_hands.RegisterHandContainer(handsContainer);
_inventory.RegisterInventoryBarContainer(inventoryBar);
_storage.RegisterStorageContainer(storageContainer);
}
public void ReloadHotbar()

View File

@@ -1,6 +1,7 @@
<widgets:HotbarGui
xmlns="https://spacestation14.io"
xmlns:inventory="clr-namespace:Content.Client.UserInterface.Systems.Inventory.Controls"
xmlns:storage="clr-namespace:Content.Client.UserInterface.Systems.Storage.Controls"
xmlns:hands="clr-namespace:Content.Client.UserInterface.Systems.Hands.Controls"
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Hotbar.Widgets"
Name="HotbarInterface"
@@ -8,11 +9,21 @@
VerticalAlignment="Bottom"
Orientation="Vertical"
HorizontalAlignment="Center">
<inventory:ItemStatusPanel
Name="StatusPanel"
Visible="False"
HorizontalAlignment="Center"
/>
<Control HorizontalAlignment="Center">
<inventory:ItemStatusPanel
Name="StatusPanel"
Visible="False"
HorizontalAlignment="Center"
/>
<BoxContainer Name="StorageContainer"
Access="Public"
HorizontalAlignment="Center"
Margin="10">
<storage:StorageContainer
Name="StoragePanel"
Visible="False"/>
</BoxContainer>
</Control>
<inventory:ItemSlotButtonContainer
Name="InventoryHotbar"
Access="Public"

View File

@@ -13,7 +13,7 @@ public sealed partial class HotbarGui : UIWidget
StatusPanel.Update(null);
var hotbarController = UserInterfaceManager.GetUIController<HotbarUIController>();
hotbarController.Setup(HandContainer, InventoryHotbar, StatusPanel);
hotbarController.Setup(HandContainer, InventoryHotbar, StatusPanel, StoragePanel);
LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.Begin);
}