f (#96)
This commit is contained in:
@@ -128,6 +128,9 @@ public class EmoteAnimationSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
component.AnimationId = state.AnimationId;
|
component.AnimationId = state.AnimationId;
|
||||||
_emoteList[component.AnimationId].Invoke(uid);
|
if (_emoteList.ContainsKey(component.AnimationId))
|
||||||
|
{
|
||||||
|
_emoteList[component.AnimationId].Invoke(uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Content.Server.Speech.EntitySystems;
|
|||||||
using Content.Server.Station.Components;
|
using Content.Server.Station.Components;
|
||||||
using Content.Server.Station.Systems;
|
using Content.Server.Station.Systems;
|
||||||
using Content.Server.UtkaIntegration;
|
using Content.Server.UtkaIntegration;
|
||||||
|
using Content.Server.White.Other.Speech;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
@@ -431,6 +432,17 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
var wrappedMessage = Loc.GetString("chat-manager-entity-say-wrap-message",
|
var wrappedMessage = Loc.GetString("chat-manager-entity-say-wrap-message",
|
||||||
("entityName", name), ("message", message));
|
("entityName", name), ("message", message));
|
||||||
|
|
||||||
|
//WD-EDIT
|
||||||
|
if (TryComp<VoiceOfGodComponent>(source, out var comp))
|
||||||
|
{
|
||||||
|
wrappedMessage = Loc.GetString(comp.ChatLoc,
|
||||||
|
("entityName", name),
|
||||||
|
("message", FormattedMessage.EscapeText(message)),
|
||||||
|
("color", comp.ChatColor)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//WD-EDIT
|
||||||
|
|
||||||
SendInVoiceRange(ChatChannel.Local, message, wrappedMessage, source, range);
|
SendInVoiceRange(ChatChannel.Local, message, wrappedMessage, source, range);
|
||||||
|
|
||||||
var ev = new EntitySpokeEvent(source, message, originalMessage, null, null);
|
var ev = new EntitySpokeEvent(source, message, originalMessage, null, null);
|
||||||
|
|||||||
23
Content.Server/White/Other/Speech/VoiceOfGodComponent.cs
Normal file
23
Content.Server/White/Other/Speech/VoiceOfGodComponent.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
namespace Content.Server.White.Other.Speech;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed 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";
|
||||||
|
}
|
||||||
37
Content.Server/White/Other/Speech/VoiceOfGodSystem.cs
Normal file
37
Content.Server/White/Other/Speech/VoiceOfGodSystem.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
using Content.Server.Speech;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
|
using Robust.Shared.Player;
|
||||||
|
|
||||||
|
namespace Content.Server.White.Other.Speech;
|
||||||
|
|
||||||
|
public sealed class VoiceOfGodSystem : EntitySystem
|
||||||
|
{
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<VoiceOfGodComponent, AccentGetEvent>(OnAccent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string Accentuate(VoiceOfGodComponent component, string message)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(component.Sound))
|
||||||
|
{
|
||||||
|
SoundSystem.Play(component.Sound,
|
||||||
|
Filter.Pvs(component.Owner, component.SoundRange),
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Resources/Audio/White/Voice/voice_of_god.ogg
Normal file
BIN
Resources/Audio/White/Voice/voice_of_god.ogg
Normal file
Binary file not shown.
@@ -1,2 +0,0 @@
|
|||||||
reflect-shot = Отразил!
|
|
||||||
carry-verb = Тащить на руках
|
|
||||||
6
Resources/Locale/ru-RU/white/something.ftl
Normal file
6
Resources/Locale/ru-RU/white/something.ftl
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
reflect-shot = Отразил!
|
||||||
|
|
||||||
|
carry-verb = Тащить на руках
|
||||||
|
|
||||||
|
chat-manager-entity-say-god-wrap-message = {$entityName} командует, "[color={$color}]{$message}[/color]"
|
||||||
|
|
||||||
Reference in New Issue
Block a user