@@ -14,9 +14,8 @@ namespace Content.Server.Radio.Components
|
||||
[ComponentProtoName("Radio")]
|
||||
[ComponentReference(typeof(IRadio))]
|
||||
[ComponentReference(typeof(IListen))]
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
#pragma warning disable 618
|
||||
public sealed class HandheldRadioComponent : Component, IListen, IRadio, IActivate
|
||||
public sealed class HandheldRadioComponent : Component, IListen, IRadio
|
||||
#pragma warning restore 618
|
||||
{
|
||||
private ChatSystem _chatSystem = default!;
|
||||
@@ -98,10 +97,5 @@ namespace Content.Server.Radio.Components
|
||||
{
|
||||
_radioSystem.SpreadMessage(this, speaker, message, channel);
|
||||
}
|
||||
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
Use(eventArgs.User);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Server.Radio.Components;
|
||||
using Content.Shared.Radio;
|
||||
using JetBrains.Annotations;
|
||||
using Content.Shared.Interaction;
|
||||
|
||||
namespace Content.Server.Radio.EntitySystems
|
||||
{
|
||||
@@ -15,6 +16,16 @@ namespace Content.Server.Radio.EntitySystems
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<HandheldRadioComponent, ExaminedEvent>(OnExamine);
|
||||
SubscribeLocalEvent<HandheldRadioComponent, ActivateInWorldEvent>(OnActivate);
|
||||
}
|
||||
|
||||
private void OnActivate(EntityUid uid, HandheldRadioComponent component, ActivateInWorldEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
args.Handled = true;
|
||||
component.Use(args.User);
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, HandheldRadioComponent component, ExaminedEvent args)
|
||||
|
||||
Reference in New Issue
Block a user