1
0
Fork 0
mirror of https://github.com/endless-sky/endless-sky.git synced 2025-12-06 11:15:26 -05:00
1 CreatingMessages
GitHub Actions edited this page 2025-11-16 00:15:47 +00:00

Table of Contents

Introduction

Beginning in v. 0.10.17, messages that were previously hardcoded into the game engine can be customized. The syntax for the definition of a message or message category is:

message <name>
	text <text>
	phrase <name>
	category <name>

"message category" <name>
	"main color" (<r#> <g#> <b#> | <name>)
	"log color" (<r#> <g#> <b#> | <name>)
	"main duplicates" <strategy>
	"log duplicates" <strategy>
	"important" [true | false]
	"log only" [true | false]

Messages

message <name>

A "message" entry is the definition of a hail-like message that can be sent by the game's engine, appearing in the scrolling list at the bottom of the main view, as well as in a special log panel.

text <text>
phrase <name>

The contents of the message can be loaded either from a text node, or a named phrase. Substitutions (including replacing UI actions with their assigned keys) are supported.

category <name>

The category of this message. If none is provided, the default category named "normal" will be used.

Message Categories

"message category" <name>

A category defines how messages assigned to it appear and behave.

"main color" (<r#> <g#> <b#> | <name>)
"log color" (<r#> <g#> <b#> | <name>)

The colors used to display the entries in the main view and the log panel. They can be either named colors, or inline RGB definitions.

"main duplicates" <strategy>
"log duplicates" <strategy>
"important" [true | false]
"log only" [true | false]

The attributes controlling the behavior of the sent message entries:

  • "main duplicates" and "log duplicates": what the game should do when it encounters a duplicate entry. The main view considers a message as duplicate if it matches any of the previous messages in the list, while the log only compares the last entry. <strategy> can be either "keep new" (default for the main view, unsupported for the log), "keep old" (default for the log), or "keep both".
  • "important": messages with this category are included in the filtered view of the log that shows only messages of high importance. This flag is mainly intended to be used in the engine, and should not be overused. This attribute has no effect on the main view.
  • "log only": messages won't appear in the main list, only in the log view.