* Engine namespace changes.
* Automated remove redundant using statements.
* Simplified Graphics namespace.
* Apparently the container system stores full type names in the map file.😞 This updates those names.
* API Changes to LocalizationManager.LoadCulture.
* Update submodule to v0.3.2
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using Content.Shared.GameObjects.Components.Items;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
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;
|
|
|
|
AddChild(Blocked = new TextureRect
|
|
{
|
|
Texture = blockedTexture,
|
|
TextureScale = (2, 2),
|
|
MouseFilter = MouseFilterMode.Stop,
|
|
Visible = false
|
|
});
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|