diff --git a/Content.Client/Cloning/UI/AcceptCloningEui.cs b/Content.Client/Cloning/UI/AcceptCloningEui.cs index 027f250c5c..30f9a513df 100644 --- a/Content.Client/Cloning/UI/AcceptCloningEui.cs +++ b/Content.Client/Cloning/UI/AcceptCloningEui.cs @@ -1,6 +1,7 @@ using Content.Client.Eui; using Content.Shared.Cloning; using JetBrains.Annotations; +using Robust.Client.Graphics; namespace Content.Client.Cloning.UI { @@ -28,6 +29,7 @@ namespace Content.Client.Cloning.UI public override void Opened() { + IoCManager.Resolve().RequestWindowAttention(); _window.OpenCentered(); } diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs index dc56b6738e..50c0402806 100644 --- a/Content.Server/Cloning/CloningSystem.cs +++ b/Content.Server/Cloning/CloningSystem.cs @@ -2,6 +2,7 @@ using System.Linq; using Content.Server.Cloning.Components; using Content.Server.Mind.Components; using Content.Server.Power.Components; +using Content.Shared.Audio; using Content.Shared.GameTicking; using Content.Shared.Preferences; using Robust.Shared.Timing; @@ -54,6 +55,7 @@ namespace Content.Server.Cloning public override void Update(float frameTime) { + // TODO: Make this stateful foreach (var (cloning, power) in EntityManager.EntityQuery()) { if (cloning.UiKnownPowerState != power.Powered) diff --git a/Content.Server/Cloning/Components/CloningPodComponent.cs b/Content.Server/Cloning/Components/CloningPodComponent.cs index cfe5e5c77b..37f7ed0dac 100644 --- a/Content.Server/Cloning/Components/CloningPodComponent.cs +++ b/Content.Server/Cloning/Components/CloningPodComponent.cs @@ -7,10 +7,14 @@ using Content.Shared.CharacterAppearance.Systems; using Content.Shared.Cloning; using Content.Shared.MobState.Components; using Content.Shared.Popups; +using Content.Shared.Sound; using Content.Shared.Species; using Robust.Server.GameObjects; using Robust.Server.Player; +using Robust.Shared.Audio; using Robust.Shared.Containers; +using Robust.Shared.Player; +using Robust.Shared.Players; using Robust.Shared.Prototypes; namespace Content.Server.Cloning.Components @@ -18,15 +22,12 @@ namespace Content.Server.Cloning.Components [RegisterComponent] public sealed class CloningPodComponent : SharedCloningPodComponent { - [Dependency] private readonly IPlayerManager _playerManager = null!; + [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IEntityManager _entities = default!; [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly EuiManager _euiManager = null!; - [ViewVariables] - public bool Powered => !_entities.TryGetComponent(Owner, out ApcPowerReceiverComponent? receiver) || receiver.Powered; - [ViewVariables] public BoundUserInterface? UserInterface => Owner.GetUIOrNull(CloningPodUIKey.Key); @@ -39,6 +40,9 @@ namespace Content.Server.Cloning.Components // Used to prevent as many duplicate UI messages as possible [ViewVariables] public bool UiKnownPowerState = false; + [ViewVariables(VVAccess.ReadWrite), DataField("soundCloneStart")] + public SoundSpecifier? CloneStartSound = new SoundPathSpecifier("/Audio/Machines/genetics.ogg"); + [ViewVariables] public CloningPodStatus Status; @@ -135,13 +139,19 @@ namespace Content.Server.Cloning.Components return; // If we can't track down the client, we can't offer transfer. That'd be quite bad. } + // Cloning confirmed now. + var speciesProto = _prototype.Index(dna.Profile.Species).Prototype; var mob = _entities.SpawnEntity(speciesProto, _entities.GetComponent(Owner).MapPosition); - EntitySystem.Get().UpdateFromProfile(mob, dna.Profile); _entities.GetComponent(mob).EntityName = dna.Profile.Name; + // TODO: Ideally client knows about this and plays it on its own + // Send them a sound to know it happened + if (CloneStartSound != null) + SoundSystem.Play(Filter.SinglePlayer(client), CloneStartSound.GetSound()); + var cloneMindReturn = _entities.AddComponent(mob); cloneMindReturn.Mind = mind; cloneMindReturn.Parent = Owner; diff --git a/Resources/Audio/Machines/genetics.ogg b/Resources/Audio/Machines/genetics.ogg new file mode 100644 index 0000000000..9b28be68b5 Binary files /dev/null and b/Resources/Audio/Machines/genetics.ogg differ diff --git a/Resources/Audio/Machines/license.txt b/Resources/Audio/Machines/license.txt index 38dc720b70..f3447aaeba 100644 --- a/Resources/Audio/Machines/license.txt +++ b/Resources/Audio/Machines/license.txt @@ -2,6 +2,8 @@ circuitprinter.ogg taken from https://freesound.org/people/OroborosNZ/sounds/273 diagnoser_printing.ogg taken from https://freesound.org/people/RobSp1derp1g/sounds/615419/ and edited +genetics.ogg taken from https://github.com/Citadel-Station-13/Citadel-Station-13-RP/blob/5307e56a25a53fe1b4d34e7f1401ae8dfaa44922/sound/effects/genetics.ogg under CC BY-SA 3.0 + uniformprinter.ogg taken from https://freesound.org/people/sukaton/sounds/60640/ and edited vaccinator_running.ogg taken from https://freesound.org/people/RutgerMuller/sounds/365413/ and edited