All computers play the keyboard sound + small research client cleanup (#7312)
This commit is contained in:
@@ -17,9 +17,6 @@ namespace Content.Server.Research.Components
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
[DataField("sound")]
|
||||
private SoundSpecifier _soundCollectionName = new SoundCollectionSpecifier("keyboard");
|
||||
|
||||
[ViewVariables] private bool Powered => !_entMan.TryGetComponent(Owner, out ApcPowerReceiverComponent? receiver) || receiver.Powered;
|
||||
|
||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(ResearchConsoleUiKey.Key);
|
||||
@@ -92,19 +89,5 @@ namespace Content.Server.Research.Components
|
||||
|
||||
return new ResearchConsoleBoundInterfaceState(points, pointsPerSecond);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open the user interface on a certain player session.
|
||||
/// </summary>
|
||||
/// <param name="session">Session where the UI will be shown</param>
|
||||
public void OpenUserInterface(IPlayerSession session)
|
||||
{
|
||||
UserInterface?.Open(session);
|
||||
}
|
||||
|
||||
public void PlayKeyboardSound()
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _soundCollectionName.GetSound(), Owner, AudioParams.Default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Server.Research.Components;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
|
||||
namespace Content.Server.Research
|
||||
{
|
||||
[UsedImplicitly]
|
||||
@@ -17,12 +15,6 @@ namespace Content.Server.Research
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ResearchConsoleComponent, AfterActivatableUIOpenEvent>(OnAfterUIOpen);
|
||||
}
|
||||
|
||||
private void OnAfterUIOpen(EntityUid uid, ResearchConsoleComponent component, AfterActivatableUIOpenEvent args)
|
||||
{
|
||||
component.PlayKeyboardSound();
|
||||
}
|
||||
|
||||
public bool RegisterServer(ResearchServerComponent server)
|
||||
|
||||
Reference in New Issue
Block a user