Commit graph

1813 commits

Author SHA1 Message Date
Celtic Minstrel
0c42cdc038
Enable translation mark validation by the schema (#5800)
- The t_string type is now a schema built-in type and no longer attempts a regex match.
- You can also specify that non-t_string types may be optionally-translatable; this case supports a regex match on the string (but note that the translation mark is not part of the match).
- Error messages involving keys with very large values ( > 128 characters) will now truncate the value.
- To account for occasional cases where the schema is intentionally violated, the --validate command-line option now automatically defines the SCHEMA_VALIDATION preprocessor define.

A key validates as type t_string if one of the following is true:
- The key is not present
- The key has at least one segment with a translation mark
- The key is blank (an empty string)

Any type other than t_string is not allowed to be translatable by default, unless you specify allow_translatable=yes in the [type] tag.

An optionally-translatable string could also be defined as a union of t_string and some other type.
2021-06-14 23:59:52 -04:00
Steve Cotton
f7f58613f6 Filtering by tags in the add-on manager
The existing PblWML specification includes a comma-separated list of tags.
Until now there are no official tag names, but some of the 1.14 add-ons already
have some unofficial ones. If this feature is included in 1.16 then I assume
many UMC authors will use the newly-official tags.

For a larger add-on list than the dev server has, use port 15014 which will
connect to the 1.14 server instead (in the connect dialog change the address to
addons.wesnoth.org:15014).
2021-05-16 00:53:20 +02:00
Steve Cotton
7f53aa08a5 Add-ons manager: show tags in the details panel
Show the contents of PblWML's "tags" attribute in the add-ons dialog. They're
shown at the bottom of the right-hand panel (only if the window size is large
enough to trigger that dialog's two-panel layout).
2021-05-15 17:18:18 +02:00
Steve Cotton
8120473254 Add-ons manager: Move feedback to the top of the details list 2021-05-15 17:18:18 +02:00
Steve Cotton
489d364cb6 Make the debug clock look right
This is the only widget in mainline using GUI2's [draw][circle] tag. I'm
currently working on a change to the C++ text_shape class, and want to
be able to regression-test the placement of [circle]s after that change.

I'd be okay with deprecating both [circle] and [round_rectangle] as neither
seems to be used elsewhere, but this close to feature-freeze I'd prefer to keep
them in 1.16 rather than suggest removing them now.

To see the widget, start the game with `wesnoth --clock`, and then click the
button underneath "Quit" on the main menu.
2021-04-05 12:59:10 +02:00
Pentarctagon
6b97a76109 Add a prompt to allow entering an add-on's password at upload time.
This is an alternative to needing to store the plaintext password in the _server.pbl.
2021-04-04 01:28:23 -05:00
Iris Morelle
847b70ab4c gui2: Refactor widget frame code used for buttons and comboboxes 2021-03-26 04:27:18 -03:00
Iris Morelle
00fbce5872 gui2/game_version: Add logs dir to the Game Version dialog on Windows 2021-03-25 21:21:59 -03:00
Iris Morelle
220c3f5752 gui2: Restyle comboboxes to look like buttons rather than textboxes 2021-03-20 01:55:45 -03:00
Iris Morelle
3cbe0a5ef7 gui2: Make GUI_LINE and GUI_POINT public macros
This detaches them from the GUI2 button definition.
2021-03-20 01:54:45 -03:00
Iris Morelle
2fac56c21f gui2/drop_down_menu: Make display of entry details more orderly
The primary target of this change is hotkey labels in game menus. This
aligns them all to the right of the menu and increases the space between
them and the menu item label proper to attain a cleaner appearance.
2021-03-20 01:33:43 -03:00
Iris Morelle
1f97941a33 gui2/lua_interpreter: Use monospaced textbox for code input 2021-03-13 19:24:35 -03:00
Iris Morelle
3ddbeb0b1e gui2/text_box: Add a monospace font variation
This requires communicating the font family to the internal renderer, so
it's not just a WML change.
2021-03-13 19:23:42 -03:00
Iris Morelle
3d7842c43e gui2/mp_faction_select: Use a disambiguator for the Random gender option
You just know sooner or later someone's going to try to use "random" for
something other than gender and some translations will end up looking
wrong as a result.
2021-03-12 20:01:52 -03:00
Iris Morelle
cb53d30799 gui2/label: Add a normal-sized gold label definition 2021-02-22 00:30:28 -03:00
Iris Morelle
b231306631 gui2: Drop trailing stops from tooltips 2021-02-20 14:43:56 -03:00
Iris Morelle
38af14f1a8 gui2/preferences: Streamline filter options on the Hotkeys page
Categories vs. Filter both deal with filtering -- the only difference is
that categories has a broader scope than the name-based filtering, with
the latter being applied to results for the selected categories. We
don't need two rows for both.
2021-02-20 14:37:13 -03:00
Iris Morelle
4d8cff6c40 gui2/preferences: Increase window height to accomodate the sidebar
This is specifically meant to address the sidebar gaining a short
vertical scrollbar at higher resolutions because of button sizes
increasing slightly.
2021-02-20 14:08:33 -03:00
Steve Cotton
09c8c506e1 Make the preferences window big enough for HDPI fonts
The hardcoded size of the window was too small for the large fonts on HDPI
displays, this changes to using the automatic width and calculated-based-on-dpi
height. On HDPI displays that does leave blank space on the General tab, but it's
better than not scaling.

Buttons that were placed at the bottom of pages move up so that they aren't
too far from the other controls. The sub-tab-selector buttons on the
multiplayer tab move above the sub-tabs themselves.

With HDPI text, the checkboxes are placed a little too high to align with
the font, but that's a cosmetic detail; this commit fixes the usability issue.
2021-02-19 15:52:47 +01:00
Iris Morelle
5d67c191ef gui2/statistics_dialog: Minor restyling
* Moved the combobox (sorry celmin) to the top right in a manner akin
   to the search boxes in dialogs with those.
 * Switched list headers to using the gold_small label variation.
2021-02-17 01:49:13 -03:00
Iris Morelle
f8d7969774 gui2/unit_list: Fix Status header's baseline being completely off 2021-02-17 01:28:30 -03:00
Steve Cotton
4a43d00522 Show a two-color tennis ball orb for the disengaged state (#5155)
As the disengaged state is part-way between the "partial" and "moved" states,
the orb has parts in each color. On the minimap these units are shown in the
partial color (which is also the color that would be used before this change).

This will match the mounted Quenoth units' "disengage" skill, when they
can still move but can't attack. It should also trigger for some UMC abilities
that get extra moves after a character attacks.

During testing, I found that TSG allows some of the bandits to attack on the
first turn of the bandit branch. There's no gameplay change there, but the orbs
make it much clearer that some units can still attack.

I think there are already too many preferences for orbs, so reused the existing
settings for the colors. A new "show disengaged orb" preference is added, which
when disabled shows the old partial orb instead.

Update the orb and ellipse sections of doc/manual/.

Notes about how I created the new orb image:

* create a color range to_ellipse_red with rgb=FF0000,FF0000,000000,FF0000
* wesnoth --render-image 'misc/orb.png~RC(magenta>to_ellipse_red)' images/misc/orb-ellipse-red.png
* open the orb.png and orb-ellipse-red.png images as layers in Gimp, add a layer mask to both of them
* use the layer mask to get each pixel from exactly one of the layers
2021-02-13 18:28:33 +01:00
Charles Dang
3757f2caf6 GUI2/Loading Screen: made animation time-based instead of frame-based
Big thanks to @celticminstrel for help on this.
2021-01-25 18:56:48 +11:00
Charles Dang
745b774102 GUI2/Preferences Dialog: utilized maximum_value_label 2021-01-25 18:52:17 +11:00
Charles Dang
454bed95ce GUI2/Loading Screen: improved animation 2021-01-25 09:21:01 +11:00
Charles Dang
4bf5acf3f2 GUI2/Chat Log: marked text area as link-aware (fixes #5485) 2021-01-22 14:08:10 +11:00
Charles Dang
e3f8b68796 Added basic dialog definitions for the Match History viewer 2021-01-17 11:48:21 +11:00
Charles Dang
984afc0dab MP/Lobby: renamed Information button to Announcements 2020-12-31 13:09:09 +11:00
Charles Dang
551cb75693 MP/Lobby: reorganized sidebar, added player info section 2020-12-31 13:02:24 +11:00
Charles Dang
5f79d547fb GUI2: gave FILLER_ROW a grow factor of 0 2020-12-31 03:11:58 +11:00
Steve Cotton
4205de91e5 Remove the editor's unused set_starting_position dialog
6424d79f48 changed to using an editor palette instead.
2020-12-30 15:01:47 +01:00
Charles Dang
dd05156cf9 MP/Lobby: further tweaked filter labels, added tooltips 2020-12-23 21:19:36 +11:00
Charles Dang
8afe3f595c MP/Lobby: flipped blocked players filter
Now it's an inclusion filter (false by default) rather than an inclusion filter.
2020-12-23 19:28:07 +11:00
Charles Dang
28264cf876 MP/Lobby: improved filter area
* Improved labels
* Reordered options
* Left-aligned the section with the filter box for easier access
2020-12-23 15:46:28 +11:00
Iris Morelle
61e832e9af gui2/campaign_selection: Layout tweaks for the settings row
This makes the row actually take up its full horizontal space and spaces
out the columns very slightly while still allowing them to be usable at
800x600.

It also replaces the overlong detailed descriptions for the options in
the Combat menu with tooltips holding the same contents.
2020-12-19 03:47:54 -03:00
Iris Morelle
10d578bb7b gui2/campaign_selection: Use "Timeline" for the timeline sorting header
It's more elegant in context than "dates".
2020-12-19 03:47:54 -03:00
Iris Morelle
19004a6950 gui2/panel: Avoid using images and just draw rectangles
The opacity used here for the fill colour is identical to the one used
in the image file.
2020-12-19 03:47:54 -03:00
Iris Morelle
4b5eabdfb0 engine: Control experimental PRNG option via game classification
This removes the use_prng Advanced Preferences option and replaces it
with a new possible value for randomness in the game classification
class, "biased". It also changes the enumeration label for it in the
GUI2 campaign dialog.

It also makes it so the synced RNG is automatically used with this
option as well as the existing deterministic randomness option ("save
random seed").
2020-12-19 03:47:54 -03:00
Iris Morelle
ac53f93004 gui2/campaign_selection: Major dialog overhaul
CC: issue #4543

(N.B. This is a monolithic mega-commit because of a bunch of
experimental phase changes that necessitated constant changes to both
engine code and UI WML.)

This redesigns the campaign selection dialog implementing a
campaign-defined background image that changes depending on the selected
campaign, specified by the [campaign] background= attribute; adding a
menu button for selecting the RNG mechanism in use (default RNG vs.
predictable RNG a.k.a. "save random seed"); and finally, adding a menu
button for selecting the campaign difficulty without having to go
through the campaign difficulty selection dialog.

A huge amount of changes to the UI WML were required for this to say the
least.

This also adds the following new widget definitions:

 * toggle_button: listbox_header_centered, listbox_header_bg,
   listbox_header_centered_bg
 * panel: panel_listbox_bg, campaign_menu_bg

As a side effect, two private methods in
gui2::dialogs::campaign_selection() are no longer const-qualified. No
idea why they were const-qualified in the first place, but it
interferred with some of the new code in a major way.
2020-12-19 03:47:54 -03:00
Charles Dang
3118f34798 GUI2/Screenshot Notification: use action_browse definition for browse button 2020-12-19 11:32:14 +11:00
Charles Dang
5feaf973ce
Merge pull request #5363 from shikadiqueen/feature/addonmg-url-ux
gui2/addon_manager: Replace URL widgets with a single link label
2020-12-17 04:46:15 +11:00
Charles Dang
c65db9acbb GUI2: added _WIDGET_DEBUG_BORDER macro 2020-12-16 19:18:29 +11:00
Iris Morelle
cc052ed5a5 gui2/game_version: Minor streamlining 2020-12-15 19:49:40 -03:00
Iris Morelle
599509eb52 gui2/addon_manager: Replace URL widgets with a single link label
The URL widgets (textbox + copy button + browse button) predate the
implementation of link-awareness in labels and they sort of got carried
over into the new design magically without there being a real need for
that. Now that we have a visible cursor change when hovering links it's
even less necessary to draw unnecessary attention to the link with a
clunky and unintuitive (greyed out textbox...) interface.
2020-12-15 17:51:08 -03:00
Charles Dang
b3d4a3744d GUI2/Addon Manager: removed link awareness from addon descriptions
Formatting is disabled for these and links require formatting, so this is redundant.
2020-12-15 11:57:33 +11:00
Charles Dang
3ca809d534 GUI2/Player Info: removed redundant grid 2020-12-14 23:53:20 +11:00
Charles Dang
24c8c3bd01 GUI2/Button: restored vertically-offset text positioning
The "plain" centered text looks a little weird with buttons
2020-12-14 23:51:16 +11:00
Charles Dang
17f979d866 GUI2: removed pixel offset from GUI__TEXT_VERTICALLY_CENTRED
Fixes the text of menu_buttons being 1 pixel too high. Seems this is a relic from 2016 and me tweaking the
formula to try and get things more centered in buttons... But in that case, adjustments shuld probably be
directly made to buttons, not here.
2020-12-14 06:21:20 +11:00
Charles Dang
7188781f91 GUI2: made link_aware a per-instance config option rather than per-definition
Back when link awareness was first added (https://github.com/wesnoth/wesnoth/pull/300), this key was added
globally to label definitions alongside link_color. This had the unintended side effect of making *all* labels
link aware, leading to issues such as being able to open a do-you-want-to-open prompt from an instance of the
same ad-infinitum.

This became an active issue after 213453e6cf, since now that labels could capture
focus if link_aware was true - which it always was for most labels - labels in toggle panels would always
grab mouse_motion events and no longer allow their parent toggle panels to gain their hovered states. That
appears to be in keeping with the design of GUI2, and a further evaluation of that issue is needed at a later
time. However, the fact remains that almost every single label was marked as link-aware, even when in almost every
case that was not the desired behavior.

This change move the link_aware config option to individual label and scroll_label instances. The following uses
had this explicitly enabled:

- Addon license prompt
- Addon descriptions
- Campaign descriptions
- The Server Info popup
- The chatbox
2020-12-12 03:03:09 +11:00
Iris Morelle
f49cb62c7c gui2/addon_license_prompt: Fix missing translation mark 2020-12-10 04:34:22 -03:00