78952 Commits

Author SHA1 Message Date
Iris Morelle
98b4c9c73d pot and documentation update 2021-05-15 22:07:59 -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
Celtic Minstrel
bf318a6e23
math.random wasn't even supposed to be deprecated at all 2021-05-15 17:31:12 -04:00
Celtic Minstrel
cc42e00e4b Fix a deprecation typo 2021-05-15 13:32:40 -04: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
Iris Morelle
dd23418d7f Update changelog
[ci skip]
2021-05-15 06:15:42 -04:00
Iris Morelle
55f61fcdac lua/gui2: Restore layout invalidation hack when setting widget labels
Fixes #5755.

This is one of several layout invalidation hacks used in the old Lua
GUI2 API lost in the implementation of the new API (which the old API
now wraps).

It turns out that in the previous API (see 1.14 for reference if you
need easy access to the source) there were several calls to
invalidate_layout() that weren't there just to look pretty.

For wesnoth.set_dialog_value:

 * One prior to setting the value of a text_box
 * One prior to setting the value of a unit_preview_pane
 * One prior to setting the value of a styled_widget
 * One after changing a widget's visibility to hidden

All of these were removed by the new API implementation, with the last
one ending up commented out, restored now in commit
8989eb430311092e66177bc09e1b1c344000d5aa. All the other ones are
entirely gone, however.

It turns out that the dialog layout invalidation done for the
styled_widget case was essential to get listboxes working correctly
after clearing and adding rows to them (which was automatically done
right before in the implementation of wesnoth.set_dialog_value by the
find_widget() helper function). It was done for every single listbox
item, but without it the listbox would become completely useless under
certain conditions:

  20210501 03:24:37 error gui/layout: grid [_content_grid] place: Failed to place a grid, we have 39,30 space but we need 39,93 space. This happened at a grid with the id '_content_grid' in a 'N4gui27listboxE' with the id 'list' in a 'N4gui24gridE' with the id '_window_content_grid' in a 'N4gui24gridE' with the id '_content_grid' in a 'N4gui215scrollbar_panelE' with the id '' in a 'N4gui24gridE' with the id '' in a 'N4gui26windowE' with the id ''.

Now, it seems horribly inefficient to do this for every single new row
added to the listbox, but this solution *works*.

As for the text_box and unit_preview_pane cases, their presence or
absence doesn't seem to affect anything in my testing with a live
dialog, so I'm not adding them back until someone runs into a bug with
them.
2021-05-15 06:15:42 -04:00
Iris Morelle
8989eb4303 lua/gui2: Restore layout invalidation hack used when hiding widgets
Someone clearly didn't do sufficient testing here. Fixes a regression
from 1.15.5 causing widgets to remain visible after being set to a
hidden state.
2021-05-14 06:45:34 -04:00
Steve Cotton
b6225e354d Make callers of help::show_help not need a help_manager
Most of the places that created a help_manager did so just to call show_help on
the next line. Move knowledge of the internals out of those callers and into
help.cpp.

This leaves editor_controller and play_controller with knowledge of help_manager,
however both of those classes handle ownership of the game_config too.
2021-05-14 11:38:35 +02:00
Pentarctagon
edfa4ac345 Update how the icu libraries are linked. 2021-05-13 19:48:36 -05:00
Celtic Minstrel
41f2263c09 Lua: Fix _G[""] being a reference to _G
This is harmless but silly, so let's not do it.
2021-05-13 19:37:17 -04:00
Steve Cotton
7334cc97c9 Credits: move myself to Programming, add Sean Yeh, update Astrid
* Move myself to the programming section
* Add Sean Yeh to the misc section
* Finish 287ec15c101b's update of Astrid's credits

[ci skip]
2021-05-14 01:35:48 +02:00
Celtic Minstrel
eab8645e90 Fix incorrect deprecation wrapper for wesnoth.color_adjust
The source function wasn't public API, but it can't hurt to make it work.
2021-05-13 19:22:31 -04:00
Pentarctagon
b5ab344bc3
Remove in-repo FindCrypto.cmake.
As of cmake 3.4, cmake has built-in support and the minimum is now 3.5.
2021-05-13 14:19:54 -05:00
Steve Cotton
c560b0efab Add attribute apply_to_vision to [effect]apply_to=movement
When processing [effect]apply_to=movement, if apply_to_vision is 'yes'
(which is the default) then the vision points will change by the same amount.
Previously, it sometimes affected vision and sometimes didn't; for most cases
where it makes a difference, I expect it to be a change from unanticipated
behavior to expected behavior.

