Commit graph

1878 commits

Author SHA1 Message Date
Pentarctagon
ad3f1c95b0 Add support for distinct sub-achievements.
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.
2023-05-17 23:54:16 -05:00
Slayer95
0620822ab2
wmlxgettext: Improve parser resiliency for malformed files (#7625)
* 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.
2023-05-17 21:40:36 +02:00
Celtic Minstrel
8dea67d323 Don't allow markup in achievement titles.
This is done as a guarantee that there will always be one unambiguous way to identify that the achievement is completed.
2023-05-06 14:45:40 -04:00
Pentarctagon
6fe2627048 Fixup, complete, and enable the lobby's game history viewer.
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.
2023-03-11 10:55:55 -06:00
Arnav Vijaywargiya
02a4c1beac Display ID of addon in addon manager 2023-03-08 08:48:20 +05:30
Steve Cotton
1bbce8a610 GUI: fix indentation that uses both tabs and spaces on the same line
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.
2023-03-07 12:21:28 +01:00
Pentarctagon
f68d8cf980 Add achievements button to titlescreen. 2023-02-12 10:10:15 -06:00
Pentarctagon
1bbe240f82 Revert "Don't interpret markup for achievement name."
This reverts commit 971656fca0.

No idea why I thought this made sense.
2023-02-09 00:00:03 -06:00
Pentarctagon
971656fca0 Don't interpret markup for achievement name. 2023-02-08 23:34:16 -06:00
Pentarctagon
e3bb346b39 Add functionality for achievements to be partially complete.
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.
2023-02-04 15:43:28 -06:00
Pentarctagon
d1465a9eb9
Add basic achievements functionality. (#7237)
* 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!
2023-01-21 10:32:45 -06:00
Steve Cotton
686e35e0e3 Use two-color orbs for allies' units (configurable by preferences)
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'.
2023-01-17 18:06:46 +01:00
Steve Cotton
d35ea2f2dc Orb color preferences dialog layout and tooltip
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.
2023-01-14 18:10:14 +01:00
Pentarctagon
3d7d5dbdbf
Add ability to allow secondary authors to upload an add-on. (#7268)
* 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.
2023-01-11 10:21:55 -06:00
Pentarctagon
4218924c4a Fix copy/paste comment. 2022-12-28 12:08:09 -06:00
Wedge009
765cf1e79f Add screenshots directory to game version dialogue.
Resolves #7096.
2022-11-12 20:34:33 -06:00
Kingofd
4b8d4f1fb5
Adding language filter option in addon menu (#7048)
Resolves #1063
2022-11-05 12:04:55 -05:00
Pentarctagon
5d174a3493 Update lobby tab text. Resolves #7056 2022-11-01 19:24:05 -05:00
Pentarctagon
08e79f4e36 Add filter for bot-hosted games.
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
2022-09-26 09:01:11 -05:00
Pentarctagon
0e85fac29c
Have /report show a dialog for entering information. (#6969)
Resolves #5056
2022-09-02 21:18:03 -05:00
Iris Morelle
532ec4e06f addon/client: Add modeless dialog for displaying add-on install progress
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.
2022-08-06 15:11:41 -05:00
Tommy
ebcae03e48 Add a new image tiling mode: "tile_highres" for high-DPI tiled images.
The other options "tile" and "tile_center" work in draw space,
which is consistent with past behaviour, but doesn't look as nice.
2022-06-14 14:48:03 +12:00
Charles Dang
f86c935668 GUI2/Panel: used rect fill color for box display 2022-06-14 14:47:45 +12:00
Tommy
575286cb86 CVideo: remove get_dpi and get_dpi_scale_factor.
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.
2022-06-11 05:56:06 +12:00
Tommy
638c02b59e Rename image_shape.vertical_mirror_ to mirror_.
It is in fact (and always was) mirroring horizontally.
2022-05-31 21:17:33 +12:00
Charles Dang
da4a201101 MP/Create Game: don't hardcode random faction mode options
This still means we need to make sure the options are in the same order as in the enum,
but that was also the case in the old code.
2022-05-28 17:11:51 -04:00
Charles Dang
cdd854d5fa GUI2/Unit Preview Pane: used NN-scaled [drawing] for unit image (resolves #6700) 2022-05-24 16:26:06 -04:00
Charles Dang
023bdb7142 GUI2/Preferences: refactored how hotkey categories are handled
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.
2022-05-24 16:09:00 -04:00
newfrenchy83
81d41a861d
Add tooltips to unit_attack dialogs (#6462)
In tooltips, the special and weapon_abilities are listed by stats (damage, attacks and chance to hit), and the owner of each is specified.
2022-05-18 08:54:28 +02:00
Charles Dang
8a960fca68 MP/Create: added button to reset timer settings, ensure they're saved (resolves #1556) 2022-05-06 16:10:45 -04:00
Charles Dang
840799eef4 GUI2/Language Selection: double borders 2022-05-06 02:45:40 -04:00
Charles Dang
e950b5f2ac GUI2/Uninstall Addons: double borders 2022-05-06 02:02:06 -04:00
Charles Dang
64b7624ea2 GUI2/Preferences: doubled borders in advanced prefs 2022-05-05 23:38:30 -04:00
Pentarctagon
9bfd432abe Update image pages for webp extension. 2022-04-30 14:23:32 -05:00
Charles Dang
b6fa7733b3 GUI2/Preferences: made better use of space for display scaling option 2022-04-30 14:20:47 -04:00
Tommy
3a781c87ad Add pixel scale preference option. 2022-04-18 17:25:06 +12:00
Charles Dang
a3b6f57e4d Game Load: revamped design 2022-04-08 03:02:21 -04:00
Charles Dang
6b329a020a Loading Screen: added an (as-yet unused) image background layer 2022-04-08 02:59:11 -04:00
Pentarctagon
95aaac76a9 Store add-on passwords in the credentials file as well.
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.
2022-03-10 10:23:01 -06:00
Wedge009
0709145670 Resolve title-screen vs main menu inconsistency.
Discussed in #4390 and originally introduced in 7c8c3114.
2021-11-10 11:20:33 +11:00
Charles Dang
65b7baab64 Orb Colors: fixed lack of borders on a label
Also moved this row to the bottom for UI cleanliness
2021-11-05 02:56:07 -04:00
Hejnewar
4fe7751158
Increase the limits of timer values that players can set 2021-11-03 16:07:41 +01:00
Iris Morelle
76b83e623d
gui2/addon_manager: Move Search to the top right on small resolutions 2021-10-26 18:29:34 -03:00
Charles Dang
8fe95f2876 GUI2: increased listbox header toggle heights
Removed borders in the campaign dialog usage to compensate.
2021-10-26 02:14:29 -04:00
Iris Morelle
f96be0298e
Allow enabling the VSync hint on SDL's software renderer
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.
2021-09-25 18:06:33 -03:00
Iris Morelle
3fb9df3b8d
gui2/title_screen: Increase bottom row margins from 0px to 10px
This hopefully makes it seem a little tidier than having all of the
bottom row buttons and labels hugging the edges of the game screen.
2021-09-24 17:59:56 -03:00
Iris Morelle
6303d72806
gui2/title_screen: Give the Language button its label back
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.
2021-09-24 17:59:56 -03:00
Iris Morelle
a4054b0af6
gui2/button: Add definitions for special title screen buttons
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.
2021-09-24 17:59:35 -03:00
Iris Morelle
5c03595910
gui2/core_selection: Use a more apropos OK label
This is not a string freeze-violating change because the string already
exists in its textdomain.
2021-09-23 17:28:31 -03:00
Iris Morelle
25b7d3d8d0
gui2/core_selection: Allow links to be parsed in core descriptions 2021-09-23 16:27:23 -03:00