Commit graph

107 commits

Author SHA1 Message Date
Dalas121
e7509c5dba
EI S14 "Drowned Plains" - rework scenario objective (#9411)
Change the EI S14 objective from "kill enemy leaders" to "gather gold". Reduce turn limit from 75 to 25.
2024-10-03 22:26:08 -05: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
Charles Dang
ccdc8b17f4 Fixup 3af690331a
Its not Lua.
2024-09-15 12:22:45 -04:00
Charles Dang
3af690331a Lua API: remove deprecated unit.side and terrain.owner 2024-09-15 01:43:11 -04:00
Wedge009
b316ee518b
Extend case-insensitive filtering beyond ASCII characters (#9332)
This updates filtering for:
* Game Load dialogue
* MP lobby
* In-game label and unit search
* Add-ons client (now used consistently)
2024-09-11 14:42:45 -04:00
pentarctagon
40ef4dbbf4 Revert "Bump min Boost version to 1.82 (#9317)"
This reverts commit 7c60174ad1.
2024-09-08 10:25:45 -05:00
Charles Dang
7c60174ad1
Bump min Boost version to 1.82 (#9317) 2024-09-08 00:58:32 -04:00
Dalas121
dc6b802d74
Changelog: log corpse/soulless arcane resist change.
Changelog entry for #9224
2024-09-01 18:40:07 -05: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
Iris Morelle
de2d2e2bd6
hotkey: Identify Alt as "opt" on macOS
Fixes #9172.
2024-08-05 13:58:04 -04:00
pentarctagon
6b7d8c5a8d changelog_entries 2024-07-21 22:30:40 -05:00
Dalas121
c6e8dc5bcd
EI: minor assorted unit stat and item tweaks (#9103)
* Eastern Invasion
     * fixed Gweddry having the wrong HP values
     * fixed the king being neutral instead of lawful
     * fixed "Dark Shape" being neutral instead of chaotic
     * the king can no longer wield the plague staff
     * the king and generals can no longer recall undead veterans
2024-07-19 20:30:07 -05:00
Dalas121
71dfdab2eb
EI: changelog entry for backported changes
(in the future I'll do these as part of the main PRs)
2024-07-19 20:29:28 -05:00
pentarctagon
888fbf13e5 changelog_entries 2024-07-08 17:42:20 -05:00
Steve Cotton
17c202d3fb GUI2/Game Load: Apply filter when changing directory
When the user types something into the filter box and then changes to
a different version, apply the filter immediately instead of showing
the full list of files.

The drop-down to switch between directories is hidden unless savegames
from other versions are detected. The button will appear at the
bottom-left in master, and at the top of the dialog in 1.18.
2024-07-02 16:02:26 +02:00
gfgtdf
88113a738d
Handle require_modification as the client expects
Since 05d1e4b9ba, the client interprets require_modification="" as
defaulting to "yes". However, wesnothd was still defaulting it to
"no", causing an error message when trying to join games.

Fixes #8805 "Add-on version check prevents joining game".
2024-06-27 10:25:23 +02:00
pentarctagon
5e62283646 changelog_entries 2024-06-17 10:24:27 -05:00
newfrenchy83
1809af8cdf
Modify 'apply_to' in an ability filter to do an inclusion check for resistance abilities
Instead of needing to contain the exact string from the ability, 'apply_to' in the filter is now taken as a comma-separated list, where all elements need to be present in the ability.
For example if we filter for apply_to=fire,arcane given an ability [resistance]apply_to=arcane, fire, cold, it will match.
For an ability [resistance]apply_to=arcane, impact, cold, this will not match because 'fire' is missing.
2024-06-07 18:08:43 +02:00
pentarctagon
b3247d3dfc changelog_entries 2024-05-26 15:06:55 -05:00
Jonathan-Kelly
e47a012623 Mudcrawlers better in swamp, worse in buildings
Resolves #8823
2024-05-26 12:17:25 -05:00
newfrenchy83
9fc5887ae9 'value' attribute in [experimental_filter_ability(_active)] can have 'default' value 2024-05-26 13:48:45 +02:00
Subhraman Sarkar
bd36e29ffa
add changelog entries (#8922) 2024-05-26 11:29:37 +05:30
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
pentarctagon
39987cd1ca Add a Community button to the title screen.
This opens a dialog with links to the forums, discord, etc, plus a donate button that links to Wesnoth's SPI page.
2024-04-15 16:50:42 -05:00
Pentarctagon
9548f4c7b5
Hardware unit submerge effect using SDL_RenderGeometry. (#8687)
Original code from mesilliac in #6826. Made a separate PR for this since the relevant code moved to an entirely separate file and trying to "properly" fix the merge conflicts resulting from that isn't worth the time.
2024-04-11 12:58:56 -05:00
Pentarctagon
901e91c8ec
Move Dunefolk to the Default era. (#8688) 2024-04-11 10:43:41 -05:00
Steve Cotton
da0ee60864 Fix race condition causing moveto messages to immediately close
If a mouse click causes a delay and then a message to appear, for example
when moving a unit triggers an `[event]name=moveto`, then the message
would sometimes flash on screen and then disappear with barely enough time
to see which character's portrait was used, let alone to read it.

Although there's already logic to not be triggered by the same mouseclick that
caused the unit to move, it had a race condition if the MOUSE_UP happened
around the time the the dialog's pre_show() function was running.

(cherry picked from commit 26ead85914)
2024-04-09 19:29:52 +02:00
Iris Morelle
57b35dd6bd Update changelog 2024-04-02 09:51:46 -03:00
Iris Morelle
97fc0e9e5d Update changelog 2024-03-31 02:44:04 -03:00
Subhraman Sarkar
62ac421cf4 MP: Aethermaw: Update images with their 1.18 variants
(cherry picked from commit 2b9ed47080)
2024-03-25 21:02:48 +01:00
Steve Cotton
3d71a2e4d8 Automatically replace missing .jpg images with .webp if found
Give .jpg files the same logic that .png files were given in
8f06da1974, because many files
were renamed in 51b58ad218.
UMC using the old name for images will trigger a warning, but
the player will still see the image file.

This is just a cosmetic change that doesn't change compatibility,
because have_asset("images", "blah.jpg") won't be automatically
redirected to "blah.webp".

(cherry picked from commit 84ed5488e0)
2024-03-25 21:02:18 +01:00
Subhraman Sarkar
333b3edc42 change horizontal scrollbar mode and update changelog 2024-03-22 09:45:42 -04:00
Subhraman Sarkar
d692f6ba12 add changelog and remove achievements dialog changes 2024-03-22 09:45:42 -04:00
Iris Morelle
e7050c185b Update changelog 2024-03-16 00:13:16 -03:00
Steve Cotton
4b44515673 Changelog for SotA S16: Keep Crelanu within his ring
Changelog for d106238410,
the changelog is already included in 1.18's cherry-pick.
2024-03-13 21:07:37 +01:00
Iris Morelle
f8c4bf2130 gui/outro: New clock-based timing logic for the text fading
This version uses SDL_GetTicks() as a monotonic source to avoid the
previous version's pitfalls, namely the fact that the game's framerate
may not necessarily be a constant, and in particular, the old code
assumed a completely different framerate than what we ended up with
after the texture-based rendering changes in 1.17.x, resulting in an
almost-unnoticeable text fade due to the update() function being
called WAY more often than before.

Note that the reliance on SDL_GetTicks() means the timings break
at some point after 49 days of game runtime, exactly once. This
should result in a visible "jitter" effect if the 32-bits ticks value
wraps around in the middle of a fade sequence, but other than that
it's not that big of a deal to warrant requiring SDL 2.0.18+ for the
64-bit version.

(cherry picked from commit db30ca53ae)
2024-03-05 10:56:50 +01:00
Iris Morelle
17bd58dd79 gui/addon_manager: Show server identification after the address
This enables the client to show the [server_id] info (for 1.16+
campaignd instances that provide the relevant fields) in the UI so
the user can more easily know which instance they are connected to
in case they do not handle that information directly themselves (e.g.
when entering a port number of their own).

The server info shown in the bottom left is changed from "<encryption
status> <server address>" to add "— <server id> (<server version>)"
right after it, with the server version in parentheses being included
only if debug mode is enabled to avoid redundancy or confusing values
(such as "wesnoth.org — 1.18 (1.17.19+dev)").
2024-03-01 22:33:31 -05:00
Steve Cotton
e0df67656a Update changelog, merge changelog_entries
This is mainly from looking through the Git changelogs
for missing entries.
2024-02-19 12:17:12 +01:00
Steve Cotton
ec1c336078 wmlxgettext: treat gender as a po hint
This will automatically record the gender (if specified) of each
[unit], [unit_type] and [side].

The hint "gender=male,female" is often applied to [unit_type]name=,
although that's usually the male name. I believe that's the only
downside of this change.
2024-02-12 23:42:59 +01:00
P. J. McDermott
69fa5c199e Add CMake and SCons options to use system Lua 5.4 C++
scons/lua.py makes use of the vestigial luadir option from commit
e94dcecf17.

Like FindLua.cmake, scons/lua.py searches for the Lua headers and
library, instead of using pkg-config like the old scons/lua.py (removed
in commit 9929d3ca1c) did, because even though distributions typically
provide .pc files for Lua, upstream Lua doesn't.  It's likely that all
distributions that compile Lua as a C++ library will also provide .pc
files, but this check doesn't rely on that (just as the CMake module
doesn't).

Unfortunately, SCons.Conftest.CheckLib() prints up to eight messages
like "Checking for C++ library lua54-c++... no" until a working library
name is found.

Also conditionally include system Lua headers in src/lua/*.h and update
documentation in src/modules/lua_README.md, src/wesnoth_lua_config.h,
and src/wesnoth_lua_config.md.  The two lines about "The primary commit,
after replacing the sources," in src/wesnoth_lua_config.md don't make
sense since the instructions were updated for submodule Lua in commit
d32cfb88c4 and make even less sense now with preceding commits for
updating CMake modules.
2024-02-11 23:21:15 -06:00
P. J. McDermott
78d3b0c05c Store jailbreak exceptions in constructors, not in LUAI_TRY()
LUAI_TRY() is an internal part of Lua that may not exist forever, and
reliance on overriding it prevents the use of system copies of Lua.

Document in lua_jailbreak_exception this requirement to call
this->store() in derived class constructors.

Also, count the luaW_pcall_internal() recursion depth and store and
rethrow jailbreak exceptions until the recursion depth reaches 0,
because:

 1. luaW_pcall_internal() sometimes runs recursively (C++ calls Lua
    calls C++ calls Lua calls C++), so the middle C++ layer needs to
    rethrow exceptions instead of clearing them.  LUAI_TRY() previously
    stored them each time, but now lua_jailbreak_exception::rethrow()
    needs to know when not to clear().

 2. Jailbreak exceptions can be thrown while no Lua code is running.
    Now that constructors store() all exceptions instead of LUAI_TRY()
    storing only those caught by Lua, lua_jailbreak_exception::store()
    needs to know when not to store them.  Otherwise, for example,
    leaving a game to return to the menu while no Lua code is running
    throws and needlessly stores an exception that isn't cleared, with
    two possible effects:

     a. If another jailbreak exception is thrown and the constructor
        tries to store it, we abort from assert() because one is already
        stored.

     b. Otherwise, if luaW_pcall_internal() runs without a new jailbreak
        exception being thrown, the stored one is rethrown and handled a
        second time (e.g. immediately leaving a new game).
2024-02-11 23:21:15 -06:00
P. J. McDermott
5a0a3d0d72 Log all Lua errors
Wesnoth's Lua submodule is built with LUAI_TRY() defined to catch a
std::exception, push its what() string onto the Lua stack, and call the
error handler given via lua_pcall() (which push_error_handler() and
luaW_pcall_internal() set to Lua's debug.traceback()) or in Lua via
xpcall().

If lua_pcall() returns an error code, luaW_pcall() logs an error, but
only if it finds an exception string on the stack (due to an apparent
oversight in commit 3820b14eb8, version 1.9.5) and that exception
string doesn't contain "~lua:" (oversight in commit e5562a1b52,
version 1.9.0).  But stock LUAI_TRY() doesn't push an exception string
onto the stack, so luaW_pcall() won't log the error.

Either way, luaW_pcall() always returns false when lua_pcall() returns
an error, so the calling C++ code works the same with either Wesnoth
or stock LUAI_TRY().  The only consequence is that strict mode doesn't
break, because the error isn't logged.

This will cause the filter_formula_unit_error test to return a result
of "PASS TEST (0)" instead of "BROKE STRICT (PASS) (9)" with stock
LUAI_TRY().  In other words, the test passes normally either way, but
strict mode doesn't break.

Fix this by making luaW_pcall() log all errors, including those without
exception strings on the stack, as well as those with exception strings
containing "~lua:".
2024-02-11 23:21:15 -06:00
P. J. McDermott
83ad348037 Wrap Lua pcall() and xpcall() to rethrow jailbreak exceptions
Jailbreak exceptions thrown in Wesnoth C++ code called under Lua pcall()
or xpcall() aren't handled immediately, allowing such exceptions to
potentially accumulate and cause a failed assertion.

For example, if a user tries to quit while Lua code is running under
pcall() or xpcall(), LUAI_TRY() stores and consumes the jailbreak
exception and the rest of the Lua code continues running.  If the user
tries to quit again before the Lua code finishes, LUAI_TRY() attempts to
store another jailbreak exception, which causes wesnoth to abort.

This is a longstanding bug (since jailbreak exceptions were introduced
in commit d6512a0ef5, version 1.9.5) that could affect World Conquest
and 16 of the 588 addons in 1.16 and 7 of the 141 in 1.17.

Fix this by wrapping pcall() and xpcall() to rethrow jailbreak
exceptions.
2024-02-11 23:21:15 -06:00
Tahsin Jahin Khalid
e506c2a1ff
[Units] Raven unit tree stats update patch
* units/ war harbinger: +3 HP, +2g cost, -50 XP

* units/war harbinger: removed village and forest def

* units/Dark Omen: removed village and forest def

* Units/Raven: removed village and forest def

* add changelog entry file
2024-02-01 01:29:24 +06:00
pentarctagon
118f780f60 changelog_entries 2024-01-20 19:56:52 -06:00
Subhraman Sarkar
18086e78ae
Hotkeys (#8249)
Shortcut keys for map editor
2024-01-20 19:32:31 -06:00
Steve Cotton
91bd96b319 Revert "systemd: drop _ prefix from username"
Prefixing all system and group names with the underscore is
recommended by the systemd developers.

This reverts commit d6d2a4f996.
2024-01-21 01:34:18 +01:00
Steve Cotton
286f14657b Handling of RTL in the left pane of the help browser
Fixes the display of topic headings, including unit names, in right to left
languages (Arabic and Hebrew).

The GUI1 menu code is only kept to support one UI feature, the help browser.
However, the code supported multiple columns and multiple things in each
column; to do the latter it handled each column as a string with embedded
separators. To support the help GUI, all that's needed is for each row to have
an indent, an icon, and a text field. Traces of the multiple-column support are
still in the code, but the drawing code is simplified.

The logic for working out whether mouse clicks are on the icon or the text has
moved from the subclass to the main menu class, as it's a subset of the logic
for drawing the UI.

In LTR languages, this looks almost identical.

In RTL languages, the book icons now appear in the right place, and the text
placement is reasonable.
2024-01-20 14:28:16 +01:00
Steve Cotton
6ffc6051a6 WoF S12: Leave the epilogue much more open-ended
The replaced first line added facts into canon that didn't need to be there.
Also, that text felt too similar to some real-world racism, which is why I'm
pushing this change during the string freeze.

In discussion during review, the last two lines felt more like the start of
another story than part of WoF itself.
2024-01-19 11:41:09 +01:00