перенос файлов сервера из папки White в _White

This commit is contained in:
Remuchi
2024-01-28 18:18:54 +07:00
parent 21dbccfec9
commit 1e4ad59270
309 changed files with 450 additions and 437 deletions

View File

@@ -0,0 +1,23 @@
namespace Content.Server._White.Other.Speech;
[RegisterComponent]
public sealed partial class VoiceOfGodComponent : Component
{
[DataField("sound"), ViewVariables(VVAccess.ReadWrite)]
public string Sound { get; set; } = "/Audio/White/Voice/voice_of_god.ogg";
[DataField("soundRange"), ViewVariables(VVAccess.ReadWrite)]
public float SoundRange { get; set; } = 8;
[DataField("volume"), ViewVariables(VVAccess.ReadWrite)]
public int Volume { get; set; } = 5;
[DataField("accent"), ViewVariables(VVAccess.ReadWrite)]
public bool Accent { get; set; } = true;
[DataField("color"), ViewVariables(VVAccess.ReadWrite)]
public string ChatColor { get; set; } = Color.Red.ToHex();
[DataField("locale"), ViewVariables(VVAccess.ReadWrite)]
public string ChatLoc { get; set; } = "chat-manager-entity-say-god-wrap-message";
}

View File

@@ -0,0 +1,38 @@
using Content.Server.Speech;
using Robust.Server.Audio;
using Robust.Shared.Audio;
using Robust.Shared.Player;
namespace Content.Server._White.Other.Speech;
public sealed class VoiceOfGodSystem : EntitySystem
{
[Dependency] private readonly AudioSystem _audio = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<VoiceOfGodComponent, AccentGetEvent>(OnAccent);
}
private string Accentuate(VoiceOfGodComponent component, string message)
{
if (!string.IsNullOrEmpty(component.Sound))
{
_audio.PlayPvs(component.Sound,
component.Owner,
new AudioParams()
{
Volume = component.Volume
}
);
}
return component.Accent ? message.ToUpper() : message;
}
private void OnAccent(EntityUid uid, VoiceOfGodComponent component, AccentGetEvent args)
{
args.Message = Accentuate(component, args.Message);
}
}