Files
wwdpublic/Content.Shared/Language/LanguagePrototype.cs
Mnemotechnican b15d096a3e Minor Language Fixes (#618)
# Description
Fixes:
- Whisper not undergoing readability obfuscation when out of range
- Handheld translators ignoring language knowledge requirements
- Several animals not having defined languages
- Computers not having languages (this primarily affects the RnD console
and in the future the cargo request console which send radio messages)
- Some languages lacking brightness and thus being hard to read

Also makes language colors from language markers use alpha blending
instead of overriding the original color. The change is subtle, kinda
hard to make it noticable without defeating the original purpose...

<details><summary><h1>Media</h1></summary><p>

Example of the new colors


![image](https://github.com/user-attachments/assets/291c1a6d-829b-43ec-afb7-5c902a1e4aff)

</p></details>

---

# Changelog
🆑
- fix: Whisper can no longer be heard clearly outside the intended
range.
- fix: Translators can no longer be used without knowing the languages
they require.
- fix: Computers (primarily RnD console) now speak GC by default instead
of Universal.
- tweak: Readjusted colors of all languages to make them easier to read.
2024-07-31 16:57:25 -07:00

85 lines
2.6 KiB
C#

using Content.Shared.Chat;
using Robust.Shared.Prototypes;
namespace Content.Shared.Language;
[Prototype("language")]
public sealed class LanguagePrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
/// <summary>
/// Obfuscation method used by this language. By default, uses <see cref="ObfuscationMethod.Default"/>
/// </summary>
[DataField("obfuscation")]
public ObfuscationMethod Obfuscation = ObfuscationMethod.Default;
/// <summary>
/// Speech overrides used for messages sent in this language.
/// </summary>
[DataField("speech")]
public SpeechOverrideInfo SpeechOverride = new();
#region utility
/// <summary>
/// The in-world name of this language, localized.
/// </summary>
public string Name => Loc.GetString($"language-{ID}-name");
/// <summary>
/// The in-world description of this language, localized.
/// </summary>
public string Description => Loc.GetString($"language-{ID}-description");
#endregion utility
}
[DataDefinition]
public sealed partial class SpeechOverrideInfo
{
/// <summary>
/// Color which text in this language will be blended with.
/// Alpha blending is used, which means the alpha component of the color controls the intensity of this color.
/// </summary>
[DataField]
public Color? Color = null;
[DataField]
public string? FontId;
[DataField]
public int? FontSize;
[DataField]
public bool AllowRadio = true;
/// <summary>
/// If false, the entity can use this language even when it's unable to speak (i.e. muffled or muted),
/// and accents are not applied to messages in this language.
/// </summary>
[DataField]
public bool RequireSpeech = true;
/// <summary>
/// If not null, all messages in this language will be forced to be spoken in this chat type.
/// </summary>
[DataField]
public InGameICChatType? ChatTypeOverride;
/// <summary>
/// Speech verb overrides. If not provided, the default ones for the entity are used.
/// </summary>
[DataField]
public List<LocId>? SpeechVerbOverrides;
/// <summary>
/// Overrides for different kinds chat message wraps. If not provided, the default ones are used.
/// </summary>
/// <remarks>
/// Currently, only local chat and whispers support this. Radio and emotes are unaffected.
/// This is horrible.
/// </remarks>
[DataField]
public Dictionary<InGameICChatType, LocId> MessageWrapOverrides = new();
}