An extension of af73336, hopefully this will remove some more of the warnings which pop up in MSVC compilation. Also try to use more explanatory variable names as code should generally be self-documenting and easy to read.
This helper function was added to assist with dialog callbacks that took more than just a twindow argument.
However, now that we use C++11, a lambda is a cleaner solution.
This commit still doesn't fix all of them. I decided to leave alone
cases where variables with the same name are assigned in multiple
conditions of the same if...else if...else statement, and cases where a
scope logging macro is used multiple times in the same scope. In any
case, this commit greatly reduces the warning count on MSVC2015 and makes
new warnings much easier to spot.
This is similar to "Draw Hex Coordinates" and "Draw Terrain Codes", and displays the number of terrain graphics surfaces draw for each hex. It is useful for spotting mistakes such as overlay images having non-transparent pixels in adjacent hexes where they shouldn't, or for comparing the efficiency of different kinds of terrain graphics rules.
Most of these were wordier than necessary (e.g. "Save the Map As"
instead of "Save Map As). Also replaced "want" with "wish" in external
prompts at vultraz's suggestion.
This allows the user to use the arrow keys to select fileview entries,
and character keys to enter a name into the textbox below, just like in
the GUI1 version.
Thanks to celticminstrel and vultraz for the tip.
The previous logic reinvents filesystem::directory_name() in a
platform-dependent fashion (it will break if the wesnothd path in
preferences has backslashes on Windows, which is exactly what the GUI2
file dialog delivers), and uses the compile-time install prefix
(non-Windows platforms) or the current working dir (all platforms)
instead of using the game executable's directory, which we can reliably
obtain on Windows or Linux, and automatically fall back to the cwd
otherwise.
Using filesystem::get_exe_dir() as a starting point instead allows for a
much simpler and platform-independent logic (except for the .exe
extension for the binary on Windows, of course).