Fix a bunch of warnings (#11965)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -23,11 +23,13 @@ namespace Content.Server.Wires;
|
||||
public sealed class WiresSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
|
||||
private IRobustRandom _random = new RobustRandom();
|
||||
|
||||
@@ -476,12 +478,13 @@ public sealed class WiresSystem : EntitySystem
|
||||
|
||||
if (component.IsPanelOpen)
|
||||
{
|
||||
SoundSystem.Play(component.ScrewdriverOpenSound.GetSound(), Filter.Pvs(args.Target), args.Target);
|
||||
_audio.PlayPvs(component.ScrewdriverOpenSound, args.Target);
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundSystem.Play(component.ScrewdriverCloseSound.GetSound(), Filter.Pvs(args.Target), args.Target);
|
||||
_uiSystem.GetUiOrNull(args.Target, WiresUiKey.Key)?.CloseAll();
|
||||
_audio.PlayPvs(component.ScrewdriverCloseSound, args.Target);
|
||||
var ui = _uiSystem.GetUiOrNull(args.Target, WiresUiKey.Key);
|
||||
_uiSystem.CloseAll(ui);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,7 +551,7 @@ public sealed class WiresSystem : EntitySystem
|
||||
if (!Resolve(uid, ref appearance, ref wires, false))
|
||||
return;
|
||||
|
||||
appearance.SetData(WiresVisuals.MaintenancePanelState, wires.IsPanelOpen && wires.IsPanelVisible);
|
||||
_appearance.SetData(uid, WiresVisuals.MaintenancePanelState, wires.IsPanelOpen && wires.IsPanelVisible, appearance);
|
||||
}
|
||||
|
||||
private void UpdateUserInterface(EntityUid uid, WiresComponent? wires = null, ServerUserInterfaceComponent? ui = null)
|
||||
@@ -578,18 +581,18 @@ public sealed class WiresSystem : EntitySystem
|
||||
|
||||
statuses.Sort((a, b) => a.position.CompareTo(b.position));
|
||||
|
||||
_uiSystem.GetUiOrNull(uid, WiresUiKey.Key)?.SetState(
|
||||
new WiresBoundUserInterfaceState(
|
||||
clientList.ToArray(),
|
||||
statuses.Select(p => new StatusEntry(p.key, p.value)).ToArray(),
|
||||
wires.BoardName,
|
||||
wires.SerialNumber,
|
||||
wires.WireSeed));
|
||||
_uiSystem.TrySetUiState(uid, WiresUiKey.Key, new WiresBoundUserInterfaceState(
|
||||
clientList.ToArray(),
|
||||
statuses.Select(p => new StatusEntry(p.key, p.value)).ToArray(),
|
||||
wires.BoardName,
|
||||
wires.SerialNumber,
|
||||
wires.WireSeed), ui: ui);
|
||||
}
|
||||
|
||||
public void OpenUserInterface(EntityUid uid, IPlayerSession player)
|
||||
{
|
||||
_uiSystem.GetUiOrNull(uid, WiresUiKey.Key)?.Open(player);
|
||||
if (_uiSystem.TryGetUi(uid, WiresUiKey.Key, out var ui))
|
||||
_uiSystem.OpenUi(ui, player);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -800,7 +803,7 @@ public sealed class WiresSystem : EntitySystem
|
||||
wire.Action.Pulse(user, wire);
|
||||
|
||||
UpdateUserInterface(used);
|
||||
SoundSystem.Play(wires.PulseSound.GetSound(), Filter.Pvs(used), used);
|
||||
_audio.PlayPvs(wires.PulseSound, used);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user