[feat] donate

# Conflicts:
#	Content.Client/Entry/EntryPoint.cs
#	Content.Client/IoC/ClientContentIoC.cs
#	Content.Server/Chat/Managers/ChatManager.cs
#	Content.Server/Entry/EntryPoint.cs
#	Content.Server/GameTicking/GameTicker.Player.cs
#	Content.Server/GameTicking/GameTicker.StatusShell.cs
#	Content.Server/IoC/ServerContentIoC.cs
#	Content.Shared/Humanoid/HumanoidCharacterAppearance.cs
#	Content.Shared/Humanoid/Markings/MarkingPrototype.cs
#	Content.Shared/Preferences/HumanoidCharacterProfile.cs
This commit is contained in:
rhailrake
2023-04-25 19:46:20 +06:00
committed by Remuchi
parent 0cbb69d0a1
commit 4e85539ec6
29 changed files with 809 additions and 83 deletions

View File

@@ -0,0 +1,53 @@
using Robust.Client.Console;
using Robust.Client.GameObjects;
using Robust.Client.State;
using Robust.Client.UserInterface;
using Robust.Shared.Player;
using Content.Shared.White.JoinQueue;
using Robust.Client.Audio;
namespace Content.Client.White.JoinQueue;
public sealed class QueueState : State
{
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
private const string JoinSoundPath = "/Audio/Effects/voteding.ogg";
private QueueGui? _gui;
protected override void Startup()
{
_gui = new QueueGui();
_userInterfaceManager.StateRoot.AddChild(_gui);
_gui.QuitPressed += OnQuitPressed;
}
protected override void Shutdown()
{
_gui!.QuitPressed -= OnQuitPressed;
_gui.Dispose();
Ding();
}
private void Ding()
{
if (IoCManager.Resolve<IEntityManager>().TrySystem<AudioSystem>(out var audio))
{
audio.PlayGlobal(JoinSoundPath, Filter.Local(), false);
}
}
public void OnQueueUpdate(MsgQueueUpdate msg)
{
_gui?.UpdateInfo(msg.Total, msg.Position);
}
private void OnQuitPressed()
{
_consoleHost.ExecuteCommand("quit");
}
}