Files
tbd-station-14/Content.Shared/Speech/Components/VocalComponent.cs
Morb 16b3e2233a Emotes Menu (#26702)
* Basic emote radial menu

* Move out from corvax

* Move to UI controller & add to top menu bar and key bind

* Make emote play

* Add name localization for emotes

* Localize chat messages

* Fix emote menu

* Add categories localization

* Fixes

* Fix

* Add emotes entity blacklist

* Fix entity whitelist required all logic

* Remove unused wagging emote

* Revert sprite

* Set default texture for emote icon

* Update Resources/keybinds.yml

---------

Co-authored-by: Kara <lunarautomaton6@gmail.com>
2024-04-28 21:38:23 -07:00

54 lines
2.0 KiB
C#

using Content.Shared.Chat.Prototypes;
using Content.Shared.Humanoid;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
namespace Content.Shared.Speech.Components;
/// <summary>
/// Component required for entities to be able to do vocal emotions.
/// </summary>
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class VocalComponent : Component
{
/// <summary>
/// Emote sounds prototype id for each sex (not gender).
/// Entities without <see cref="HumanoidComponent"/> considered to be <see cref="Sex.Unsexed"/>.
/// </summary>
[DataField("sounds", customTypeSerializer: typeof(PrototypeIdValueDictionarySerializer<Sex, EmoteSoundsPrototype>))]
[AutoNetworkedField]
public Dictionary<Sex, string>? Sounds;
[DataField("screamId", customTypeSerializer: typeof(PrototypeIdSerializer<EmotePrototype>))]
[AutoNetworkedField]
public string ScreamId = "Scream";
[DataField("wilhelm")]
[AutoNetworkedField]
public SoundSpecifier Wilhelm = new SoundPathSpecifier("/Audio/Voice/Human/wilhelm_scream.ogg");
[DataField("wilhelmProbability")]
[AutoNetworkedField]
public float WilhelmProbability = 0.0002f;
[DataField("screamAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
[AutoNetworkedField]
public string ScreamAction = "ActionScream";
[DataField("screamActionEntity")]
[AutoNetworkedField]
public EntityUid? ScreamActionEntity;
/// <summary>
/// Currently loaded emote sounds prototype, based on entity sex.
/// Null if no valid prototype for entity sex was found.
/// </summary>
[ViewVariables]
[AutoNetworkedField]
public EmoteSoundsPrototype? EmoteSounds = null;
}