Adds a new 'description' attribute to [theme] and replaces the previous
instance of gui2::tsimple_item_selector used to select themes with a
brand new dialog (that's actually based on it) that allows for
displaying theme descriptions in a nice format.
Because some of the theme names aren't obvious enough to players
("UnitBox" comes to mind), we ought to provide descriptions of each
theme to save people some clicks since it's not possible at the
moment to switch the theme mid-game and see the results immediately.
Reverts the second portion of 95bcf34133e84d1333301d81b640f447553f6820
in a way (we still want it on a new line) for consistency with commit
996b31def547be7a093b699ec84c0581208308b9.
The optional argument allows us to specify a nicer and more relevant
position message format for the two parser errors that involve more than
one file location: missing closing tags (expected location and opening
location) and invalid closing tags (opening location and (invalid)
closing location).
This makes it easier to tell what's going on even when confronted with a
kilometric preprocessor brace-substitution trail, e.g:
> Found invalid closing tag [/tag2] for tag [tag1]
> Opened at ~add-ons/My_Add-on/scenarios/24.cfg:1090
> included from ~add-ons/My_Add-on/scenarios/24.cfg:120
> included from ~add-ons/My_Add-on/_main.cfg:42
> [...]
> Closed at ~add-ons/My_Add-on/scenarios/24.cfg:1098
> included from ~add-ons/My_Add-on/scenarios/24.cfg:120
> included from ~add-ons/My_Add-on/_main.cfg:42
> [...]
Some day we will be able to make it easier to handle these situations by
ensuring the trail format is concise and relevant, but that day will not
come before 1.13.0. Messing further with the main ::lineno_string()
function (in preprocessor.cpp) would be risky at this point with 1.12.0
approaching.
Passing translated strings instead of translatable strings makes a bunch
of things easier:
* We don't need to worry about forgetting to call gettext _() in
lineno_string() (which, as a matter of fact, I forgot to do for
hint_string, oops)
* We can append and preprend stuff to the *translated* strings before
passing to lineno_string() without breaking localization! Woo!
Using STL strings instead of C strings also makes things easier and
prettier. The negligible performance impact shouldn't be a concern here
because landing in parser::lineno_string() or parser::error() is a
worst-case situation since it only happens when the parser encounters an
error and cannot continue.
Also, parser::lineno_string() now takes an optional fifth argument
with the tokenizer state message to append to the end of the full
message and trail. We need that for the next commit.