mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-04 05:17:28 +00:00
* Simplify hands UI code * i remembered about SortedHands in the component * minor cleanup --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
44 lines
1.3 KiB
C#
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(HandLocation.Right);
|
|
StatusPanelLeft.SetSide(HandLocation.Left);
|
|
var hotbarController = UserInterfaceManager.GetUIController<HotbarUIController>();
|
|
|
|
hotbarController.Setup(HandContainer);
|
|
LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.Begin);
|
|
}
|
|
|
|
public void UpdatePanelEntityLeft(EntityUid? entity, Hand? hand)
|
|
{
|
|
StatusPanelLeft.Update(entity, hand);
|
|
}
|
|
|
|
public void UpdatePanelEntityRight(EntityUid? entity, Hand? hand)
|
|
{
|
|
StatusPanelRight.Update(entity, hand);
|
|
}
|
|
|
|
public void SetHighlightHand(HandLocation? hand)
|
|
{
|
|
StatusPanelLeft.UpdateHighlight(hand is HandLocation.Left);
|
|
StatusPanelRight.UpdateHighlight(hand is HandLocation.Right);
|
|
}
|
|
|
|
public void UpdateStatusVisibility(bool left, bool right)
|
|
{
|
|
StatusPanelLeft.Visible = left;
|
|
StatusPanelRight.Visible = right;
|
|
}
|
|
}
|