* THE RETURN OF ITEM STATUS Item status is now inline with the hands again. You can now see item status for both hands at once. If you have more than 2 hands, the last active hand of that side is displayed in the respective item status. The item status for the active hand is also highlighted. Item status has been given a new look so it looks unique and matches every UI theme. * Shrink item status to 125px This is going to require fixing the existing controls. Do that later. * New bullet item status rendering sex * Make gun item status look just a little bit nicer. Avoid only one or two bullets ending up on a single row of an item status. * Delete Eris theme files * More improvements Fixed the fact that left/right were flipped around when assigning status panel locations. Involved renaming all the UI textures. Redid how content margins are set from the theme. Less complex and cleaner now. Made the item name always left-aligned, just looks better since other UI elements don't adapt anyways. * Compact down item status text Now it fits 3 lines of text on one line. Yay. This is achieved by compacting RichTextLabels by reducing their line height and giving them a negative bottom margin. * Add item status sprites for Ashen theme. * Add status control to show beaker/bucket/jug solution/transfer volumes Also PollingItemStatusControl I'll be using that more. * Fix welder item status, clean up welder code The item status control implementation was ancient and bad. That's why it was buggy. Removed all the complex dated networking stuff for welders, we just sync the solution contents now anyways so none of that is needed anymore. This moves a buncha stuff to shared and just removes code. Cleanup. The code was doing some really dumb stuff. * Spray bottles show contents in item status. * cowtools * Fix plasmafire and clockwork themes. Actual git gaslighting wtf. --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
95 lines
2.9 KiB
C#
95 lines
2.9 KiB
C#
using Content.Client.UserInterface.Systems.Gameplay;
|
|
using Content.Client.UserInterface.Systems.Hands;
|
|
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.Inventory.Widgets;
|
|
using Content.Client.UserInterface.Systems.Storage;
|
|
using Content.Client.UserInterface.Systems.Storage.Controls;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controllers;
|
|
|
|
namespace Content.Client.UserInterface.Systems.Hotbar;
|
|
|
|
public sealed class HotbarUIController : UIController
|
|
{
|
|
private InventoryUIController? _inventory;
|
|
private HandsUIController? _hands;
|
|
private StorageUIController? _storage;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
var gameplayStateLoad = UIManager.GetUIController<GameplayStateLoadController>();
|
|
gameplayStateLoad.OnScreenLoad += OnScreenLoad;
|
|
}
|
|
|
|
private void OnScreenLoad()
|
|
{
|
|
ReloadHotbar();
|
|
}
|
|
|
|
public void Setup(HandsContainer handsContainer, StorageContainer storageContainer)
|
|
{
|
|
_inventory = UIManager.GetUIController<InventoryUIController>();
|
|
_hands = UIManager.GetUIController<HandsUIController>();
|
|
_storage = UIManager.GetUIController<StorageUIController>();
|
|
_hands.RegisterHandContainer(handsContainer);
|
|
_storage.RegisterStorageContainer(storageContainer);
|
|
}
|
|
|
|
public void ReloadHotbar()
|
|
{
|
|
if (UIManager.ActiveScreen == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (UIManager.ActiveScreen.GetWidget<HotbarGui>() is { } hotbar)
|
|
{
|
|
foreach (var container in GetAllItemSlotContainers(hotbar))
|
|
{
|
|
// Yes, this is dirty.
|
|
container.SlotGroup = container.SlotGroup;
|
|
}
|
|
}
|
|
|
|
_hands?.ReloadHands();
|
|
_inventory?.ReloadSlots();
|
|
|
|
//todo move this over to its own hellhole
|
|
var inventory = UIManager.ActiveScreen.GetWidget<InventoryGui>();
|
|
if (inventory == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
foreach (var container in GetAllItemSlotContainers(inventory))
|
|
{
|
|
// Yes, this is dirty.
|
|
container.SlotGroup = container.SlotGroup;
|
|
}
|
|
|
|
_inventory?.RegisterInventoryBarContainer(inventory.InventoryHotbar);
|
|
}
|
|
|
|
private static IEnumerable<ItemSlotButtonContainer> GetAllItemSlotContainers(Control gui)
|
|
{
|
|
var result = new List<ItemSlotButtonContainer>();
|
|
|
|
foreach (var child in gui.Children)
|
|
{
|
|
if (child is ItemSlotButtonContainer container)
|
|
{
|
|
result.Add(container);
|
|
}
|
|
|
|
result.AddRange(GetAllItemSlotContainers(child));
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|