Commit graph

273 commits

Author SHA1 Message Date
Subhraman Sarkar
e1c87a24a8 rich_label: allow width key to be a wfl formula 2024-09-23 19:49:44 -04:00
Celtic Minstrel
586fbec882 Update GUI2 schema to match existing implementation of text attributes 2024-09-23 19:49:44 -04:00
newfrenchy83
feef53d4ab
Add an 'alignment' attribute to attacks
This attribute, when set to a valid value of lawful|neutral|chaotic|liminal, will assign to the weapon a different alignment than the unit alignment used by default. This alignment is then used when attacking with this weapon.

The attribute is not accessible from lua so far since the fallback to unit alignment does not work.
2024-09-23 17:11:46 +02:00
Jonathan-Kelly
bddbf060a5 Support events in [abilities] and [specials] tags 2024-09-16 21:07:38 -04:00
Gunter Labes
c53cb1d6fb
Add missing tags to game config schema 2024-09-13 21:59:04 +02:00
Subhraman Sarkar
59911072aa support loading gui2 themes from add-ons
Requires a `gui-theme.cfg` file in Add-on root with a `[gui]` tag.
(Add-ons without all buttons in title_screen may get flagged as defunct.)
2024-08-25 01:56:22 -04:00
Gunter Labes
9b70484b4f
Fix an indent inconsistency and add missing final newlines 2024-08-21 21:48:04 +02:00
Gunter Labes
3c45a5b0e7
Update and correct game config schema
Fix schema tags where "name" is a comma separated list which is not actually supported.
2024-08-19 08:25:55 +02:00
newfrenchy83
8f20c12e3d fix incomplete add [disable] abilityto abilities used like weapon special 2024-08-14 19:39:35 -05:00
newfrenchy83
6ebca64acc add [disable] abilityto abilities used like weapon special 2024-08-11 13:29:34 -05:00
Severin Glöckner
00c081cb4b Schema: support other mp_ keys too
In addition to the mp_village_gold used in mainline,
there exist as well:
- mp_fog
- mp_shroud
- mp_village_support
2024-08-03 11:29:02 -05:00
Subhraman Sarkar
43f0e05d57 preferences dialog: expose option for switching gui2 themes 2024-07-16 13:07:57 +05:30
newfrenchy83
77d023690a Generalize the use of max_value and add the min_value attribute
In the case of [leadership], the fact that the values of each ability can be added when cumulative=yes can justify the addition of limit values not to be exceeded, but this can also apply to heals and [regenerates] with the use of 'add' or 'multiply'.

