84706 Commits

Author SHA1 Message Date
Dalas121
c7d3db402e
TDG S00, fix side 1 having no save_id
a1dd77a fixed Delfador's unset disable_stronger_amlas variable, but inadvertently broken the campaign due to an unset save_id for side 1. By placing Delfador inside [leader] instead, we resolve both issues.
2025-01-25 16:27:12 -06:00
Toom
aa379157c9 Fix parameter name re #9799 2025-01-25 21:52:51 +01:00
Dalas121
a1dd77ad77
TDG S00, fix AMLAs applying to Delfador 2025-01-25 10:35:46 -06:00
JJ Marr
38b3a3b7ba Remove config::append_children(config&& cfg)
Move semantics imply that an r-value parameter is no longer useful once
it is passed into a function. However, this function is used as a helper
function that only partially moves from cfg, so that the rest of cfg
can be reused by the caller.

I don't believe this is a good mechanism for a function call. This
overload is only used in one place: append(config&& cfg), so this commit
moves the relevant logic there. This ensures there's no re-use of a
moved-from object.

Splitting this out separately since it's a special case and API change.
2025-01-25 08:58:45 -05:00
JJ Marr
7ddd4ff02e Allow partial moving
The official C++ core guidelines policy is you must move rvalues.

This is inflexible in practice in the Wesnoth codebase.
2025-01-25 08:58:45 -05:00
JJ Marr
0b46bd3044 Enable performance-no-automatic-move
Variables can be automatically moved when a function returns. However,
declaring a variable as const prevents that move from occuring (as the
move modifies the moved-from variable).
2025-01-25 08:58:45 -05:00
JJ Marr
15acd0c00a Lint for performance-move-constructor-init
This checks when a move constructor for an object copy constructs its
member classes or parent classes. Copying unnecessary as all of the
members of the moved-from object can be clobbered by the move.
2025-01-25 08:58:45 -05:00
JJ Marr
259160e1e4 Lint for performance-move-const-arg
These are cases in which something is std::moved and no move actually
occurs.
2025-01-25 08:58:45 -05:00
JJ Marr
c34d689726 Warn against not moving rvalue parameter
If a function takes in an rvalue, it's taking ownership of the object
that's being moved into it. If the object never moves that rvalue param,
then there was no point to moving it into the function.

As an example of a problem this catches, in context_manager.cpp,
replace_map_context_with took in an rvalue unique_ptr "mc" to a map
context. The function then swapped it with a given value in
map_contexts_. This swap was unnecessary because "mc" expired after the
function call was complete. It is more optimal to std::move(mc) into
the value in map_context_ that we were previously swapping with.
2025-01-25 08:58:45 -05:00
JJ Marr
fc1ac27b48 Enable bugprone-move-forwarding reference
A forwarding reference is one of the form (note the template parameter):

    template<class X>
    void foo( X&& x );

The difference between this and a regular rvalue reference (where X is
not a template) is that foo() also accept lvalues. So it is possible to
call:

    std::string s = "Example";
    foo(s)

And if the body of foo(X&& x) std::moves x, then s will be invalidated.

