Show health status on the HUD, shoddily.
This commit is contained in:
38
Content.Client/UserInterface/StatusEffectsUI.cs
Normal file
38
Content.Client/UserInterface/StatusEffectsUI.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Content.Client.Utility;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Interfaces.ResourceManagement;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// The status effects display on the right side of the screen.
|
||||
/// </summary>
|
||||
public sealed class StatusEffectsUI : Control
|
||||
{
|
||||
private readonly VBoxContainer _vBox;
|
||||
|
||||
private TextureRect _healthStatusRect;
|
||||
|
||||
public StatusEffectsUI()
|
||||
{
|
||||
_vBox = new VBoxContainer {GrowHorizontal = GrowDirection.Begin};
|
||||
AddChild(_vBox);
|
||||
|
||||
_vBox.AddChild(_healthStatusRect = new TextureRect
|
||||
{
|
||||
Texture = IoCManager.Resolve<IResourceCache>().GetTexture("/Textures/Mob/UI/Human/human0.png")
|
||||
});
|
||||
|
||||
SetAnchorAndMarginPreset(LayoutPreset.TopRight);
|
||||
MarginTop = 200;
|
||||
}
|
||||
|
||||
public void SetHealthIcon(Texture texture)
|
||||
{
|
||||
_healthStatusRect.Texture = texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user