This adds support for having up to 28 distinct sub-achievements within a single achievement. This limit exists since wesnoth's layout isn't smart enough to tell a horizontal listbox to actually use its scrollbar instead of forcing a horizontal scrollbar on the whole window.
Additionally this adds the [set_sub_achievement] and [has_sub_achievement] WML tags and their respective lua functions. [has_sub_achievement] is unsafe for use in MP, for the same reasons that [has_achievement] is.
* wmlxgettext: Improve parser resiliency for malformed files
- WML files with no translatable strings will no longer
crash the script on unbalanced tags (but translatable will).
- .cfg files belonging to man(1) will no longer crash the script.
* Remove stray quotes from textdomain declarations
These are not recognized by the wmlxgettext parser.
At some point in the future I'd like to come back and add some search parameters - right now it shows the game history of the currently selected player in the lobby, but ideally it would instead have options for player name, era, scenario, etc.
This isn't the complete set needed to allow `check_mixed_indent` to
run over the data/gui directory, it's just these small changes:
* Remove the single space from lines indented "tab ... tab space".
* Convert lines indented with "tab ... tab four_spaces".
Although these are WML files, the coding standard for the data/gui
directory is to indent with tabs instead of spaces.
Instead of being either complete or incomplete, achievements can now specify a value at which they will be considered complete. For such achievements that are not yet complete, a progress bar is added to the achievements dialog showing how close to completion the achievement is.
* Add basic achievements functionality.
This reads the mainline achievements.cfg and then all the achievements of each installed add-on.
This is intentionally handled separately from other WML loading so that:
a) All achievements and their status are able to be displayed on the main menu right after Wesnoth starts and regardless of which add-ons are active.
b) Add-ons can add additional achievements to other content, whether UMC or mainline. For example, a modification that adds more achievements for mainline campaigns.
Marking something as achieved is handled by the new [set_achieved] tag and whether an achievement has been completed can be checked via [has_achievement].
There is no attempt to prevent people from manually editing which achievements they've accomplished.
NOTE: These are *not* in any way related to Steam achievements!
These orbs no longer look the same as the player's own orbs, so they
won't cause confusion in multiplayer.
The relevant part of the advanced preference now shows:
```
[ ] - Show ally orb
[ ] - During ally’s turn, use a two-color orb to show movement
Radio buttons for colors: ( ) ( ) ( ) ( ) ( ) ( ) ( )
```
That offers these choices:
* Don't show ally orbs at all
* Always use the one-color (with ally color, not status)
* Use the two-color when that ally is playing, single color at other times
* Use the two-color when that ally is playing, no orb at other times
Rename some `allied_orb` functions to be `ally_orb`. This makes them consistent
with both the names of the corresponding `enemy_orb` functions and the WML
attribute that's used in the preferences file.
This probably doesn't need a change to the in-game help, at least for the en_US
version of the documentation. The current text in data/core/help.cfg is:
* Blue for allied units, except during that ally's own turn.
* During the ally's own turn, their units will be shown with the colors showing
whether the units can still move and attack; however their moves, and the
corresponding orb changes, are delayed as explained in "Shroud and Fog of War'.
Add some spacing to make it clearer what is grouped with what, move the
disengage orb's setting to be part of the partial orb's group, and add
a tooltip for it.
This dialog uses checkbox labels as section headers to indicate what the rows
of colors refer to. This commit doesn't change that, but it makes the grouping
clearer. Actual section headers would take additional space and probably not
look any better.
* Add ability to allow secondary authors to upload an add-on.
The secondary_authors attribute is a comma-delimited list of forum accounts that can also upload updates to an add-on. Secondary authors can't change the primary/secondary authors and can't delete the add-on.
The primary author can also make someone else the primary author by:
* Putting their username in the secondary_authors attribute
* Putting someone else's username in the author attribute
* Uploading the add-on while selecting themselves
This works since they are still (until the upload is done) the primary author in the database, so they are allowed to change the authors list, including in this case.
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.