Add slipping prediction (#1440)
This commit is contained in:
@@ -1,29 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Client.UserInterface;
|
||||
using Content.Client.Utility;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Content.Shared.Input;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Interfaces.ResourceManagement;
|
||||
using Robust.Client.Interfaces.UserInterface;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
using Robust.Shared.Interfaces.Timing;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Players;
|
||||
|
||||
namespace Content.Client.GameObjects.Components.Mobs
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedStatusEffectsComponent))]
|
||||
public sealed class ClientStatusEffectsComponent : SharedStatusEffectsComponent
|
||||
{
|
||||
#pragma warning disable 649
|
||||
@@ -65,7 +62,12 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
if (!(curState is StatusEffectComponentState state) || _status == state.StatusEffects) return;
|
||||
|
||||
if (!(curState is StatusEffectComponentState state) || _status == state.StatusEffects)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_status = state.StatusEffects;
|
||||
UpdateStatusEffects();
|
||||
}
|
||||
@@ -154,5 +156,16 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
cooldownGraphic.Visible = ratio > -1f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ChangeStatusEffect(StatusEffect effect, string icon, (TimeSpan, TimeSpan)? cooldown)
|
||||
{
|
||||
_status[effect] = new StatusEffectStatus()
|
||||
{
|
||||
Icon = icon,
|
||||
Cooldown = cooldown
|
||||
};
|
||||
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user