AlertLevelPrototype.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.Prototypes;
  3. namespace Content.Server.AlertLevel;
  4. [Prototype("alertLevels")]
  5. public sealed partial class AlertLevelPrototype : IPrototype
  6. {
  7. [IdDataField] public string ID { get; private set; } = default!;
  8. /// <summary>
  9. /// Dictionary of alert levels. Keyed by string - the string key is the most important
  10. /// part here. Visualizers will use this in order to dictate what alert level to show on
  11. /// client side sprites, and localization uses each key to dictate the alert level name.
  12. /// </summary>
  13. [DataField("levels")] public Dictionary<string, AlertLevelDetail> Levels = new();
  14. /// <summary>
  15. /// Default level that the station is on upon initialization.
  16. /// If this isn't in the dictionary, this will default to whatever .First() gives.
  17. /// </summary>
  18. [DataField("defaultLevel")] public string DefaultLevel { get; private set; } = default!;
  19. }
  20. /// <summary>
  21. /// Alert level detail. Does not contain an ID, that is handled by
  22. /// the Levels field in AlertLevelPrototype.
  23. /// </summary>
  24. [DataDefinition]
  25. public sealed partial class AlertLevelDetail
  26. {
  27. /// <summary>
  28. /// What is announced upon this alert level change. Can be a localized string.
  29. /// </summary>
  30. [DataField("announcement")] public string Announcement { get; private set; } = string.Empty;
  31. /// <summary>
  32. /// Whether this alert level is selectable from a communications console.
  33. /// </summary>
  34. [DataField("selectable")] public bool Selectable { get; private set; } = true;
  35. /// <summary>
  36. /// If this alert level disables user selection while it is active. Beware -
  37. /// setting this while something is selectable will disable selection permanently!
  38. /// This should only apply to entities or gamemodes that auto-select an alert level,
  39. /// such as a nuclear bomb being set to active.
  40. /// </summary>
  41. [DataField("disableSelection")] public bool DisableSelection { get; private set; }
  42. /// <summary>
  43. /// The sound that this alert level will play in-game once selected.
  44. /// </summary>
  45. [DataField("sound")] public SoundSpecifier? Sound { get; private set; }
  46. /// <summary>
  47. /// The color that this alert level will show in-game in chat.
  48. /// </summary>
  49. [DataField("color")] public Color Color { get; private set; } = Color.White;
  50. /// <summary>
  51. /// The color to turn emergency lights on this station when they are active.
  52. /// </summary>
  53. [DataField("emergencyLightColor")] public Color EmergencyLightColor { get; private set; } = Color.FromHex("#FF4020");
  54. /// <summary>
  55. /// Will this alert level force emergency lights on for the station that's active?
  56. /// </summary>
  57. [DataField("forceEnableEmergencyLights")] public bool ForceEnableEmergencyLights { get; private set; } = false;
  58. /// <summary>
  59. /// How long it takes for the shuttle to arrive when called.
  60. /// </summary>
  61. [DataField("shuttleTime")] public TimeSpan ShuttleTime { get; private set; } = TimeSpan.FromMinutes(5);
  62. }