Messages are triggered by an event that has some cause in a decicion made by the player of by an event triggered by an engine. An example for the first case would be the leaving of a passenger from a ship, which is caused by taking him on board. The offer to broker a marriage contract would be an example for the second case.
The messages are put in a queue that is displayed in the message queue. They may be categorized into different topics. Only the top 50 messages are visible in the queue. When a message is put in the queue it is displayed on the screen. As the size of the displayable message in the board is limited it is possible that it is truncated to fit on a single line. When hovering over it the complete message will be displayed.
There are two different type of messages. The most simple kind only consist of a simple message. This kind of messages is represented by DisplayMessage. If the message too complicated to be put into one short sentence there can be a dialog attatched. These messages are distinguishable by the message overlay being underlined. Clicking on it will open a dialog with the complete message. This second kind are handled like the first kind when they are put into the queue: only the short text is displayed. The full content of the dialog is not displayed, as this would potentially close an opened dialog.
For defining a message dialog there are two options:
DisplayTemplateMessage , which defines the dialog through a DialogTemplate that let's you define a title, content with parameters and some buttons. This type is well suited for simple one paragraph dialogs.DisplayStateMessage, which is backed by a dialog state which defines a Spring bean of the dialog, as well as all the required parameters to set up the dialog.