Skip to main content

Class: MessageService

Defined in: workingtitle-instruments-wt21/shared/MessageSystem/MessageService.ts:7

MessageService, copied from CJ4 mod, with modifications.

Constructors

Constructor

new MessageService(): MessageService

Returns

MessageService

Methods

clear()

clear(msgkey): void

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

Clears a message from all targets

Parameters

ParameterTypeDescription
msgkeyFMS_MESSAGE_IDThe message identifier

Returns

void


post()

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

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

Posts messages to the targets defined in the message definition

Parameters

ParameterTypeDescription
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


registerReceiver()

registerReceiver(target, receiver): void

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

Registers a receiver implementation to the target display

Parameters

ParameterTypeDescription
targetMESSAGE_TARGETThe target display
receiverIMessageReceiverThe receiver

Returns

void


update()

update(): void

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

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

Returns

void