Literally Murder IExamine (#7352)

This commit is contained in:
Rane
2022-04-08 17:17:25 -04:00
committed by GitHub
parent 427f7378c3
commit 7900abb888
27 changed files with 372 additions and 469 deletions

View File

@@ -1,8 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using Content.Shared.Examine;
using Content.Server.Radio.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
namespace Content.Server.Radio.EntitySystems
{
@@ -11,6 +10,19 @@ namespace Content.Server.Radio.EntitySystems
{
private readonly List<string> _messages = new();
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<HandheldRadioComponent, ExaminedEvent>(OnExamine);
}
private void OnExamine(EntityUid uid, HandheldRadioComponent component, ExaminedEvent args)
{
if (!args.IsInDetailsRange)
return;
args.PushMarkup(Loc.GetString("handheld-radio-component-on-examine",("frequency", component.BroadcastFrequency)));
}
public void SpreadMessage(IRadio source, EntityUid speaker, string message, int channel)
{
if (_messages.Contains(message)) return;