This check warns on usage of std::move in this context and recommends
std::forward, which automatically determines whether to std::move
depending on whether foo() is called with an rvalue or an lvalue.
2025-01-25 08:58:45 -05:00
JJ Marr
af82672ca9 Add bugprone-use-after-move
It's generally bad practice to use something after it's been std::moved
from.
2025-01-25 08:58:45 -05:00
Dalas121
121196eb70
TSG: Improve Translatability (#9797)
Some po hints and string changes to make TSG more translatable, as requested by @celerini in #9682.
2025-01-25 07:24:06 -06:00
Nils Kneuper
842b91661c updated British English translation 2025-01-24 23:56:37 +01:00
Toom
870951248f
Expose [fire_event][data] values to WML variable $data 2025-01-24 21:57:06 +01:00
Steve Cotton
84a05d2269 For translation stats, TSG is now the tutorial
For working out which languages have 80% of core translated, TSG is
now relevant and the old tutorial isn't. This means that the 80%
threshold has increased by around 500 strings.

Add missing changelog entries for 1.19.8 directly to the changelog.
2025-01-24 16:43:08 +01:00
Thewodoros
6ff26aad31 Make frostbite affect wild ogres when sighted
This way it's less obvious that they were not affected before being
sighted.
2025-01-23 19:01:05 -06:00
Thewodoros
24df7aaa8e Simplify ogres sighted events
This also creates a variable which we'll use for the frostbite event.
2025-01-23 19:01:05 -06:00
Gothyoba
29c8e730d0 TDG: Capitalize Silverback in Unit Description
https://wiki.wesnoth.org/Typography_Style_Guide

According to the Typography Style Guide, races shouldn’t be capitalized but unit types should be. Silverbacks aren’t a species, and in this case I think this refer to the Unit Type.
2025-01-24 06:59:48 +11:00
Subhraman Sarkar
1538694ee6 changelog: add new on_link_click handler. 2025-01-23 17:10:09 +05:30
Subhraman Sarkar
5c97754115 lua: expose rich_label link handling mechanism
Adds `on_link_click` setter. The function set to this will be called with the target of the clicked link.
2025-01-23 09:14:54 +05:30
Gothyoba
ebf04808d3 Update coordinates for Movrur in THoT S1
Was supposed to have been changed with the map revision, but was not saved properly.
2025-01-23 08:03:55 +11:00
pentarctagon
68ed0aeea7 update for campaigns change 2025-01-22 11:22:10 -06:00
Wedge009
6a3643926e TDG: Minor corrections/revisions.
[ci skip]
2025-01-22 22:14:36 +11:00
Subhraman Sarkar
8ec8b5e0cb help: readd HttT
And rewrite the section to be more user-friendly in that process.
2025-01-22 14:20:14 +05:30
Charles Dang
8ee2a26634 Fix width weirdness with add_overlay_text
Closes #9633
Fixes #9591

This could also have been fixed by simply adjust the clip rect origin on left alignment (such an adjustment was present for the other alignments), but honestly there's no reason to be messing with the clip rect here when we can set the width directly. The floating_label internals would set the maximum text width to clip rect if no max with was otherwise specified.
2025-01-22 03:15:33 -05:00
pentarctagon
e8da69fe63 Fix schema validation error
excluding via ifndef instead of adding a translation mark because it makes no sense for that line to be translated
2025-01-21 23:34:26 -06:00
Dalas121
7048f68303
TDG: fix minor string issue 2025-01-21 20:00:54 -06:00
Dalas121
de0dd25a52
TDG: fix minor string issue 2025-01-21 20:00:37 -06:00
Dalas121
74da2a1724
TDG: add to schema, and fix schema issues (#9786)
While adding TDG to mainline, I missed adding it to the schema. As a result, a lot of issues went unnoticed.

This PR adds TDG to the schema, and fixes the various discovered errors. This PR also updates the schema to reflect the engine supporting multiple [filter] tags in events, and to reflect the engine supporting [change_theme] without keys.
2025-01-21 19:50:18 -06:00
Dalas121
78b86777b5
Move files from data/resources to data/internal (#9787)
"resources" naming isn't correct - most of these files aren't resources.

Instead, we move the actual resources to data/internal/resources, and the other files to data/internal.
2025-01-21 19:50:00 -06:00
Wedge009
d26f2d45a3
TSG: Various small corrections and revisions (#9771)
* TSG: Various small corrections and revisions.

[ci skip]

* add "without save-loading" to sg_help

---------

Co-authored-by: Dalas121 <33790750+Dalas121@users.noreply.github.com>
2025-01-22 08:52:45 +11:00
Gothyoba
85f0148805 THoT S1 Map: Aesthetic Revision 2025-01-21 12:42:03 -06:00
Dalas121
ef666dbcf4
TDG: fix unavailable right-click spellcasting menu 2025-01-21 10:23:41 -06:00
Dalas121
74ae75186c
Changelog: create add-tdg-remove-dm.md
Changelog entry for "The Deceiver's Gambit" and "Delfador's Memoirs"
2025-01-21 09:15:55 -06:00
Wedge009
d7ffa12bc3 Encyclopaedia: corrections following #9253.
[ci skip]
2025-01-21 08:00:59 -06:00
Wedge009
c73444a12f EI Final Battle: Em-dashes instead of minus sign.
[ci skip]
2025-01-21 08:00:12 -06:00
Steve Cotton
2a82041812 Labeler: recognise the files of the TDG campaign 2025-01-21 12:05:07 +01:00
Steve Cotton
307b2cff95 Add the PO files for wesnoth-tdg
Many of the CI builds expect the .po files to already exist, and
fail without them.

For SCons builds, the .pot file needs to exist, because po/SConscript
uses the existing files to find out which textdomains it needs to
update.

It was already added for CMake, but keeping the list in alphabetical
order makes maintenance easier.
2025-01-21 12:04:25 +01:00
Charles Dang
3f746900fe
Refactor unit bar drawing (#9763)
This fixes an issue where the bar borders would always be one pixel wide, regardless of the zoom level or game render scaling which made the bars stand out badly amongst the pixel art. This brings us closer to the old look from the surface-drawn days.

This is also an experiment with using normalized, fractional coordinates for rendering instead of absolute screen coordinates. I'd like to take this approach in more places, so this is a good proof of concept.
2025-01-21 01:04:50 -05:00
Gothyoba
10d8c54c7c Keep gameplay help page up to date with new tutorial
Replaces mentions of the old tutorial with TSG in the help page and changes the recommended begginer campaigns to TDG or AToTB. There’s also some slight wording changes.
2025-01-21 13:02:54 +11:00
Dalas121
8133cd56d9
The Deceiver's Gambit: add TDG to mainline, replacing DM (#9726)
Around two years ago Yumi asked me to create TDG as a replacement for Delfador's Memoirs, and gave me a rough script - the campaign covers Delfador's youth and Eldred's betrayal of Garard. Its gameplay includes a spellcasting mechanic for Delfador.
2025-01-20 11:22:46 -06:00
Thewodoros
a08d8f458a Make nested frostbite event "side 1 refresh"
That way it's clearer that it's not created for all sides.
2025-01-19 13:31:13 -06:00
Thewodoros
0070e81438 Make the main frostbite event "turn end"
That way it doesn't depend on the number of sides.
2025-01-19 13:31:13 -06:00
Thewodoros
729034988b Improve frostbite explanation event
Make the speaker either Gweddry or Owaec, whoever doesn't have the
elixir effect.
2025-01-19 13:31:13 -06:00
Gunter Labes
b784157f68
Fix query parameter handling 2025-01-19 19:22:43 +01:00
pentarctagon
29d949ba4b 1.19.8+dev 2025-01-19 11:55:40 -06:00
pentarctagon
11523799e8 1.19.8 1.19.8 2025-01-19 11:53:14 -06:00
pentarctagon
1c34429027 pot-update and regenerate doc files 2025-01-19 11:51:22 -06:00
pentarctagon
a59074b498 changelog_entries 2025-01-19 11:46:48 -06:00
pentarctagon
8920489f54 Revert "remove unused handler"
I'm not sure how it's possibly useful, but apparently this can be sent by the python client

This reverts commit fdc8d92fe6c38c995e0ef02c7fd219841da41ad8.
2025-01-19 09:48:05 -06:00