Skip to main content

Class: Warning

Defined in: src/sdk/components/Warnings/Warning.ts:13

The main logic for a system warning.

Constructors

Constructor

new Warning(type, condition, shortText?, longText?, soundId?, once?): Warning

Defined in: src/sdk/components/Warnings/Warning.ts:40

Creates an instance of a Warning.

Parameters

ParameterTypeDescription
typeWarningTypeThe type of warning this is.
conditionCompositeLogicXMLElementAn XML logic element with the trigger logic.
shortText?stringThe warning message in short form.
longText?stringThe warning message in long form.
soundId?stringThe sound name to use with this warning.
once?booleanTrue if this warning only fires once

Returns

Warning

Properties

condition

readonly condition: CompositeLogicXMLElement

Defined in: src/sdk/components/Warnings/Warning.ts:23

The XML logic element triggering this warning if true.


longText?

readonly optional longText: string

Defined in: src/sdk/components/Warnings/Warning.ts:19

The long-form text.


once?

readonly optional once: boolean

Defined in: src/sdk/components/Warnings/Warning.ts:25

Does this only fire once?


shortText?

readonly optional shortText: string

Defined in: src/sdk/components/Warnings/Warning.ts:17

The short-form text.


soundId?

readonly optional soundId: string

Defined in: src/sdk/components/Warnings/Warning.ts:21

The name of a sound to play along with the visual warning.


type

readonly type: WarningType

Defined in: src/sdk/components/Warnings/Warning.ts:15

The category of the warnining.

Accessors

canTrigger

Get Signature

get canTrigger(): boolean

Defined in: src/sdk/components/Warnings/Warning.ts:88

Can this alert fire?

Returns

boolean

True if the current configuration allows the alert to fire.


description

Get Signature

get description(): string

Defined in: src/sdk/components/Warnings/Warning.ts:72

A text description for the warning, for debugging purposes.

Returns

string

A string


eventId

Get Signature

get eventId(): undefined | Name_Z

Defined in: src/sdk/components/Warnings/Warning.ts:96

The event ID Coherent returns when this sound has been played.

Returns

undefined | Name_Z

A Name_Z based on the sound ID.


hasText

Get Signature

get hasText(): boolean

Defined in: src/sdk/components/Warnings/Warning.ts:57

Whether or not we have any text at all.

Returns

boolean

True if any non-empty text strings are set.


triggered

Get Signature

get triggered(): boolean

Defined in: src/sdk/components/Warnings/Warning.ts:80

Whether or not the warning has been triggered in this session.

Returns

boolean

True if the warning has been triggered.

Methods

trigger()

trigger(): void

Defined in: src/sdk/components/Warnings/Warning.ts:64

The alert is being fired, take action.

Returns

void