Sigh. Probably should re-write the .plain file parser to first remove
all commands, keeping the meta-information in a separate class. Then
parse the result (which should be much simpler) and consult the
meta-information where necessary (text-domain for strings, source files
and line numbers for tokens).
Quoting the code from savegame::save_index_class::data(const std::string&):
/*
* All saves are .gz files now so make sure we use that name when opening
* a file. If not some parts of the code use the name with and some parts
* without the .gz suffix.
*/
... A confusing statement that makes absolutely no amount of sense
whatsoever and comes from patch #3125! Not even back then it was true:
saved games could be either compressed (.gz) or uncompressed plain text
files (no extension). Nowadays we also have bzip2-compressed (.bz2)
files to add to the mix.
Most code actually calls the savegame-related functions with an explicit
file extension (if applicable), which is the source of a whole array of
maintainability concerns at this time; thus, I am not really sure what
the "some parts of the code" part refers to.
Previously, the Unknown icon only received TC if the leader unit for
that side supported TC, and it'd only use the source palette specified
in the unit configuration. Our Unknown icon, however, always needs TC,
and it must always be on the magenta palette.
The string only worked as intended before the GUI2/Pango days (i.e.
before some 1.5.x version), meaning that the client would use a red
color for the font.
In other words, deplorable user interface design.
Nowadays, the add-ons client uses a dedicated error message path for
presenting this kind of alerts to the user, which uses a dialog with a
visible "Error" caption and everything. We don't really need extra
formatting, and in any case, *it should not be the server's mission to
do this*!
This adds functionality to enable or disable Pango markup on GUI2
widgets instantiated by Lua GUI2 dialogs.
The code is taken almost verbatim from patch #2759 by Exasperation
<https://gna.org/patch/?2759>, rebased against current master.
This truncates long Advanced Preferences list entry labels and values
with ellipses using hardcoded character count limits in order to avoid
stretching out the listbox too much over the dialog's width.
Currently, this is notably necessary for the German translation.
The character count limits chosen for this commit (46 for the label, 8
for the value) only really work with the basic ASCII character set. Some
Unicode characters may be rendered wider. Furthermore, the Preferences
page selection list may container longer entries that push this listbox
further to the right, closer to the dialog's right edge.
Also, I really hope most languages have words for 'yes' or 'no' that are
at most 8 characters in length or can at least be read without ambiguity
when truncated to that limit. At least none of the translations we
support which have translated those words hit the limit.
This makes it so the upwards scrolling arrow button is grayed out at
first when the scrollbar starts at the top; otherwise it was only grayed
out after the user scrolled down and then back to the top.
The last commit fixed one issue but introduced yet another. Now both
should work. Need to investigate if parsing the .plain files really is
necessary, would make things much easier if there was no need for it.
I wrote this a long time ago and have been using it to ease testing of
Wesnoth's default configuration under different conditions ever since.
It creates a new configuration and data directory under /tmp that only
exists for the duration of the Wesnoth session, and disables WML cache
functionality.
This is extremely useful for quickly testing and debugging functionality
dependant on user configuration settings.