research console radio messages on unlock (#22166)
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Server.Research.Components;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Research.Components;
|
||||
using Content.Shared.Research.Prototypes;
|
||||
|
||||
namespace Content.Server.Research.Systems;
|
||||
|
||||
@@ -25,6 +26,9 @@ public sealed partial class ResearchSystem
|
||||
if (!this.IsPowered(uid, EntityManager))
|
||||
return;
|
||||
|
||||
if (!PrototypeManager.TryIndex<TechnologyPrototype>(args.Id, out var technologyPrototype))
|
||||
return;
|
||||
|
||||
if (TryComp<AccessReaderComponent>(uid, out var access) && !_accessReader.IsAllowed(ent, uid, access))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("research-console-no-access-popup"), ent);
|
||||
@@ -34,6 +38,10 @@ public sealed partial class ResearchSystem
|
||||
if (!UnlockTechnology(uid, args.Id, ent))
|
||||
return;
|
||||
|
||||
var message = Loc.GetString("research-console-unlock-technology-radio-broadcast",
|
||||
("technology", Loc.GetString(technologyPrototype.Name)),
|
||||
("amount", technologyPrototype.Cost));
|
||||
_radio.SendRadioMessage(uid, message, component.AnnouncementChannel, uid, escapeMarkup: false);
|
||||
SyncClientWithServer(uid);
|
||||
UpdateConsoleInterface(uid, component);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user