make objectives use entityCategory (#28269)

This commit is contained in:
deltanedas
2024-06-03 13:23:52 +00:00
committed by GitHub
parent 33d963a149
commit 8d78b7442a
8 changed files with 15 additions and 75 deletions

View File

@@ -2,6 +2,7 @@ using Content.Shared.Mind;
using Content.Shared.Objectives;
using Content.Shared.Objectives.Systems;
using Robust.Shared.Utility;
using Robust.Shared.Prototypes;
namespace Content.Shared.Objectives.Components;
@@ -9,32 +10,33 @@ namespace Content.Shared.Objectives.Components;
/// Required component for an objective entity prototype.
/// </summary>
[RegisterComponent, Access(typeof(SharedObjectivesSystem))]
[EntityCategory("Objectives")]
public sealed partial class ObjectiveComponent : Component
{
/// <summary>
/// Difficulty rating used to avoid assigning too many difficult objectives.
/// </summary>
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public float Difficulty;
/// <summary>
/// Organisation that issued this objective, used for grouping and as a header above common objectives.
/// </summary>
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public string Issuer = string.Empty;
/// <summary>
/// Unique objectives can only have 1 per prototype id.
/// Set this to false if you want multiple objectives of the same prototype.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool Unique = true;
/// <summary>
/// Icon of this objective to display in the character menu.
/// Can be specified by an <see cref="ObjectiveGetInfoEvent"/> handler but is usually done in the prototype.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public SpriteSpecifier? Icon;
}