Show / Hide Table of Contents

Class AlertPrototype

An alert popup with associated icon, tooltip, and other data.

Inheritance
System.Object
AlertPrototype
Implements
Robust.Shared.Prototypes.IPrototype
Robust.Shared.Serialization.ISerializationHooks
Namespace: Content.Shared.Alert
Assembly: Content.Shared.dll
Syntax
public sealed class AlertPrototype : object, IPrototype, ISerializationHooks

Fields

| Improve this Doc View Source

Icons

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>
| Improve this Doc View Source

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 Source

AlertKey

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
| Improve this Doc View Source

AlertType

Type of alert, no 2 alert prototypes should have the same one.

Declaration
public AlertType AlertType { get; }
Property Value
Type Description
AlertType
| Improve this Doc View Source

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>
| Improve this Doc View Source

Description

Description to show in tooltip window. Accepts formatting.

Declaration
public string Description { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

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
| Improve this Doc View Source

Name

Name to show in tooltip window. Accepts formatting.

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

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
| Improve this Doc View Source

SupportsSeverity

Indicates whether this state support severity levels

Declaration
public bool SupportsSeverity { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

GetIcon(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 Source

IPrototype.ID

Declaration
string IPrototype.ID { get; }
Returns
Type Description
System.String
| Improve this Doc View Source

ISerializationHooks.AfterDeserialization()

Declaration
void ISerializationHooks.AfterDeserialization()

Implements

Robust.Shared.Prototypes.IPrototype
Robust.Shared.Serialization.ISerializationHooks
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