Class AlertPrototype
An alert popup with associated icon, tooltip, and other data.
Inheritance
Implements
Namespace: Content.Shared.Alert
Assembly: Content.Shared.dll
Syntax
public sealed class AlertPrototype : object, IPrototype, ISerializationHooks
Fields
| Improve this Doc View SourceIcons
List of icons to use for this alert. Each entry corresponds to a different severity level, starting from the minimum and incrementing upwards. If severities are not supported, the first entry is used.
Declaration
public List<SpriteSpecifier> Icons
Field Value
Type | Description |
---|---|
List<Robust.Shared.Utility.SpriteSpecifier> |
MaxSeverity
Maximum severity level supported by this state. -1 (default) indicates no severity levels are supported by the state.
Declaration
public short MaxSeverity
Field Value
Type | Description |
---|---|
System.Int16 |
Properties
| Improve this Doc View SourceAlertKey
Key which is unique w.r.t category semantics (alerts with same category have equal keys, alerts with no category have different keys).
Declaration
public AlertKey AlertKey { get; }
Property Value
Type | Description |
---|---|
AlertKey |
AlertType
Type of alert, no 2 alert prototypes should have the same one.
Declaration
public AlertType AlertType { get; }
Property Value
Type | Description |
---|---|
AlertType |
Category
Category the alert belongs to. Only one alert of a given category can be shown at a time. If one is shown while another is already being shown, it will be replaced. This can be useful for categories of alerts which should naturally replace each other and are mutually exclusive, for example lowpressure / highpressure, hot / cold. If left unspecified, the alert will not replace or be replaced by any other alerts.
Declaration
public AlertCategory? Category { get; }
Property Value
Type | Description |
---|---|
System.Nullable<AlertCategory> |
Description
Description to show in tooltip window. Accepts formatting.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
MinSeverity
-1 (no effect) unless MaxSeverity is specified. Defaults to 1. Minimum severity level supported by this state.
Declaration
public short MinSeverity { get; }
Property Value
Type | Description |
---|---|
System.Int16 |
Name
Name to show in tooltip window. Accepts formatting.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
OnClick
Defines what to do when the alert is clicked. This will always be null on clientside.
Declaration
public IAlertClick OnClick { get; }
Property Value
Type | Description |
---|---|
IAlertClick |
SupportsSeverity
Indicates whether this state support severity levels
Declaration
public bool SupportsSeverity { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceGetIcon(Nullable<Int16>)
Declaration
public SpriteSpecifier GetIcon(short? severity = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Int16> | severity | severity level, if supported by this alert |
Returns
Type | Description |
---|---|
Robust.Shared.Utility.SpriteSpecifier | the icon path to the texture for the provided severity level |
Explicit Interface Implementations
| Improve this Doc View SourceIPrototype.ID
Declaration
string IPrototype.ID { get; }
Returns
Type | Description |
---|---|
System.String |
ISerializationHooks.AfterDeserialization()
Declaration
void ISerializationHooks.AfterDeserialization()