Refactor SpeciesUI into overlay and status effects (#381)
* Refactor SpeciesUI into overlay and status effects All components that update the UI will need to use PlayerAttached for cases where the Mind transfers I think. * Change overlay / status effects to use states * Change TryRemoveStatus to RemoveStatus Doesn't return a bool so not trying. Addressing PJB's feedback.
This commit is contained in:
committed by
Pieter-Jan Briers
parent
6497cdf8ff
commit
12cf5559c2
@@ -12,29 +12,16 @@ namespace Content.Client.UserInterface
|
||||
/// </summary>
|
||||
public sealed class StatusEffectsUI : Control
|
||||
{
|
||||
public VBoxContainer VBox => _vBox;
|
||||
private readonly VBoxContainer _vBox;
|
||||
|
||||
private TextureRect _healthStatusRect;
|
||||
|
||||
public StatusEffectsUI()
|
||||
{
|
||||
_vBox = new VBoxContainer {GrowHorizontal = GrowDirection.Begin};
|
||||
AddChild(_vBox);
|
||||
|
||||
_vBox.AddChild(_healthStatusRect = new TextureRect
|
||||
{
|
||||
TextureScale = (2, 2),
|
||||
Texture = IoCManager.Resolve<IResourceCache>().GetTexture("/Textures/Mob/UI/Human/human0.png")
|
||||
});
|
||||
|
||||
SetAnchorAndMarginPreset(LayoutPreset.TopRight);
|
||||
MarginTop = 250;
|
||||
MarginRight = 10;
|
||||
}
|
||||
|
||||
public void SetHealthIcon(Texture texture)
|
||||
{
|
||||
_healthStatusRect.Texture = texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user