Files
ordoor/doc/formats/mnu.md

3.3 KiB

*.mnu

These files appear to be the UI definitions for Chaos Gate. Some relate to system menus, other to in-game menus. Their names are hardcoded into the WH40K.exe binary. Each has a .obj file associated with it.

It's an ASCII-formatted text file with a 12-line header, followed by a number of descriptor records.

Here's the top of MainGame.mnu:

MainGame.obj
BACKGROUND COLOR 0..255..-1 trans : 0
HYPERTEXT COLOR 0..255            : 120
FONT TYPE 0..5                    : 10
wh40k_12
basfnt12
wh40k_47
wh40k_12_red
wh40k_12_blue
wh40k_12_green
wh40k_12_yellow
NULL

The first line of the header is a .obj file containing sprites we want to display on-screen. We see entries further down have a SPRITEID, which must reference entries in that file.

In SaveGame.mnu, we can see multiple .obj files can be referenced.

There are then 3 lines that seem to be fixed descriptor names with values that vary. Is this font colour, perhaps? Unsure.

Next is a variable-length list of font names, referencing files in the Fonts directory.

Finally, there's a list of records that specify the menu itself. Truncated contents of SaveGame.mnu:

#rem..........Background
MENUID     : 1
MENUTYPE   : 0
MOVEABLE   : 0
ACTIVE     : 1
SPRITEID   : 0
ACCELERATOR: 0
DRAW TYPE  : 0
SHARE      : -1
X-CORD     : -1
Y-CORD     : -1
DESC       :
*
#rem..........MAIN BACKGROUND
MENUID     : 2
MENUTYPE   : 45
MOVEABLE   : 0
ACTIVE     : 1
SPRITEID   : 0
ACCELERATOR: 0
DRAW TYPE  : 0
SHARE      : -1
X-CORD     : -1
Y-CORD     : -1
DESC       :
#rem.......... MAIN BACKGROUND
        SUBMENUID  : 1
        SUBMENUTYPE: 31
        FONTTYPE   : 20
        ACTIVE     : 0
        SPRITEID   : -1
        ACCELERATOR: 0
        DRAW TYPE  : 0
        SHARE      : 0
        SOUNDTYPE  : 0
        DESC       :
*
#rem..........Chat List Box Menu
MENUID     : 21
MENUTYPE   : 1
MOVEABLE   : 0
ACTIVE     : 1
SPRITEID   : 764
ACCELERATOR: 0
DRAW TYPE  : 0
SHARE      : -1
X-CORD     : -1
Y-CORD     : -1
DESC       :
[...]
*
~

We start processing these as soon as we see MENUID, I suppose. Each toplevel item is *-delimited, and the list is terminated with ~.

Each menu has a list of parameters:

Name Examples Purpose
MENUID 1, 2, 3 Maybe linking between menus?
MENUTYPE 0, 1, 2, 3, 45, 300 ?
MOVEABLE 0 Unimplemented functionality?
ACTIVE 0, 1 Boolean - whether to show the thing
SPRITEID -1, 0, 123 Select from .obj file
ACCELERATOR ?
DRAW TYPE ?
SHARE ?
X-CORD -1, 0, 200 X coordinate to draw at
Y-CORD -1, 0, 200 Y coordinate to draw at
FONTTYPE Choose a font from the above?
SOUNDTYPE ?
DESC CHARACTER SELECT, 51005 Text, or reference to Data/USEng.dta

Submenus also show a couple of unique values:

Name Examples Purpose
SUBMENUID 1, 2, 3 As MENUID
SUBMENUTYPE 0, 1, 2 As MENUTYPE

It seems .mnu files can also include other files, which have the extension .mni (presumably for "Menu include"). Examples:

*
$GenDialog.mni
$GenLoad.mni

It looks like we just interpolate the named file into the text when we come across one of these lines.