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
@@ -0,0 +1,27 @@
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Mobs
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedOverlayEffectsComponent))]
|
||||
public sealed class ServerOverlayEffectsComponent : SharedOverlayEffectsComponent
|
||||
{
|
||||
private ScreenEffects _currentOverlay = ScreenEffects.None;
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new OverlayEffectComponentState(_currentOverlay);
|
||||
}
|
||||
|
||||
public void ChangeOverlay(ScreenEffects effect)
|
||||
{
|
||||
if (effect == _currentOverlay)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_currentOverlay = effect;
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user