Merge branch 'master' into buckle-locker-fix-1262
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
/// <summary>
|
||||
/// An enum representing the current state being applied to the user
|
||||
/// </summary>
|
||||
private readonly List<OverlayContainer> _currentEffects = new List<OverlayContainer>();
|
||||
private List<OverlayContainer> _currentEffects = new List<OverlayContainer>();
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public List<OverlayContainer> ActiveOverlays
|
||||
@@ -49,7 +49,9 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
switch (message)
|
||||
{
|
||||
case PlayerAttachedMsg _:
|
||||
SetEffects(ActiveOverlays);
|
||||
var overlays = new List<OverlayContainer>(_currentEffects);
|
||||
_currentEffects.Clear();
|
||||
SetEffects(overlays);
|
||||
break;
|
||||
case PlayerDetachedMsg _:
|
||||
ActiveOverlays = new List<OverlayContainer>();
|
||||
@@ -61,14 +63,20 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if(_playerManager?.LocalPlayer != null && _playerManager.LocalPlayer.ControlledEntity != Owner)
|
||||
return;
|
||||
|
||||
if (!(curState is OverlayEffectComponentState state) || ActiveOverlays.Equals(state.Overlays))
|
||||
if (!(curState is OverlayEffectComponentState state))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_playerManager?.LocalPlayer != null && _playerManager.LocalPlayer.ControlledEntity != Owner)
|
||||
{
|
||||
_currentEffects = state.Overlays;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ActiveOverlays.Equals(state.Overlays))
|
||||
return;
|
||||
|
||||
ActiveOverlays = state.Overlays;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using JetBrains.Annotations;
|
||||
#nullable enable
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
{
|
||||
public readonly StatusEffect Effect;
|
||||
|
||||
public StatusControl(StatusEffect effect, [CanBeNull] Texture texture)
|
||||
public StatusControl(StatusEffect effect, Texture? texture)
|
||||
{
|
||||
Effect = effect;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#nullable enable
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Content.Client.GameObjects.Components.Mobs
|
||||
{
|
||||
[RegisterComponent]
|
||||
|
||||
Reference in New Issue
Block a user