Class: MessageService
MessageService, copied from CJ4 mod, with modifications.
Constructors
constructor
• new MessageService(): MessageService
Returns
Methods
clear
▸ clear(msgkey
): void
Clears a message from all targets
Parameters
Name | Type | Description |
---|---|---|
msgkey | FMS_MESSAGE_ID | The 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
Name | Type | Description |
---|---|---|
msgkey | FMS_MESSAGE_ID | The message identifier |
exitHandler? | () => boolean | An 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 | () => boolean | A 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
Name | Type | Description |
---|---|---|
target | MESSAGE_TARGET | The target display |
receiver | IMessageReceiver | The 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