As for [resistance], it already uses max_value, but if cumulative=yes, then all max_values can add up which could be problematic.
2024-06-19 09:18:54 -05:00
Subhraman Sarkar
43f5644e36
Rich Text Label widget for Help Browser GUI2 port (#8655)
A rich text label widget that can show text marked up with help markup.
Also includes the GUI Test Window, accessible in the title screen after launching wesnoth using --clock option. It can be used as dialog template/example or as a place to test GUI2 code.
2024-06-06 16:33:37 +05:30
Severin Glöckner
049706efda Add [part]text_alignment= to schema 2024-05-31 19:07:13 -04:00
newfrenchy83
9fc5887ae9 'value' attribute in [experimental_filter_ability(_active)] can have 'default' value 2024-05-26 13:48:45 +02:00
Charles Dang
7e2a99dc20 GUI2/Listbox: enabled view-only mode
Currently for the vertical listbox only, since it does have some quirks. Removes the assert in the "show" policy checking if the callback is null. It won't be for the listbox, but doesn't really matter since it's not used.
2024-05-25 00:54:29 -04:00
Subhraman Sarkar
9b38089db0
Story screen redesign (#8510) 2024-05-24 19:29:46 +05:30
newfrenchy83
3d097f2950 add [filter_wml] to filter abilities like [experimental_filter_ability], [experimental_filter_ability_active] or [overwrite][experimental_filter_specials]
adding a sub-filter should make it possible to take into account the sub_tags of the abilities in the checking
2024-05-21 14:54:44 +02:00
Subhraman Sarkar
92d66554dd
UI : About dialog (#8803)
* Redesigned the version dialog to serve as a general purpose About dialog.

* Credits button removed from title screen

* Moved community dialog contents to about dialog as new tab

Co-Authored-By: Pentarctagon

* Bugfixes to the tab_container widget

* Success indication mechanism on copy buttons
2024-05-21 09:43:32 +05:30
Subhraman Sarkar
03a46f1d7c
Combobox, Tab Container and Editability in Text Box (#8390)
* new combobox and tab container widgets
* ediability in text box via the editable key
2024-05-06 09:56:44 +05:30
newfrenchy83
82499d0785
add min_value to [resistance] (#8722)
max_value is used to limit the increase in resistance with the "resistance" capability, but there was no equivalent for its reduction.

To be able to add min_value without redoing the "resistance" checking for the umpteenth time, I prefer to modify effect:: so that the checking of these two attributes is done at the same time as the other numerical attributes and keep the door open to a possible generalization of the proceed
2024-04-11 04:48:41 +02:00
newfrenchy83
7eee400ec0 fix shema validation for overwrite_specials
sme weapon special can use overwrite_specials but i forget to put it in shema validation
2024-03-22 17:09:29 +01:00
pentarctagon
59ac60fa12 add secondary_authors to pbl schema 2024-03-16 01:25:29 -05:00
Charles Dang
08fc993c16 GUI2/Canvas: allow text shape to set outline (resolves #8398) 2024-02-24 18:30:33 -05:00
pentarctagon
d4956dbed7 fix mixed indentation. 2024-02-16 09:40:16 -06:00
Subhraman Sarkar
6c5a8e923d
Spinner and multiline textbox widgets (#8199) 2024-02-13 11:54:34 -06:00
Steve Cotton
6828b54ac7 Log instead of assert for incorrect [teleport] tags in ActionWML
Each [teleport] tag should have exactly one each of [source],
[target] and [filter]. Missing any of those is caught immediately
above the new conditional block, so this makes having two or more
of any of them be treated the same.

The log should maybe be made more visible, but it's a case that
can already be detected by schema validation, so validate it
there instead.

The code in teleport.cpp uses assert() in the cases that the
newly-added code in this commit catches. That's bug 8175, and
it's probably still reachable for units with teleport abilities,
so this doesn't close that bug.
2024-02-09 14:45:03 +01:00
Rafael Fillipe Silva
16e9476191 add a disallowed type to override a mandatory name key into a disallowed optional name key
An impossible regex is defined as the value so nothing will be matched, not even an empty string. The field should be omitted entirely.
2024-02-02 14:57:05 +01:00
Rafael Fillipe Silva
1eb2b494c4 remove super from [elseif] tag, similar to [if], as this is a filter context
This removes the `name` mandatory key requirement from the `[elseif]` without the need of an override.
2024-02-02 14:57:05 +01:00
Toom
2056be55a3
Support [harm_unit]experience values kill/attack/defend/fight/yes/no (#8231) 2024-01-18 11:32:18 +01:00
Toom
815af53a75 Add warning when [modification]type is not set, re #3415 2024-01-17 19:48:44 -06:00
Celtic Minstrel
b9ff0c51fe Schema: Fix declaring guard_x/y/loc as required keys in stationed_guard MicroAI (they are optional) 2024-01-06 21:35:40 -05:00
Pentarctagon
d4b1e7e6c4
Add some more abilities' tests (hides, skirmisher, teleport) 2024-01-01 12:34:08 +01:00
Pentarctagon
f992190267
add a bunch of illuminates tests. (#8139) 2023-12-23 12:07:45 -06:00
newfrenchy83
99af904b29 Modify shema validation for more consistency
In the validation schema abilities-value in abilities.cfg contains not only the numerical attributes but also active_on and apply_to, while these two deniers are only used by [resistance], and the abilities used as weapons are validated by the schema validation of special weapons, and the abilities [leadership], [heals], [regenerate] and [illuminates] also use all numerical attributes.
2023-12-23 12:06:57 -06:00
Pentarctagon
87ed0d0339
Add a bunch of tests for heals. (#8074)
Covers only attributes, not filters.
2023-11-30 11:09:52 +01:00
pentarctagon
e9588d755d [filter_specials] -> [experimental_filter_specials]
Since it calls into the same code as [filter_ability] did.
2023-11-17 17:41:41 -06:00
newfrenchy83
b54a901ff3 rename [filter_ability(_active)] to experimental_ability
because it is experimental the tag of filter is changed except for [overwrite][filter_specials]
2023-11-16 01:05:56 +01:00
newfrenchy83
9474525612
check alternative_type and replacement_type when filtering on type
Also move them from being attributes of [damage] to [damage_type], to avoid infinite recursion when determining what the damage type should be.
2023-11-10 16:35:57 -06:00
Gunter Labes
60f58c9694
Allow any key in dummy ability tags
super="units/unit_type/abilities/~generic~" isn't quite accurate since there are a lot of keys/tags in there that may not mean anything for dummy abilities. Probably doesn't hurt to expect they work like in mainline though.
2023-11-05 19:08:31 +01:00
newfrenchy83
3910817cf7
add a 'replacement_type' and 'alternative_type' attribute in [damage] special or ability who modify the type of attack used (#7865)
At the suggestion of @stevecotton, I propose a special 'replacement_type' and 'alternative_type' attribute capable of modifying the type of attack used when the conditions are met.

Also make Holy water combine arcane damage with native type of weapon

Like holy water imbued ordinary weapon, it's seem logic what arcane damage dominant what if more efficient what original type(water can't altered pierce or blading of spear or sword)
2023-10-25 08:10:52 -05:00
newfrenchy83
532d17f958 repair detects non-existent default attribute value
Fix https://github.com/wesnoth/wesnoth/issues/7923 .when we want to detect an ability with value=0-20 and an ability with add=15 is present, this is detected because the system assigns a value of 0 when 'value' is not present, and so the system matches abilities that do not use 'value' or even no numerical value at all. it is therefore necessary to decide that the absence of an attribute is a non-correspondence to the criteria.
2023-10-14 20:14:51 -05:00
Steve Cotton
30eb439a27 Remove [filter_ability]type_value=
There are questions about how this filter should treat empty values, and the
use cases that we can think of can be implemented in other ways, for example,
if we want to look for big damage boosts, then we could filter for
`add=5-infinity` `[or]` `multiply=2-infinity`.

The simple answer seems to be to remove it from the API before we freeze for 1.18.
There's more discussion in issue 7944.
2023-10-12 15:31:45 +02:00
Gunter Labes
627244b0fd
Fix schema to actually allow an empty value 2023-10-09 21:36:14 +02:00
newfrenchy83
b5805eca8f
Add priority and filter to overwrite specials (#7746)
using overwrite_specials alone means that we have only two possibilities, either one_side is chosen and in this case if the ability used as a weapon carrying the attribute is applied to the unit (apply_to=self), the other abilities are the same type applied also to 'self' not carrying the attribute will be overwritten, but those of the opponent with apply_to=opponent will be kept in the list; or else both_sides is chosen and all abilities of the same type that do not carry the attribute will be overwritten. To be able to use the attribute in abilities like [damage] for example, it is necessary to be able to be even more selective as for a 'charge' type leadership with multiply=2.5 but which must not be combined with the classic charge and without overwriting the aute [damage] as backstab, [overwrite_filter] to only match damage with apply_to=both and active_on=offense is then interesting.

adding priority allows you to select that it ability can use its overwrite_specials attribute while the others can be overwritten in the same way as an ability without the attribute. Finally, this system makes it unnecessary to limit the use of the attribute to abilities used as weapons but also to special weapons.
2023-10-08 10:09:31 -05:00
Hejnewar
6fae3945de
Kaleh and Nym AMLAs (#7900) 2023-10-01 22:40:32 +02:00
newfrenchy83
a17369597c
give to abilitie support of halo or overlay (#7856)
give abilities support of halo or overlay so that the unit benefits from a second halo or overlay when conditions are matched

One of the things that bothers me is the permanent character of the halos of the Mage of Light and other units with the "illuminates" ability, which forces them to program only a permanent illumination applied only to the possessor of the ability.

Adding the halo attribute to ability does not change anything about the behavior of the unit, but can be used in several cases:

1 allowing the use of ""illuminates" whose activity would be variable, in this case encoding the halo in [illuminates] ability and not in the unit_type allows to modulate the appearance of the halo under the same conditions

2. Applying illumination to adjacent units, I know it's pretty cheesy but a set developer might consider it easier if the hlo display follows the same logic.

3 The halo used to illustrate the possession in the unit of a special weapon used as leadership, the halo would be used to raise the possessor of the ability.

for overlay, same logic for illustrate possession of a special weapon used as leadership, or influence on student

with the "halo_image" attribute, it is now possible to give Sun Sylph units an illumination ability with an activity depending on the incarnate sun attack instead of giving the ability and the halo via obect and therefore allowing the player to have access to the description of the ability even when it is inactive.
2023-09-25 11:06:41 -05:00
Gunter Labes
8cd0410754
Add missing keys and tags in [micro_ai] 2023-08-29 15:15:59 +02:00
Jonathan-Kelly
14c7382675
Add range support for [micro_ai]side= (#7853) 2023-08-18 20:04:05 -04:00