Multitool examine wires on click (#11352)
* cable examine update * Revert "cable examine update" This reverts commit 0c6df040b3b014a35fb9abe1cdc6e1078c5b1ca1. * Multitool checks wire when clicked Co-authored-by: CommieFlowers <rasmus.cedergren@hotmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Server.Power.Components;
|
|||||||
using Content.Server.Power.NodeGroups;
|
using Content.Server.Power.NodeGroups;
|
||||||
using Content.Server.Tools;
|
using Content.Server.Tools;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
@@ -21,6 +22,17 @@ namespace Content.Server.Power.EntitySystems
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<CableComponent, GetVerbsEvent<ExamineVerb>>(OnGetExamineVerbs);
|
SubscribeLocalEvent<CableComponent, GetVerbsEvent<ExamineVerb>>(OnGetExamineVerbs);
|
||||||
|
SubscribeLocalEvent<CableComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAfterInteractUsing(EntityUid uid, CableComponent component, AfterInteractUsingEvent args)
|
||||||
|
{
|
||||||
|
if (args.Handled || args.Target == null || !args.CanReach || !_toolSystem.HasQuality(args.Used, "Pulsing"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var markup = FormattedMessage.FromMarkup(GenerateCableMarkup(uid));
|
||||||
|
_examineSystem.SendExamineTooltip(args.User, uid, markup, false, false);
|
||||||
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGetExamineVerbs(EntityUid uid, CableComponent component, GetVerbsEvent<ExamineVerb> args)
|
private void OnGetExamineVerbs(EntityUid uid, CableComponent component, GetVerbsEvent<ExamineVerb> args)
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ public sealed partial class CableSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var ev = new CuttingFinishedEvent(args.User);
|
var ev = new CuttingFinishedEvent(args.User);
|
||||||
_toolSystem.UseTool(args.Used, args.User, uid, 0, cable.CuttingDelay, new[] { cable.CuttingQuality }, doAfterCompleteEvent: ev, doAfterEventTarget: uid);
|
args.Handled = _toolSystem.UseTool(args.Used, args.User, uid, 0, cable.CuttingDelay, new[] { cable.CuttingQuality }, doAfterCompleteEvent: ev, doAfterEventTarget: uid);
|
||||||
args.Handled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCableCut(EntityUid uid, CableComponent cable, CuttingFinishedEvent args)
|
private void OnCableCut(EntityUid uid, CableComponent cable, CuttingFinishedEvent args)
|
||||||
|
|||||||
Reference in New Issue
Block a user