Files
tbd-station-14/Content.Client/UserInterface/Systems/Hotbar/Widgets/HotbarGui.xaml.cs
Errant fc80a18c35 Revert "Storage UI V2 (#33045)"
This reverts commit fd25dac720.
2025-02-05 14:13:06 +01:00

44 lines
1.3 KiB
C#

using Content.Shared.Hands.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Systems.Hotbar.Widgets;
[GenerateTypedNameReferences]
public sealed partial class HotbarGui : UIWidget
{
public HotbarGui()
{
RobustXamlLoader.Load(this);
StatusPanelRight.SetSide(HandUILocation.Right);
StatusPanelLeft.SetSide(HandUILocation.Left);
var hotbarController = UserInterfaceManager.GetUIController<HotbarUIController>();
hotbarController.Setup(HandContainer, StoragePanel);
LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.Begin);
}
public void UpdatePanelEntityLeft(EntityUid? entity)
{
StatusPanelLeft.Update(entity);
}
public void UpdatePanelEntityRight(EntityUid? entity)
{
StatusPanelRight.Update(entity);
}
public void SetHighlightHand(HandUILocation? hand)
{
StatusPanelLeft.UpdateHighlight(hand is HandUILocation.Left);
StatusPanelRight.UpdateHighlight(hand is HandUILocation.Right);
}
public void UpdateStatusVisibility(bool left, bool right)
{
StatusPanelLeft.Visible = left;
StatusPanelRight.Visible = right;
}
}