Basically switched this dialog to take userlist data from the server instead of the scenario config,
since the former caused various issues as listed in #1867.
I've also removed the manual call to update_player_list in pre_show since it's not really necessary
(and I don't have any list data to pass there anyway) since the network handler will call it once it
receives data.
A similar change isn't needed in MP Staging since the connect engine handles all the user list stuff.
For some reason, when I first implemented this dialog, I had it manage it own window pointer like modal_dialog
or modeless_dialog and display itself non-modal-y, despite being a modal dialog... IIRC it was probably some
ill-conceived attempt at "threading" so the game could load the config while it displayed. That's a moot point
now since the dialog was soon after refactored to use actual threading, rendering these bits useless.
# Conflicts:
# src/gui/dialogs/loading_screen.cpp
* Use a unique_ptr for the window member.
* Made use of the new remove_from_window_stack function (its impl was copied from this code)
* Only attempt ows removal if window display mode is modeless (since if mode is tooltip, no
ptr was added to the list anyway.
# Conflicts:
# src/gui/dialogs/modeless_dialog.cpp
This seems to have been the cause of some crashes and weird behavior with the new command console.
Likely the problem came from the wrong pointer being removed from the ows, but exactly why a modal
dialog was even being opened I don't know.
Still, this is a safer method overall and it guarantees the correct pointer is always removed.
Not sure why, but in some cases the overlay calculations were getting screwed up. This makes them use
the general centered image macro, with accompanying fallback safety checks.
Stores in variable the defense of a unit on a particular terrain. If terrain is not specified, the terrain on which the units currently stands is used. (Note: it is a WML defense, so the higher it is, the weaker unit's defense is.)
* StandardUnitFilter
* loc_x, loc_y: x and y of terrain location.
* terrain: alternatively, the character of terrain.
* variable: the name of the variable into which to store the defense. default: "terrain_defense"