Improved Inventory / Hand Slots UI (#2965)

This commit is contained in:
chairbender
2021-01-20 00:32:44 -08:00
committed by GitHub
parent 02ea6ce57c
commit f9670d36c4
15 changed files with 304 additions and 152 deletions

View File

@@ -1,11 +1,15 @@
using Content.Shared.GameObjects.Components.Items;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Maths;
namespace Content.Client.UserInterface
{
public class HandButton : ItemSlotButton
{
private bool _activeHand;
private bool _highlighted;
public HandButton(Texture texture, Texture storageTexture, Texture blockedTexture, HandLocation location) : base(texture, storageTexture)
{
Location = location;
@@ -21,5 +25,23 @@ namespace Content.Client.UserInterface
public HandLocation Location { get; }
public TextureRect Blocked { get; }
public void SetActiveHand(bool active)
{
_activeHand = active;
UpdateHighlight();
}
public override void Highlight(bool highlight)
{
_highlighted = highlight;
UpdateHighlight();
}
private void UpdateHighlight()
{
// always stay highlighted if active
base.Highlight(_activeHand || _highlighted);
}
}
}