Remove imagesharp and StatusEffectAddedEvent from FlashOverlay (#28930)

remove imagesharp and StatusEffectAddedEvent from FlashOverlay
This commit is contained in:
slarticodefast
2024-07-13 08:10:04 +02:00
committed by GitHub
parent 49096cf14f
commit eb4ce85354
2 changed files with 9 additions and 32 deletions

View File

@@ -22,7 +22,6 @@ public sealed class FlashSystem : SharedFlashSystem
SubscribeLocalEvent<FlashedComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<FlashedComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<FlashedComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
SubscribeLocalEvent<FlashedComponent, StatusEffectAddedEvent>(OnStatusAdded);
_overlay = new();
}
@@ -34,8 +33,8 @@ public sealed class FlashSystem : SharedFlashSystem
private void OnPlayerDetached(EntityUid uid, FlashedComponent component, LocalPlayerDetachedEvent args)
{
_overlay.PercentComplete = 1.0f;
_overlay.ScreenshotTexture = null;
_overlay.RequestScreenTexture = false;
_overlayMan.RemoveOverlay(_overlay);
}
@@ -43,6 +42,7 @@ public sealed class FlashSystem : SharedFlashSystem
{
if (_player.LocalEntity == uid)
{
_overlay.RequestScreenTexture = true;
_overlayMan.AddOverlay(_overlay);
}
}
@@ -51,17 +51,9 @@ public sealed class FlashSystem : SharedFlashSystem
{
if (_player.LocalEntity == uid)
{
_overlay.PercentComplete = 1.0f;
_overlay.ScreenshotTexture = null;
_overlay.RequestScreenTexture = false;
_overlayMan.RemoveOverlay(_overlay);
}
}
private void OnStatusAdded(EntityUid uid, FlashedComponent component, StatusEffectAddedEvent args)
{
if (_player.LocalEntity == uid && args.Key == FlashedKey)
{
_overlay.ReceiveFlash();
}
}
}