using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Examine
{
///
/// This component groups examine messages together
///
[RegisterComponent]
public sealed class GroupExamineComponent : Component
{
///
/// A list of ExamineGroups.
///
[DataField("group")]
public List ExamineGroups = new()
{
new ExamineGroup()
{
Components = new()
{
"Armor",
"ClothingSpeedModifier",
},
},
};
}
[DataDefinition]
public sealed class ExamineGroup
{
///
/// The title of the Examine Group, the .
///
[DataField("title")]
[ViewVariables(VVAccess.ReadWrite)]
public string? Title;
///
/// A list of ExamineEntries, containing which component it belongs to, which priority it has, and what FormattedMessage it holds.
///
[DataField("entries")]
public List Entries = new();
///
/// A list of all components this ExamineGroup encompasses.
///
[DataField("components")]
public List Components = new();
///
/// The icon path for the Examine Group.
///
[DataField("icon")]
public string Icon = "/Textures/Interface/examine-star.png";
///
/// The text shown in the context verb menu.
///
[DataField("contextText")]
public string ContextText = string.Empty;
///
/// Details shown when hovering over the button.
///
[DataField("hoverMessage")]
public string HoverMessage = string.Empty;
}
///
/// An entry used when showing examine details
///
[Serializable, NetSerializable]
public sealed class ExamineEntry
{
///
/// Which component does this entry relate to?
///
[DataField("component")]
public string ComponentName = string.Empty;
///
/// What priority has this entry - entries are sorted high to low.
///
[DataField("priority")]
public float Priority = 0f;
///
/// The FormattedMessage of this entry.
///
[DataField("message")]
public FormattedMessage Message = new();
/// Should be set to _componentFactory.GetComponentName(component.GetType()) to properly function.
public ExamineEntry(string componentName, float priority, FormattedMessage message)
{
ComponentName = componentName;
Priority = priority;
Message = message;
}
}
}