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
Parameter | Type | Description |
---|---|---|
msgkey | FMS_MESSAGE_ID | The 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
Parameter | 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
registerReceiver()
registerReceiver(
target
,receiver
):void
Defined in: workingtitle-instruments-wt21/shared/MessageSystem/MessageService.ts:66
Registers a receiver implementation to the target display
Parameters
Parameter | Type | Description |
---|---|---|
target | MESSAGE_TARGET | The target display |
receiver | IMessageReceiver | The 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