Skip to main content

Class: MessageService

MessageService, copied from CJ4 mod, with modifications.

Constructors

constructor

new MessageService(): MessageService

Returns

MessageService

Methods

clear

clear(msgkey): void

Clears a message from all targets

Parameters

NameTypeDescription
msgkeyFMS_MESSAGE_IDThe message identifier

Returns

void

Defined in

workingtitle-instruments-wt21/shared/MessageSystem/MessageService.ts:34


post

post(msgkey, exitHandler?, blinkHandler?): void

Posts messages to the targets defined in the message definition

Parameters

NameTypeDescription
msgkeyFMS_MESSAGE_IDThe message identifier
exitHandler?() => booleanAn optional function that returns true when the msg should not be shown anymore. If it is not passed in, you must clear the message manually by calling the clear function.
blinkHandler() => booleanA function that returns a boolean indicating if the message should blink

Returns

void

Defined in

workingtitle-instruments-wt21/shared/MessageSystem/MessageService.ts:18


registerReceiver

registerReceiver(target, receiver): void

Registers a receiver implementation to the target display

Parameters

NameTypeDescription
targetMESSAGE_TARGETThe target display
receiverIMessageReceiverThe receiver

Returns

void

Defined in

workingtitle-instruments-wt21/shared/MessageSystem/MessageService.ts:66


update

update(): void

Update function which calls the exitHandler function and clears messages that have to go

Returns

void

Defined in

workingtitle-instruments-wt21/shared/MessageSystem/MessageService.ts:41