pAIs Play Music (#5614)

* Disable check

* vehicle test

* Make PAI stop instrument when turning off (player leaves/ejected)

* Give pAI an instrument component with a custom soundfont

* Add pAI synth program to custom ss14 soundfont

* Add new PAIMidi action that pAIs use to open their instruments

* Changed instrument component to allow its player to be the actor of its parent item

* Oops. Readds instrumentcomponent.

* ECS Changes

* Changed soundfont to ringtone

* Revert "Disable check"

This reverts commit 86001d8b5e94ee38d0c9504cb19826327b04fb16.

* Remove action parameters from ghost placeholder

* Revert "vehicle test"

This reverts commit 8a8ecf41083e0d5c8d4363ff02981bdab04bcd1c.

* Fixes to whitespace

* Even more fixes to whitespace

* Removed paiSynth sample from spacestation14.sf2

* Yet another indentation touchup
This commit is contained in:
hubismal
2021-12-02 12:49:18 -06:00
committed by GitHub
parent 33be919b84
commit a04720fdda
7 changed files with 72 additions and 1 deletions

View File

@@ -2,9 +2,12 @@ using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.PAI;
using Content.Shared.Verbs;
using Content.Shared.Instruments;
using Content.Server.Popups;
using Content.Server.Instruments;
using Content.Server.Ghost.Roles.Components;
using Content.Server.Mind.Components;
using Robust.Server.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.GameObjects;
@@ -16,6 +19,7 @@ namespace Content.Server.PAI
public class PAISystem : SharedPAISystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly InstrumentSystem _instrumentSystem = default!;
public override void Initialize()
{
@@ -97,6 +101,15 @@ namespace Content.Server.PAI
private void PAITurningOff(EntityUid uid)
{
UpdatePAIAppearance(uid, PAIStatus.Off);
// Close the instrument interface if it was open
// before closing
if (EntityManager.TryGetComponent<ServerUserInterfaceComponent>(uid, out var serverUi))
if (EntityManager.TryGetComponent<ActorComponent>(uid, out var actor))
if (serverUi.TryGetBoundUserInterface(InstrumentUiKey.Key,out var bui))
bui.Close(actor.PlayerSession);
// Stop instrument
if (EntityManager.TryGetComponent<InstrumentComponent>(uid, out var instrument)) _instrumentSystem.Clean(uid, instrument);
if (EntityManager.TryGetComponent<MetaDataComponent>(uid, out var metadata))
{
var proto = metadata.EntityPrototype;