Add optional config file sections, selected with CHOOSE

Allows the user to define arbitrarily named optional sections
in the config file, and select which of those sections are used.

For example:

  OPTIONS=color
  CHOOSE=char A,char B

  [char A]
  OPTIONS=role:arc,race:dwa,align:law,gender:fem

  [char B]
  OPTIONS=role:wiz,race:elf,align:cha,gender:mal
This commit is contained in:
Pasi Kallinen
2017-09-02 12:04:27 +03:00
parent a2f886c665
commit bfad877fba
4 changed files with 150 additions and 0 deletions

View File

@@ -2688,6 +2688,13 @@ can be created with any text editor.
Any line in the configuration file starting with `{\tt \#}' is treated as a comment.
Empty lines are ignored.
%.pg
Any line beginning with `{\tt [}' and ending in `{\tt ]}' is considered a section
marker. The text between the square brackets is the section name.
Lines after a section marker belong to that section, and are
ignored unless a CHOOSE -statement was used to select that section.
Section names are case insensitive.
%.pg
You can use different configuration statements in the file, some
of which can be used multiple times. In general, the statements are
@@ -2776,6 +2783,24 @@ Example:
\end{verbatim}
%.ed
%.lp
\item[\bb{CHOOSE}]
Chooses at random one of the comma-separated parameters as an active
section name. Lines in other sections are ignored.
%.pg
Example:
%.sd
\begin{verbatim}
OPTIONS=color
CHOOSE=char A,char B
[char A]
OPTIONS=role:arc,race:dwa,align:law,gender:fem
[char B]
OPTIONS=role:wiz,race:elf,align:cha,gender:mal
\end{verbatim}
%.ed
%.lp
\item[\bb{MSGTYPE}]
Change the way messages are shown in the top status line.