Fix magboot mispredict (#7385)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Slippery;
|
||||
using Content.Shared.Toggleable;
|
||||
using Content.Shared.Verbs;
|
||||
|
||||
namespace Content.Shared.Clothing;
|
||||
|
||||
@@ -9,10 +11,30 @@ public abstract class SharedMagbootsSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SharedMagbootsComponent, GetVerbsEvent<ActivationVerb>>(AddToggleVerb);
|
||||
SubscribeLocalEvent<SharedMagbootsComponent, SlipAttemptEvent>(OnSlipAttempt);
|
||||
SubscribeLocalEvent<SharedMagbootsComponent, GetActionsEvent>(OnGetActions);
|
||||
SubscribeLocalEvent<SharedMagbootsComponent, ToggleActionEvent>(OnToggleAction);
|
||||
}
|
||||
|
||||
private void AddToggleVerb(EntityUid uid, SharedMagbootsComponent component, GetVerbsEvent<ActivationVerb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
|
||||
ActivationVerb verb = new();
|
||||
verb.Text = Loc.GetString("toggle-magboots-verb-get-data-text");
|
||||
verb.Act = () => component.On = !component.On;
|
||||
// TODO VERB ICON add toggle icon? maybe a computer on/off symbol?
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
private void OnSlipAttempt(EntityUid uid, SharedMagbootsComponent component, SlipAttemptEvent args)
|
||||
{
|
||||
if (component.On)
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void OnGetActions(EntityUid uid, SharedMagbootsComponent component, GetActionsEvent args)
|
||||
{
|
||||
args.Actions.Add(component.ToggleAction);
|
||||
|
||||
Reference in New Issue
Block a user