Bot-hosted games are now shown in a separate tab from player-hosted games, based on the new auto_hosted attribute on the game creation WML. This is not something that's available to be selected during game creation since it's assumed it will instead be set by the bot implementation. Note that this isn't *really* putting games into two separate tabs, it just looks that way for UI/UX reasons.
Resolves#6939
This implements an add-on extraction progress dialog that does not
actually run its own event loop, allowing the caller to take ownership
of it (display() static method) and update its state using a callback
function object. The object in question is passed into the add-ons
management API and used to update the dialog status each time an add-on
file is written to disk as part of the pack extraction process.
In order to avoid stalling the extraction process in UI code, the
callback is invoked for every single file, but the dialog's progress
update method places a time restriction on GUI2 API calls of 120
milliseconds -- this is a good throttle interval that allows add-ons to
be extracted in about the same amount of time as before while still
updating the progress bar smoothly enough for add-ons that take longer
than that.
(This is not the most trivial code to test, so it is suggested to add a
sleep/delay API call in unarchive_file() in src/addon/manager.cpp to
introduce artificial delays.)
One issue with this code, however, is that because modeless_dialog
doesn't execute its own event loop, the only way to get the dialog to be
updated is to force a draw event in ourselves via the new
gui2::dialogs::modeless_dialog::force_redraw() method. This is really a
side-effect of my design choice here to run the dialog in the middle of
a blocking operation instead of somewhere where events are being
processed normally. I'm not entirely sure if the draw events would be
pushed even in that case, however.
Closes#1101.
screen_pitch_microns is deprecated, and has been removed from the
GUI_SCALE_RESOLUTION macro in WML. The macro itself has been left in
place for potential future use.
The screen_pitch_microns variable has been left in place, but is now
a constant and will only ever return the default value equivalent to
96 DPI.
Constitutes a further refinement of a688ab77b9.
Instead of getting a list of categories and filtering out those without any hotkeys (custom WML ones,
for example), we generate a set of categories from the list of visible hotkeys when we set up the list.
This ensures we only ever have matching categories for the hotkeys we're seeing and removes the need
for extra global bookkeeping in the category code.
This also ensures the category list is reconstructed when resetting hotkeys. I don't know how categories
could have appeared/disappeared after resetting (the old code should be safe), but this makes sure it
will never be an issue since when visible_hotkeys is changed, so is visible_categories.
This allows storing add-on passwords for uploading in the same credentials file as is currently used by the client when connecting to a multiplayer server. For add-on authors that don't keep their passwords as plaintext in their _server.pbl, this removes the need for them to manually enter their password each time they upload an add-on.
Requires SDL 2.0.17 or later. If an earlier version of SDL 2 is
detected at runtime, the option in Preferences -> Display is hidden and
ignored entirely.
Requires restarting the game because it necessitates recreating the
window.
Closes#5018.
This makes the Language button use one of the new title screen button
definitions so it has an actual label in addition to its icon. However,
it also makes the label dynamic to reflect the current language choice.
More specifically, it reflects the current locale's language name, which
turns out requires a surprising amount of effort on our part to obtain.
These buttons have an icon like normal action buttons do, but they also
keep their text label and use a smaller font. Currently only one
instance is provided, for the Language button.
This doesn't scale the campaign image (and the campaign images are generally
350x350 images anyway), so it looks a bit wrong, but it's a lot more useable
on HDPI than putting a 1050x750 limit on a treeview with a text panel.
This is displayed on the bottom left in "big GUI" mode and on the bottom
middle in "small GUI" mode. The hostname label's colour depends on
whether the connection is actually layered in TLS or not.
The tooltips are kind of a hack because we currently can't set a tooltip
on a grid so it triggers whenever the player mouses over any of its
children or the border/margin space between cells. Instead we set the
same tooltips for both widget pairs via preprocessor trickery and call
it a day.