diff --git a/Content.Server/PAI/PAISystem.cs b/Content.Server/PAI/PAISystem.cs index 2d1114665e..01cee8865c 100644 --- a/Content.Server/PAI/PAISystem.cs +++ b/Content.Server/PAI/PAISystem.cs @@ -1,15 +1,18 @@ using Content.Server.Ghost.Roles; using Content.Server.Ghost.Roles.Components; using Content.Server.Instruments; -using Content.Shared.Kitchen.Components; +using Content.Shared.Kitchen.Components; // DeltaV - shared +using Content.Server.Store.Systems; using Content.Shared.Interaction.Events; using Content.Shared.Mind.Components; using Content.Shared.PAI; using Content.Shared.Popups; -using Robust.Shared.Random; -using System.Text; +using Content.Shared.Store; +using Content.Shared.Store.Components; using Content.Shared.Instruments; -using Robust.Shared.Player; +using Robust.Shared.Random; +using Robust.Shared.Prototypes; +using System.Text; namespace Content.Server.PAI; @@ -19,12 +22,13 @@ public sealed class PAISystem : SharedPAISystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; + [Dependency] private readonly StoreSystem _store = default!; [Dependency] private readonly ToggleableGhostRoleSystem _toggleableGhostRole = default!; /// /// Possible symbols that can be part of a scrambled pai's name. /// - private static readonly char[] SYMBOLS = new[] { '#', '~', '-', '@', '&', '^', '%', '$', '*', ' '}; + private static readonly char[] SYMBOLS = new[] { '#', '~', '-', '@', '&', '^', '%', '$', '*', ' ' }; public override void Initialize() { @@ -34,6 +38,8 @@ public sealed class PAISystem : SharedPAISystem SubscribeLocalEvent(OnMindAdded); SubscribeLocalEvent(OnMindRemoved); SubscribeLocalEvent(OnMicrowaved); + + SubscribeLocalEvent(OnShop); } private void OnUseInHand(EntityUid uid, PAIComponent component, UseInHandEvent args) @@ -101,6 +107,14 @@ public sealed class PAISystem : SharedPAISystem _metaData.SetEntityName(uid, val); } + private void OnShop(Entity ent, ref PAIShopActionEvent args) + { + if (!TryComp(ent, out var store)) + return; + + _store.ToggleUi(args.Performer, ent, store); + } + public void PAITurningOff(EntityUid uid) { // Close the instrument interface if it was open