Commit graph

203 commits

Author SHA1 Message Date
Subhraman Sarkar
8d3a52eb3f
Stop multiline_text from infinite growing and show scrollbar instead
Fixes the following bugs :

Stop scroll_text from growing infinitely and instead show the
scrollbars when the text dimensions exceed the default size of
the underlying multiline_text in some dialogs (such as edit_pbl,
the pbl publishing editor).

Allow horizontal_grow/vertical_grow to work correctly. Currently,
the widget stops vertically growing due to absence of
max_height=0, again in some specific dialogs.
2024-02-17 12:50:09 +01:00
Subhraman Sarkar
6c5a8e923d
Spinner and multiline textbox widgets (#8199) 2024-02-13 11:54:34 -06:00
Charles Dang
6305185d95 GUI2/Button: added a download button definition 2023-12-27 00:16:09 -05:00
Subhraman Sarkar
f1f67ae5df
Add functionality to Time Schedule Editor (#8066)
selected schedule will write to utils/schedule.cfg on scenario save

HOTKEY_EDITOR_CUSTOM_TODS is disabled unless user loads scenario

custom_tod:Preview button and associated callback added.

editor:translatable attributes now written with leading underscore

editor:support for multiple custom time schedules
2023-12-14 17:12:07 -06:00
Tommy
e24f60fd43 Re-enable blur for various message panels.
This was disabled a long time ago. It might be fixed now.

This reenables blur for character dialogue. I'm not 100% sure what else.
2023-10-28 12:13:33 +13:00
Wedge009
45e537505f Use 'curly' quotes as per typography standard.
[ci skip]
2023-10-23 09:44:50 +02:00
Wedge009
1091fa924f Replace contraction 'it's' with possessive 'its'.
[ci skip]
2023-10-23 09:44:50 +02:00
Iris Morelle
0fa13e9894
gui: Use true labelless checkboxes in the dropdown menu implementation
Using checkboxes with an empty label doesn't quite do the trick and it
results in some (minimal) wasted horizontal space.
2023-05-22 03:45:23 -04: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
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 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
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 8481927a5a)
2018-10-07 03:22:49 +00:00