1
0

ShowFactionIconsComponent.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Content.Shared.StatusIcon;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  4. namespace Content.Shared.Overlays;
  5. /// <summary>
  6. /// This component allows you to see faction icons above mobs.
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  9. public sealed partial class ShowFactionIconsComponent : Component
  10. {
  11. /// <summary>
  12. /// The faction icon to display
  13. /// </summary>
  14. [DataField("factionIcon", customTypeSerializer: typeof(PrototypeIdSerializer<FactionIconPrototype>)), AutoNetworkedField]
  15. public string FactionIcon { get; set; } = "HostileFaction";
  16. /// <summary>
  17. /// The job icon to display (if any)
  18. /// </summary>
  19. [DataField("jobIcon", customTypeSerializer: typeof(PrototypeIdSerializer<JobIconPrototype>)), AutoNetworkedField]
  20. public string JobIcon { get; set; } = "JobIconSoldier";
  21. /// <summary>
  22. /// If this role is part of one of the squads
  23. /// </summary>
  24. [DataField("assignSquad"), AutoNetworkedField]
  25. public bool AssignSquad { get; set; } = false;
  26. /// <summary>
  27. /// The specific squad icon (e.g., "JobIconSquadAlphaSergeant") assigned by the server.
  28. /// </summary>
  29. [DataField("squadIcon", customTypeSerializer: typeof(PrototypeIdSerializer<JobIconPrototype>)), AutoNetworkedField]
  30. public string? SquadIcon { get; set; }
  31. /// <summary>
  32. /// The key/name of the squad the entity is assigned to (e.g., "Alpha").
  33. /// </summary>
  34. [DataField("assignedSquadNameKey"), AutoNetworkedField]
  35. public string? AssignedSquadNameKey { get; set; }
  36. [DataField("isSergeantInSquad"), AutoNetworkedField]
  37. public bool IsSergeantInSquad { get; set; }
  38. /// <summary>
  39. /// Identifier for the major CivTeamDeathmatch Faction this entity belongs to (e.g., Faction1Id or Faction2Id from CivTDMFactionsComponent).
  40. /// </summary>
  41. [DataField("belongsToCivFactionId"), AutoNetworkedField]
  42. public string? BelongsToCivFactionId { get; set; }
  43. }