12 Jan 12, 10:17PM
(This post was last modified: 13 Jan 12, 01:27AM by MasterKaen.)
The menu items are constructed using strings such as in both the current code and my patch.
These strings are (eventually) passed to vsnprintf, and then the length of each field is equalized and padded a constant amount on the right by a special text rendering function. The field separator is just the \t character you see repeated. It doesn't take any flags or precision specifiers etc.
The %s conversion specifiers can take a precision (length) specifier, which I use on the map name field (%.12s) to limit the number of characters. However, neither the fixed amount of padding that is appended to the right (after the field has been equalized), nor the width of the field in pixels can be specified (without changing the functions in render_text.cpp, which I know better than to touch :P ).
[SELECT ALL] Code:
"\fs\f%c%d\t\fs\f%c%d/%d\fr\t\a%c "
These strings are (eventually) passed to vsnprintf, and then the length of each field is equalized and padded a constant amount on the right by a special text rendering function. The field separator is just the \t character you see repeated. It doesn't take any flags or precision specifiers etc.
The %s conversion specifiers can take a precision (length) specifier, which I use on the map name field (%.12s) to limit the number of characters. However, neither the fixed amount of padding that is appended to the right (after the field has been equalized), nor the width of the field in pixels can be specified (without changing the functions in render_text.cpp, which I know better than to touch :P ).