194 Commits

Author SHA1 Message Date
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
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
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
Charles Dang
cdd854d5fa GUI2/Unit Preview Pane: used NN-scaled [drawing] for unit image (resolves #6700) 2022-05-24 16:26:06 -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
Pentarctagon
9bfd432abe Update image pages for webp extension. 2022-04-30 14:23:32 -05:00
Charles Dang
a3b6f57e4d Game Load: revamped design 2022-04-08 03:02:21 -04: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
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
Charles Dang
95893489f2 GUI2: added default_italic label and scroll_label definitions
This is not optimal, but I'll implement a better way of handling formatting later.
2021-08-16 17:15:31 -04:00
Iris Morelle
4b40afe052
gui2/label: Add "bad" label variations
These are displayed in #FF0000 red currently.
2021-06-19 07:40:07 -04:00
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
Iris Morelle
847b70ab4c gui2: Refactor widget frame code used for buttons and comboboxes 2021-03-26 04:27:18 -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
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
cb53d30799 gui2/label: Add a normal-sized gold label definition 2021-02-22 00:30:28 -03:00
Charles Dang
551cb75693 MP/Lobby: reorganized sidebar, added player info section 2020-12-31 13:02:24 +11: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
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
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
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 213453e6cf78371360471ac4d110602aafecd9f3, 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
fa08ff291b gui2/button: Fix highlight colour for the disabled state
It was apparently copy-pasted from the pressed state. This resulted in
disabled buttons looking like they are pressed.

[ci skip]
2020-07-27 06:02:53 -04:00
Iris Morelle
5afb96e808 gui2/toggle_button: Add a checkbox variation without a label 2020-07-06 23:25:05 -04:00
Iris Morelle
e2c5b923fb gui2/toggle_button: Add a radio button variation without a label 2020-07-06 21:32:27 -04:00
Glen Whitney
8ba16c972a Scale buttons and toggle buttons with screen pitch also. 2020-05-26 16:20:52 -05:00
Glen Whitney
b91b5095e5 Work around issue #4908. 2020-05-21 11:23:23 +02:00
Glen Whitney
f3a472ab96 Modify GUI2 config files to scale font size with screen pixel pitch
These changes to the data/gui subdirectories make it so that above a certain
  screen pixel dimensions (currently 1200x900), text font sizes will be scaled
  with the pixel pitch of the SDL video device. In addition, several dialogues
  (such as the unit recall window, for example) are allowed to take on larger
  pixel dimensions to accommodate the larger (in pixel size) fonts.
2020-05-16 15:01:01 -05:00
Iris Morelle
af60f10391 gui2/text_box: Re-do borders for all states
This makes it so all states of the text box widget have borders again.
The colours are changed, however, so that the focused state has the
brightest border.

This turned out to be necessary because otherwise the chat input textbox
in the MP lobby completely blends with the chat log box, making it seem
as though it disappears whenever it doesn't have the keyboard focus.

[ci skip]
2020-01-24 01:43:53 -03:00
Charles Dang
954d0cdc00 GUI2/Text Box: restored border on disabled state
[ci skip]
2020-01-22 23:31:38 -05:00
nemaara
5c9077dc41
Merge pull request #4568 from nemaara/language_icon
Title screen: move language button to icon
2019-11-17 19:22:42 -05:00
Iris Morelle
335e5ccdf3 gui2/progress_bar: Modernize appearance
The old design was heavily based on the old GUI0 loadscreen, inheriting
the weird blocky 3D shading effect reminiscent of the old Windows 9x
times. This makes it look very obviously out of place with the current
Wesnoth UI look and feel.

We increase the default width of the progress bar to reduce visual gaps
between different phases of the add-ons client's initial connection
sequence, and decrease the height to something that is more in
proportion with the font size without taking up more space than
necessary. The colours are inspired by the current textbox and button
widgets while keeping consistency with the rest of the game's UI.

[ci skip]
2019-11-17 01:49:15 -03:00
nemaara
acc96b165d Title screen: move language button to icon 2019-11-15 23:00:46 -05:00
Iris Morelle
3beefca899 gui2/text_box: Add hover effect
This gives GUI2 textboxes (and password boxes since they are a subclass)
a simple hover effect by extending the canvas definitions for the widget
accordingly.
2019-11-11 17:16:39 +11:00
Charles Dang
cfd7d0e4e5 GUI2/Text Box: UI tweaks suggested by shadowm
[ci skip]
2019-11-04 17:25:25 +11:00
Charles Dang
5aaf179728 GUI2/Unit Preview Pane: tweaked attack display spacing
[ci skip]
2019-09-28 14:40:59 +11:00
josteph
2fc9804df0 unit_preview_pane: Move the icons to before the damage and strikes, as in the sidebar. 2019-03-08 17:19:00 +00:00
josteph
c720e6686e unit_preview_pane: Add attack icons 2019-03-08 17:12:04 +00:00
Edward Chernenko
0112a82a35 Fix typo in menu_button: active icon was used instead of pressed icon
Icon [short_arrow_left_25-pressed.png] exists, but is not used anywhere.
Widgets in [menu_button_default.cfg] and [multimenu_button_default.cfg]
were using [short_arrow_left_25-active.png] for the "pressed" state.
2019-01-02 19:10:35 +02:00
josteph
bf8cd9f90b GUI: Fix the direction of the arrow on a listbox sort column header.
This affects the files list in the the "Load Game" dialog.

(cherry-picked from commit 8481927a5a630165c98a7c81c5cf5556ccfc9e35)
2018-10-07 03:22:49 +00:00
Charles Dang
8137e9a454 GUI2/Chatbox: limit input to 256 characters (fixes #3267)
[ci skip]

(cherry-picked from commit c5d6f695dd712c9a33fd3a5c12f98e19e2b393fd)
2018-10-07 03:22:47 +00:00
Charles Dang
b6991ced4d MP Staging: made the faction select button about as prominent as you can get
[ci skip]

Thanks to grzywacz for pointing out the possible use of the unit icon.

(cherry-picked from commit dba3d409fcf64b356f34ad82a32fa762cc5dfb8c)
2018-10-07 03:18:57 +00:00
Charles Dang
3f5d554f8c GUI2/Label: tweaked link color
[ci skip]

(cherry-picked from commit 1903b05ab11107fad80a38733a1af2bf1d00727b)
2018-10-07 03:18:47 +00:00
Charles Dang
e0b35791e2 GUI2/Text Box: refactored hint text interface
Previously, I had implemented the hint text ("Search)" and image (the magnifying glass)
as a custom text box definition. This caused some problems, though. Since the string was
hard-coded as part of a WFL formula, it couldn't be translated (see #2709 and #2732). It
also wasn't expandable to any other usecase.

Instead, I've added two new hint_text= and hint_image= keys to [text_box], wrapped the
"Search" text and magnifying image path in a helper macro, and refactored the default
definition to display the hint text and image when appropriate.

This also fixes a minor issue where selected text wouldn't remain highlighted when the
box wasn't focused when using the filter definition (it did with the default one).

This should fix the untranslatable "Search" text issue mentioned in both issues above.
The new string is in the wesnoth-lib textdomain.

(cherry-picked from commit db5abb7e637fd87699fce49a9543faafc3f58068)
2018-10-07 03:18:19 +00:00
Charles Dang
3a90f86674 Addressed more whitespace issues from #2613
[ci skip]
2018-03-12 03:48:59 +11:00
Charles Dang
471c9e876a Addressed a large chunk of the whitespace issues from #2613
[ci skip]
2018-03-09 11:37:00 +11:00
Charles Dang
894cc6a3cc GUI2/Toggle Panel: switched to procedural border drawing for semi-transparent message variant
[ci skip]

This matches the regular toggle panel now.
2018-02-23 15:45:02 +11:00
Charles Dang
5f1005d5ce GUI2/Chatbox: removed room listbox header
[ci skip]

Headers don't do anything with horizontal listboxes.
2018-02-22 16:19:49 +11:00
Charles Dang
b35663e1bf GUI2/Chatbox: handle main border in including windows
[ci skip]

This is consistent with other widgets.
2018-02-22 15:13:48 +11:00