MENUS.BIN

From OHRRPGCE-Wiki
Jump to navigation Jump to search

MENUS.BIN stores data about custom menus. This lump only contains data applicable to an entire menu. Data about individual menu items is located in MENUITEM.BIN. The record size is stored in BINSIZE.BIN

Note: for years from when menus.bin was added (2007) until r5401 (2012), when the binsize of menus.bin was 52 bytes, the binsize of menus.bin was mistakenly two bytes longer than needed and the last two bytes are not written, so menus.bin would always be two bytes short. Every time more data was added to the fileformat the binsize was expanded to again be 2 bytes longer than needed. If the file system doesn't zero-initialise part of a file when you seek past the end and then write to it, then garbage data may have crept in. (On Unix the gap is zero-initialised, but I don't know about Windows.)

About Formal Specs

Offset Data Meaning
0-10 VSTR(1i+20b=11i) Menu name
11 INT Box style (same as text box background color)
12 INT Default menu item text color - 0 means use the global default (uiMenuItem), 1 to 255 is a color index in master palette, -n - 1 means UI color n (values < 0 are supported in fufluns and newer)
13 INT Max rows to show at a time (0=default, cannot exceed screen height)
14 INT Bitsets

0=Transparent box
1=Never show scrollbar
2=Allow gameplay while menu is active
3=Suspend player even if gameplay allowed
4=No box
5=Cancel button doesn't close menu
6=No player control of menu
7=Prevent main menu from opening
8=Advance text box when menu closes
9=Highlight selection background
10=Remember selection when reopening
11=Clamp to screen bounds (This is a WIP feature)
12-15=Unused

15 INT Offset X (positive or negative)
16 INT Offset Y (positive or negative)
17 INT Anchor X (-1=left, 0=center, 1=right)
18 INT Anchor Y (-1=top, 0=center, 1=bottom)
19 INT Text align (-1=left, 0=center, 1=right)
20 INT Minimum width (in text chars, default=0)
21 INT Maximum width (in text chars, 0=none, >=1 crops strings)
22 INT Border thickness (in pixels, can be negative)
23 INT On-close script trigger
24 INT Menu ID -1 to open when pressing ESC (or 0 for none)
25 INT Garbage (do not repurpose. See r5401 for details)
26 INT Item spacing, in pixels to be added to the default. Negative makes the items closer together, positive stretches them apart. This value alters the vertical size of the whole menu
27 INT Default menu item disabled text color - 0 means use the global default, 1 to 255 is a color index in master palette, -n - 1 means UI color n

See Also[edit]