mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
# Description I don't like the bwoink. I also don't like being notified about the thing I'm staring at. If anyone has better quality sounds to suggest, I might use those instead. --- <details><summary><h1>Media</h1></summary> <p> ## Different sounds https://github.com/user-attachments/assets/8003f785-0cd0-44c9-94c2-919c59adac5c ## Ignore sounds when looking https://github.com/user-attachments/assets/2ac99672-a601-41e0-a5cd-25ce9c1a5c49 </p> </details> --- # Changelog 🆑 - tweak: The AdminHelp sound has changed to three that play under different circumstances --------- Signed-off-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System.Linq;
|
|
using Content.Shared.Administration;
|
|
using Content.Shared.Administration.Events;
|
|
using Content.Shared.GameTicking;
|
|
using Robust.Shared.Network;
|
|
|
|
namespace Content.Client.Administration.Systems
|
|
{
|
|
public sealed partial class AdminSystem : EntitySystem
|
|
{
|
|
public event Action<List<PlayerInfo>>? PlayerListChanged;
|
|
|
|
public Dictionary<NetUserId, PlayerInfo> PlayerInfos = new();
|
|
public IReadOnlyList<PlayerInfo> PlayerList =>
|
|
PlayerInfos != null ? PlayerInfos.Values.ToList() : new List<PlayerInfo>();
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
InitializeOverlay();
|
|
SubscribeNetworkEvent<FullPlayerListEvent>(OnPlayerListChanged);
|
|
SubscribeNetworkEvent<PlayerInfoChangedEvent>(OnPlayerInfoChanged);
|
|
}
|
|
|
|
public override void Shutdown()
|
|
{
|
|
base.Shutdown();
|
|
ShutdownOverlay();
|
|
}
|
|
|
|
private void OnPlayerInfoChanged(PlayerInfoChangedEvent ev)
|
|
{
|
|
if(ev.PlayerInfo == null) return;
|
|
|
|
if (PlayerInfos == null) PlayerInfos = new();
|
|
|
|
PlayerInfos[ev.PlayerInfo.SessionId] = ev.PlayerInfo;
|
|
PlayerListChanged?.Invoke(PlayerInfos.Values.ToList());
|
|
}
|
|
|
|
private void OnPlayerListChanged(FullPlayerListEvent msg)
|
|
{
|
|
PlayerInfos = msg.PlayersInfo.ToDictionary(x => x.SessionId, x => x);
|
|
PlayerListChanged?.Invoke(msg.PlayersInfo);
|
|
}
|
|
}
|
|
}
|