Please refer to the new unit test added in this commit for more detailed docs;
that test is also a rough draft for the Wiki update needed when this merges.

The reason it sometimes affected vision was that the special value of -1 vision
points was interpreted as "use the value of the max movement points instead".
The special value of -1 is still supported and frequently used, and refactor that
is out of scope for this commit - it's easy to check when the code path changed
in this commit is used, however it's considerably more complex to find all
routes that create a unit with vision set to -1.

I'm expecting one add-on, Rebirth In Nature, to need a large update for this;
as well as a trivial change needed to the Add Creature Pack.

There are several mods that have their own handling for vision, recalculate the
values frequently, and are expected to continue working as before, as they'll
just overwrite any changes that the engine makes.
* Proper Flying Mod / Proper Vision Mod
* LotI
* Blessed Altar Mod
* Shards Era's `CALCULATE_WEAPONS_ONLY` macro
* Castle of Evil Spirit

Rebirth In Nature is an RPG-style campaign that expects the player's unit to
have vision separated from movement along with right-click menus that change
the character's movement, this will probably need `apply_to_vision=no` in
many places. OTOH, its `item_id=mobility` uses `apply_to=movement` followed by
`apply_to=vision` to implement in 1.14 what this change will make default
behavior in 1.16.

There are a few sharpshooter units which have vision better than their
movement. If given a buff which boosts their movement, this will give
them a buff to vision too; likely a change towards expected behavior.
* Archaic Era's Royal Ranger
* Ageless Era's Royal Ranger and Dwarvish Forest Sniper
* Eastern Europe at War's Yacht and Great Yacht
* Era of More Units's Lone Wolf
* Southernerns has several sharpshooters
* WWII Era has several sharpshooters
* War of Dominions has some guard towers with very low movement

Silver Age has abilities that modify vision based on time-of-day, but unlike
the Proper Flying Mod and LotI these are done by adding and removing objects
that add or subtract one vision point, these should be unaffected by this
change. Unrelated to that, it declares values for `[unit_type]vision=` even
when the value is the same as max moves - like the sharpshooters this means
that buffs to their movement wouldn't have buffed their vision but now do.

There are few units with vision less than movement. Generally these seem to be
missile weapons that are represented as units, and they probably won't meet any
apply_to=movement statements - even if a movement power-up is available, the
player would probably choose a different unit.

The Add Creature Pack has two creatures (the Cactose Elder and Carnivore Fatal
Plant) that have reduced vision, along with AMLAs that increase those units'
movement; these AMLAs will need to use `apply_to_vision=no`. These two
creatures are used in Castle of Evil Spirit, but they won't get enough
experience to get an AMLA there.

Fixes #3356.
2021-05-13 18:02:36 +02:00
Sean Yeh
7eedae4ee8 Only show notifications for visible mp games
Previously, users would get desktop notifications for all mp games
created, ignoring game filters
2021-05-13 16:06:41 +02:00
Steve Cotton
b7f5a2c52d Add missing terminator in the Lua filesystem module 2021-05-13 14:39:42 +02:00
Pentarctagon
4030e572ea
Fix autorevision target not working on win32 or when disabled. 2021-05-12 23:44:14 -05:00
Iris Morelle
6794f231e5 config: Don't create differently-typed copies of input in loops
This is prompted by 1f8101ef22bb23699421505235f4962802773c77. This
approach should still be correct while hopefully not bothering any
compilers *and* avoiding unnecessary copies or conversions until the
input actually needs to be converted to a different type (in this case
std::string_view, which is cheaper than std::string).
2021-05-12 20:15:45 -04:00
Pentarctagon
24a5ea9a8a
Remove unused systemd check from cmake. 2021-05-12 18:40:14 -05:00
Iris Morelle
b8fbdbbde6 Update Czech translation credits 2021-05-12 18:16:12 -04:00
Pentarctagon
7608cdbaa4 Better handle unexpected return codes. 2021-05-12 13:54:12 -05:00
newfrenchy83
612e6c5f84 update codeblock projectfiles 2021-05-12 13:23:35 -05:00
Steve Cotton
6a1d7cf385 Credits: hide the blank section for Friulian
When an [about] section has a title but no [entry] tags, it's automatically
hidden in the credits. The entry with name="" was causing the title to show
up with a blank section under it.

