Deprecate a bunch of IActionBlocker (#4852)
* Deprecate IActionBlocker ChangeDirectionAttempt * Woops * Throw and interact * Deperacte speech * ActionBlocker in fucking shambles * CanEmote go byebye * CanAttack is GONE * IActionBlocker finally ded * DRY
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
@@ -8,7 +7,7 @@ namespace Content.Shared.Speech
|
||||
/// Component required for entities to be able to speak.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class SharedSpeechComponent : Component, IActionBlocker
|
||||
public class SharedSpeechComponent : Component
|
||||
{
|
||||
public override string Name => "Speech";
|
||||
|
||||
@@ -25,7 +24,5 @@ namespace Content.Shared.Speech
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
bool IActionBlocker.CanSpeak() => Enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,13 @@ namespace Content.Shared.Speech
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SpeakAttemptEvent>(OnSpeakAttempt);
|
||||
SubscribeLocalEvent<SharedSpeechComponent, SpeakAttemptEvent>(OnSpeakAttempt);
|
||||
}
|
||||
|
||||
private void OnSpeakAttempt(SpeakAttemptEvent ev)
|
||||
private void OnSpeakAttempt(EntityUid uid, SharedSpeechComponent component, SpeakAttemptEvent args)
|
||||
{
|
||||
if (!ev.Entity.HasComponent<SharedSpeechComponent>())
|
||||
{
|
||||
ev.Cancel();
|
||||
}
|
||||
if (!component.Enabled)
|
||||
args.Cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user