[ci skip]
2021-05-12 16:28:04 +02:00
Steve Cotton
e7e3ae76d8 Refactor the woptipng script
If a tool made the image bigger, the debug message was the same as if the tool
had made the image's pixel change. Clarify that into two separate messages.

As each verify_images() call checks that the file became smaller, the removed
print statement would never be reached.
2021-05-12 16:04:32 +02:00
Steve Cotton
1bc7378c0d Run woptipng on the new horses
57 of 57 files optimized, 678061 bytes reduced to 586300 bytes; -91761 bytes, -13.53%
This was running with the -t0 option, so that it considers any reduction good, even
if it's less than 10% on the big portrait images.
2021-05-12 15:33:20 +02:00
loonycyborg
1f8101ef22
Fix -Wrange-loop-construct from gcc11 2021-05-12 13:39:47 +03:00
Pentarctagon
3e8d81f473
Temporarily enable verbose WML unit test output. 2021-05-11 19:31:22 -05:00
Celtic Minstrel
5b27f81e59 Define WESNOTH_VERSION during schema validation 2021-05-11 19:37:45 -04:00
Celtic Minstrel
e2181215fe Update changelog 2021-05-11 19:23:48 -04:00
Celtic Minstrel
6584302d41
Merge pull request #5537 from wesnoth/lua_reorg
Various Lua reorganization work
2021-05-11 19:12:40 -04:00
Celtic Minstrel
0970880910 whitespace fixes 2021-05-11 14:52:22 -04:00
Celtic Minstrel
574bc1a36e Resolve [terrain_mask]mask_file= relative to the [binary_path] like map_file= is 2021-05-11 14:52:22 -04:00
Celtic Minstrel
ccb9f4f0e9 Update mainline uses of have_file and read_file 2021-05-11 14:52:21 -04:00
Celtic Minstrel
45cb8dc428 Add a filesystem module
This currently contains have_file, read_file, canonical_path, get_image_size, and new functions that work with binary_path files.
2021-05-11 14:52:21 -04:00
Celtic Minstrel
bf746a0207 Update mainline content to use the wesnoth.scenario module 2021-05-11 14:52:21 -04:00
Celtic Minstrel
97a96cbbd1 Add a new scenario module and move some functions there and to game_config
Addresses #4907
2021-05-11 14:52:21 -04:00
Celtic Minstrel
1410b5cef9 Allow accessing variables through the new APIs in the mapgen kernel
This also reverses the deprecation of wml.tovconfig and friends in the mapgen kernel.
2021-05-11 14:52:20 -04:00
Celtic Minstrel
05b0b7a1df Update uses of wesnoth.fire 2021-05-11 14:52:20 -04:00
Celtic Minstrel
e8381ea9da Update uses of eval_conditional 2021-05-11 14:52:20 -04:00
Celtic Minstrel
2ea92baa13 Move some more functions to the wml module
- eval_conditional and fire
- the internal set|get_variable functions
2021-05-11 14:52:20 -04:00
Celtic Minstrel
603ecdfb99 Move the deprecation for wesnoth.modify_ai to Lua so that it honours --strict-lua 2021-05-11 14:52:19 -04:00
Celtic Minstrel
9bf189a615 Move wesnoth.create_side -> wesnoth.sides.create 2021-05-11 14:52:19 -04:00
Celtic Minstrel
1205e3fd25 Move the Lua global variable helpers from WC to a new "experimental" module 2021-05-11 14:52:19 -04:00
Celtic Minstrel
f4d528f616 Make it easier to deprecate Lua attributes in C++ __index metafunctions 2021-05-11 14:52:19 -04:00
Celtic Minstrel
e7ec2fbca2 Deprecate wesnoth.game_config.version
There's no point having the same info in two places
2021-05-11 14:52:19 -04:00
Celtic Minstrel
c88e60b98e Now color_adjust takes three arguments instead of a config
Consider it part of the public API now.
2021-05-11 14:52:19 -04:00
Celtic Minstrel
ea5367de17 Move create_animator and create_weapon into the units module 2021-05-11 14:52:18 -04:00
Celtic Minstrel
7b2ceb863c Move open_help to the gui module (as show_help)
This also exposes it in kernels besides the game kernel.
2021-05-11 14:52:18 -04:00