Compare commits

..

476 commits
master ... 1.18

Author SHA1 Message Date
Nils Kneuper
e44e5a0128 updated Hungarian translation 2024-12-22 00:34:48 +01:00
Nils Kneuper
f26b8890f0 updated Bengali translation 2024-12-22 00:33:26 +01:00
pentarctagon
f1e54eec76 add preference to not get addon icons 2024-12-19 22:36:11 -06:00
Bernhard Rosenkränzer
37ee134d7a Fix build with boost >= 1.87.0
Boost 1.87.0 removes some functions that have been deprecated for a few releases, but are still used in wesnoth.

(This is the same as #9652, but backported to the 1.18 branch)
2024-12-15 18:27:50 +11:00
Nils Kneuper
6cc6a72d18 updated Italian translation 2024-12-14 00:36:54 +01:00
Nils Kneuper
38adf70e7d update Czech translation 2024-12-14 00:35:38 +01:00
Nils Kneuper
abed35b79b updated Hungarian translation 2024-12-13 13:12:29 +01:00
gfgtdf
78c2f2e954 DM: S20: Fix waittime at scenario start
Don't animate unit advancements during a prestart event.

It woudl be better it u:advance() would automaticialyl not waste time animating advancements that can't be seen (during prestart events) but for this scenario this is already an improvement

(cherry picked from commit e549b03412)
2024-12-12 10:53:22 +11:00
Pentarctagon
e8271cd138
Avoid keeping player_iterator that might get invalidated before use 2024-12-10 14:41:25 +01:00
pentarctagon
da713c4bf5 take that out as well 2024-12-09 18:57:12 -06:00
pentarctagon
392e04a9eb macos-12 is no longer supported 2024-12-09 17:16:05 -06:00
Martin Hrubý (hrubymar10)
71b4ada5c4
Use new MCS for Xcode project 2024-12-07 18:04:36 +01:00
Nils Kneuper
2ce5f658e7 updated Hungarian translation 2024-12-07 17:58:12 +01:00
Nils Kneuper
5f232bf604 updated Chinese (Simplified) translation 2024-12-07 17:57:02 +01:00
Nils Kneuper
e8ebd6ceff updated Hungarian translation 2024-12-01 18:59:58 +01:00
Nils Kneuper
332ed60fcf updated Bengali translation 2024-11-30 14:00:45 +01:00
Nils Kneuper
408e4469b3 updated Hungarian translation 2024-11-24 17:25:10 +01:00
Nils Kneuper
e0abfaa743 updated Arabic translation 2024-11-23 15:46:21 +01:00
Nils Kneuper
a19920700b updated Italian translation 2024-11-23 15:45:27 +01:00
Nils Kneuper
c1a5621d47 updated Chinese (Simplified) translation 2024-11-23 15:44:34 +01:00
Tóth Kornél
00baf7d42c Map Editor terrain button click fix (#1335)
Fixed palette button not being clickable after scrolling in palette
widget without moving the cursor. Resolves #1335. The cause of the bug
was that scrolling doesnt change the highlighted state of the palette
buttons and not highlighted buttons didnt process being clicked.
Solved the bug by making not highlighted buttons process being
clicked.

(cherry picked from commit 484116ea09)
2024-11-19 17:16:33 +01:00
Severin Glöckner
2aa218f509 German translation fix
[ci skip]
2024-11-17 21:54:13 +01:00
Nils Kneuper
808acc9e85 updated Arabic translation 2024-11-16 12:36:38 +01:00
Nils Kneuper
67cc3b0638 updated Chinese (Simplified) translation 2024-11-09 18:34:46 +01:00
Nils Kneuper
96e27afe76 updated Turkish translation 2024-11-09 18:33:38 +01:00
Nils Kneuper
df228df56a updated Czech translation 2024-11-09 18:32:33 +01:00
Nils Kneuper
bbab147cd6 updated Bengali translation 2024-11-09 18:31:25 +01:00
pentarctagon
b3cdf881a0 fixup indent 2024-11-08 21:01:10 -06:00
Nils Kneuper
feb86cb839 updated Norwegian translation 2024-11-03 18:02:56 +01:00
Nils Kneuper
99ce33e7ef updated British English translation 2024-11-02 12:55:43 +01:00
Nils Kneuper
5fd0c15502 updated Arabic translation 2024-11-02 12:54:48 +01:00
Thewodoros
9f1bea517c Fix the attack_end event in Liberty S5
The event has to use side 3 because side 2 is idle. Also remove the dollar sign because IF_VAR doesn't work with it.

(cherry picked from commit ae5b2f0da6)
2024-10-31 10:27:22 +11:00
pentarctagon
8bdecab59e bump baseline 2024-10-28 15:49:42 -05:00
pentarctagon
f320b7be11 1.18.3+dev 2024-10-28 12:48:04 -05:00
pentarctagon
c7ea504892 1.18.3 2024-10-28 12:46:29 -05:00
pentarctagon
f99e74ae69 remove empty single space 2024-10-28 12:45:14 -05:00
pentarctagon
e4d3ffda78 changelog entries 2024-10-28 12:44:37 -05:00
pentarctagon
5cd8b3b6c9 pot-update and regenerate doc files 2024-10-28 12:40:25 -05:00
Nils Kneuper
8b29e0530c updated Hungarian translation 2024-10-26 14:21:18 +02:00
Nils Kneuper
413c13fc08 updated Arabic translation 2024-10-26 13:50:50 +02:00
SomeName42
f101c27251 The cause of the crash was that the active_menu_ variable was set to UNIT_FACING after the unit facing setting is finished. When clicking the menu it was looking for a unit because of the value of the active_menu_ variable and on line 670 the assert failed because it could not find one. Setting active_menu_ to MAP after the unit facing is set fixes this.
(cherry picked from commit a5e17f770d)
2024-10-21 10:07:06 +11:00
Ivan A. Melnikov
26ccfb778b
campaignd: Use completion token overload
... to fix compile issues with boost 1.86.

Commit 9c665ae3c4 does the same
for wesnothd, but campaignd still fails to compile with
overload resolution failure.

References  #9284

(cherry picked from commit a1cadb54e5)
2024-10-20 21:44:35 +02:00
Nils Kneuper
3c27d274a7 updated Chinese (Simplified) translation 2024-10-19 13:43:14 +02:00
Nils Kneuper
245576ce7d updated Czech translation 2024-10-12 11:08:41 +02:00
Nils Kneuper
6825707b34 updated Chinese (Simplified) translation 2024-10-12 11:07:27 +02:00
Nils Kneuper
bb2cdb889f updated Japanese translation 2024-10-05 15:07:41 +02:00
Nils Kneuper
a0ef4cbb4a updated Bengali translation 2024-10-05 15:06:58 +02:00
Gunter Labes
dc4f616514
Restore building with boost version < 1.80 2024-09-29 18:20:40 +02:00
Gunter Labes
c7cd11e0b7
Use completion token overload to fix compile issues with boost 1.86
Keep behavior of previous (now deprecated) overload by rethrowing exceptions.
2024-09-29 16:45:02 +02:00
Nils Kneuper
5a6c3a87ad updated Chinese (Simplified) translation 2024-09-28 00:58:53 +02:00
Severin Glöckner
5b08b79a84 fix in German translation
[ci skip]
2024-09-26 02:29:01 +02:00
Nils Kneuper
88fd63556a updated Finnish translation 2024-09-21 00:04:38 +02:00
Nils Kneuper
1ae6f481ff updated Turkish translation 2024-09-21 00:03:40 +02:00
gfgtdf
62685dc523 fix #9225 events with negative priority getting erroneously deleted
previously is_map_[id] would point to the wrong event, so that when an event was later deleted by id the wrong event would be deleted.
2024-09-18 02:10:55 +02:00
Nils Kneuper
8ecc810826 updated Bengali translation 2024-09-14 12:02:28 +02:00
Nils Kneuper
17a9c802c6 updated Czech translation 2024-09-14 00:48:12 +02:00
Nils Kneuper
fea220ddf8 updated Ukrainian translation 2024-09-14 00:47:07 +02:00
Nils Kneuper
25014855c6 updated Italian translation 2024-09-14 00:46:05 +02:00
Nils Kneuper
979545b60d updated Chinese (Simplified) translation 2024-09-14 00:45:05 +02:00
Subhraman Sarkar
ff81419ccf Update the help page entry for the Item tool
reflects the change that it is now possible to remove items.

(cherry-picked from commit 47642719bf)
2024-09-13 07:01:20 +05:30
newfrenchy83
9ad05132ee
Remove unit recursion of special_unit_matches()
Like unit recursion depth is to 3 and attack recursion 4, what count begin if and only if ability_(id/type) active called is more appropriate.

(cherry picked from commit aec9948c6d)
2024-09-12 10:51:53 +02:00
Wedge009
4f3d3fba36 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)

(cherry picked from commit b316ee518b)
2024-09-12 08:11:56 +10:00
Steve Cotton
a42030eae2 Test calculations of abilities with add and sub
Fix a typo in the add_sub_separated test, because it was testing
exactly the same code as add_sub_cumulative.

Add two new tests and clarify documentation, because in these tests
the order of the abilities determines whether the add or sub value is
used, it isn't that sub always overrides add.

(cherry picked from commit 547de5fd93)
2024-09-08 16:28:39 +02:00
newfrenchy83
617bd92c31
Fix recursion in abilities (counting version)
I use the same method what in master for weapon special recursion.

(cherry picked from commit c5351fb998)
2024-09-08 13:13:31 +02:00
Nils Kneuper
3a7804e43c updated Arabic translation 2024-09-07 14:46:38 +02:00
Nils Kneuper
b46932004b updated Chinese (Simplified) translation 2024-09-07 14:45:47 +02:00
newfrenchy83
1977fef81b fix tag_name check deficiencies(1.18 backport)
The tag_name check is deficient for two reasons:
1.when apply_to=both is used, in the case of [damage_type] [filter_opponent][filter_weapon]type= will check the modified type for application to the owner and the original type for application to the opponent, hence a risk of infinite recursion, especially if [filter_self][filter_weapon]type= is used in the same weapon.

2. in the case of apply_to=attacker/defender, the check for [filter_attacker/defender] must take into account both the value of the variable is_attacker but also the application AFFECT_SELF/OTHER, otherwise in the case apply_to=defender with [filter_defender][filter_weapon]type=, and[filter_attacker][filter_weapon]type= otherwise we end up in the same configuration as for apply_to=both

Finally tag_name is renamed check_if_recursion to mean that this variable is used to ensure that a recursion cannot be set up even if 743b146efc prevents it from causing a crash but with an error log
2024-09-07 10:23:28 +02:00
pentarctagon
8cf5612e57 try this baseline 2024-09-06 14:40:42 -05:00
Subhraman Sarkar
57934bfb8d item tool: add right-click to remove functionality 2024-09-06 20:29:16 +05:30
pentarctagon
a9bae2e6ca fixes VS build issues apparently 2024-09-06 09:14:14 -05:00
Charles Dang
7c7a079ffc Fix build on VS 17.11
(cherry picked from commit 8bf49639ea)
2024-09-06 13:18:00 +02:00
Steve Cotton
10976c3f45 Fix weapon special filters can lead to infinite recursion(1.18 backport)
this is a bachport of https://github.com/wesnoth/wesnoth/commits?author=stevecotton 4afdc92f13 comit because one change of behavior is to prevent crashes of game

This adds a recursion counter which runs on a per-weapon basis; if the
recursion limit is reached then the last level of recursion is assumed
to have returned false. A warning is printed (with error severity).

At the user-visible layer, that gives the following logic:

* Abilities that depend on another ability being active will be
  inactive.
* Pairs of abilities, where X depends on Y being inactive and Y
  depends on X being inactive, will end up with them both inactive.

The limit is defined by ATTACK_RECURSION_LIMIT in attack_type.cpp.
The minimum for passing all the unit tests is 2, but I've left some
headroom by setting it to 4.

With the recursion limit set to 1, the following tests fail, which
seems reasonable because they're checking that the special is on
a particular type of weapon.
* event_test_filter_attack_specials
* event_test_filter_attack_opponent_weapon_condition
* event_test_filter_attack_student_weapon_condition

Output from the four_cycle_recursion_branching test:
```
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = parry'
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = poison'
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = damage'
```

There's deduplication to prevent the logfiles getting spammed during
AI turns. As implemented, the two tests mentioned below print 3
messages each; these tests are added in separate commits because the
tests are shared between PRs while we discuss the right mechanism for
guarding against recursion.

With no rate limit:
* four_cycle_recursion_branching prints 1280 logs
* event_test_filter_attack_student_weapon_condition prints 320

With a rate limit via a flag that's reset in recursion_guard's destructor:
* four_cycle_recursion_branching prints 80 logs
* event_test_filter_attack_student_weapon_condition prints 160

Resetting the flag in specials_context_t's destructor gets better numbers,
but splits the logic across .cpp files. I think the trade-off isn't worth it:
* four_cycle_recursion_branching prints 40 logs
* event_test_filter_attack_student_weapon_condition prints 132

Co-authored-by: newfrenchy83
2024-09-04 08:11:37 +10:00
Tahsin Jahin Khalid
f8034fc4fe names: remove inappropriate saurian name 2024-09-03 20:04:32 +05:30
Subhraman Sarkar
f00dbb066b remove inproper and inconsistent names
1. remove obviously English and English sounding female names from Dunefolk female names list
2. remove 'bakri' from male name list (means 'goat', could be offensive)
3. remove one potentially offensive name from saurian name list
4. remove 'Dalal' from dunefolk female names (can be used as slang)
2024-09-03 20:04:32 +05:30
Elvish_Hunter
abaaefc6bd Fix wmlindent warnings 2024-09-01 01:10:18 +02:00
Elvish_Hunter
98d0af2ca2 Silence several wmllint warnings 2024-08-31 23:11:47 +02:00
Charles Dang
2f06922052 Floating Label: hide other contexts' labels when creating a new one (resolves #8845)
Very hacky, but it fixes the issue in question while we look at refactoring this mess...

(cherry picked from commit 8efac78de8)
2024-08-30 16:09:54 +10:00
Charles Dang
28310a4006 Fix HUD buttons drawing too early (fixes #8648)
Fixup for f79b38a1af.

(cherry picked from commit 4472867992)
2024-08-30 15:57:26 +10:00
Gunter Labes
f524731153 Update generator calls since the method was removed in 2413e2f
(cherry picked from commit 6d6bb8dc0c)
2024-08-28 15:25:55 +10:00
Nils Kneuper
170253beab updated Japanese translation 2024-08-24 11:47:19 +02:00
Nils Kneuper
7a8d459e54 updated copyrights for Turkish image update 2024-08-23 15:00:30 +02:00
Nils Kneuper
4285a9ca09 updated Turkish translation 2024-08-23 14:48:21 +02:00
Nils Kneuper
f464f1d9aa updated Chinese (Simplified) translation 2024-08-23 14:30:23 +02:00
Nils Kneuper
e5f63526b6 updated Bengali translation 2024-08-23 14:28:07 +02:00
Toom
ad8fd351c1 add tooltip to [unit_vision] 2024-08-19 15:57:32 -04:00
Eric Gallager
7837deeec5 wmlscope: fix format of magic comment in documentation
It's not just `prune`, but rather `wmlscope: prune`
2024-08-18 11:42:46 +02:00
Iris Morelle
0c3b1d31b1
Merge pull request #9180 2024-08-17 12:48:09 -04:00
Elvish_Hunter
5a174662b3 Changelog entry for PR #9189 2024-08-13 22:56:56 +02:00
Elvish_Hunter
0e693b8077 Add sprite for the Cold Dagger item to UtBS (#9189)
* Add sprite for cold dagger item

* UtBS 04: use cold dagger sprite

* Update copyrights.csv for the cold dagger sprite
2024-08-13 22:54:02 +02:00
Gunter Labes
fa1b943bac
Fix filter attribute name 2024-08-11 15:24:21 +02:00
Steve Cotton
0b34ff94c5 Add a unit test for the [terrain] tag in HttT S17
Using a terrain SLF in the [terrain] tag has a quirky syntax,
so let's add a test for it.
2024-08-10 18:10:56 +02:00
Steve Cotton
9984f63f92 HttT S17 Don't erase castles from other leaders
The random map generator can generate starting locations so close that
ERASE_CASTLE removed not just the intended castle, but also the keep
of the nearby leader. To avoid that, create the castles after deciding
which leaders to remove.

The ERASE_CASTLE macro is obsolete; even for logic that erases
castles,  using location_id makes the code simple enough that a macro
isn't useful. However, as this change is being applied to 1.18, I'm
only adding a comment about it.
2024-08-10 18:10:56 +02:00
Nils Kneuper
fbdfa23a03 updated Czech translation 2024-08-10 15:11:50 +02:00
Nils Kneuper
e2c17ed742 updated French translation 2024-08-10 15:10:41 +02:00
Gunter Labes
b6a73c3b8f
Properly implement DO_NOT_MODIFY_CACHE
This fixes node_to_string() by making sure the node is really not modified.
2024-08-10 12:59:58 +02:00
Sergey Popov
b157ddc4ec
wesnothd: avoid a race condition when logging on
Ensure that there is no coroutine yield between confirmation of login
and update of player_connections_. Otherwise another login under same
name could succeed if it happened before handle_player() which resulted
in an assert later.
2024-08-09 18:32:32 +03:00
pentarctagon
cece8f963d Disable WML tests for debug builds
Not that useful to run them with debug as well as release binaries and it takes a lot of time.
2024-08-08 19:15:30 -05:00
pentarctagon
3aee83a88a behavior difference between 1.18 and 1.19. 2024-08-08 17:49:33 -05:00
pentarctagon
b6c6fabd21 damage_type tests 2024-08-07 21:33:26 -05:00
Iris Morelle
8dfe3e6178
Add changelog entry for the editor tool help toggle 2024-08-07 10:19:34 -04:00
Iris Morelle
eb8b04751d
Update copyrights.csv 2024-08-07 10:19:34 -04:00
Iris Morelle
e6a4bbf2f3
editor: Implement a Show Tool Information toggle option
This allows permanently hiding the obnoxious help text tooltip that
constantly dances between the top and bottom of the screen depending
on what you're doing in the editor.

Icons provided by babaissarkar.
2024-08-07 10:19:34 -04:00
Wedge009
e6dd32b8e8 SotA S2: Avoid destroying unit potentially already occupying target hex. (Closes #9150)
(cherry picked from commit 12606e2fc5)
2024-08-07 09:01:36 +10:00
Gunter Labes
0630f10830
Call Export appropriately instead of using locals() 2024-08-04 14:01:16 +03:00
Severin Glöckner
1f5d45a9f3 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:02:05 -05:00
pentarctagon
e82c5c433e damage max_value only works with 1.19+ 2024-07-30 22:17:18 -05:00
Pentarctagon
36fac11ad2 damage ability tests (#9137) 2024-07-30 19:08:21 -05:00
Toom
59ad396840 fix WRN_NG level
(cherry picked from commit cd5f878eba)
2024-07-29 10:51:47 +10:00
Nils Kneuper
812f779e23 updated British English translation 2024-07-27 13:38:39 +02:00
Nils Kneuper
1243984f9a updated Chinese (Simplified) translation 2024-07-27 13:37:05 +02:00
Nils Kneuper
a850dad851 updated Bengali translation 2024-07-27 13:14:26 +02:00
Oleksii
85324ae26c DM: S18 recall fix (#9118)
* DM S18 recall fix

* Update 18_The_Portal_of_Doom.cfg

* Update sides.cfg

(cherry picked from commit b372f9e9ae)
2024-07-23 15:41:28 +10:00
pentarctagon
1b47cea9c5 max_value works in 1.19+ 2024-07-22 00:19:50 -05:00
Pentarctagon
63e8b69236 chance_to_hit tests (#9093) 2024-07-21 17:32:14 -05:00
Dalas121
da31d005ea EI: changelog entry for backported changes
(in the future I'll do these as part of the main PRs)
2024-07-19 20:32:18 -05:00
Dalas121
20e1989615 EI S12: fix Dra-Nak having inconsistent traits and portrait (#9113)
In EI S11, the player encounters an orcish warlord named Dra-Nak. If not killed in S11, he continues pursuing the player in S12, but the current S12 gives him different traits and a different portrait. This PR fixes the issue.
2024-07-19 20:32:18 -05:00
Dalas121
e8493cd807 EI S17b: fix buggy dynamic recruit list macro (#9105)
EI's S17b has a gold refund mechanic, allowing enemies to build up large gold reserves in certain situations.

When gold gets high, enemies are supposed to start recruiting higher-level units so they can spend it faster. The former implementation had some inconsistent issues; this should restore the intended behavior.
2024-07-19 20:32:18 -05:00
Dalas121
e940d62ba9 EI S04c: only award achievement if all prisoners escape (#9108)
EI's S04c has an achievement for rescuing all 6 prisoners. This achievement currently triggers even if prisoners die before escaping the scenario.
2024-07-19 20:32:18 -05:00
Dalas121
62df15b6c8 EI S99: prevent prisoner income if prisons are captured (#9112)
In EI's S99, you gain gold from defeating and capturing hostile drakes.  The drakes are physically moved to prison cells in the middle of the map.

Previously, the player could continue capturing drakes even if the prison cells were captured by enemies. This made it a strong strategy to abandon the center and turtle up in a corner of the map. Additionally, the prison cells stayed locked with prisoners inside.

This PR fixes this issue. This also adds 2 new strings; I'm planning to backport to 1.18.2, as this is arguably a bugfix.
2024-07-19 20:32:17 -05:00
Dalas121
2e2db9b4d1 EI S11, S99: prevent backdoor entrance into prison cells (#9114)
EI's S11 and S99 have prison cells, one of which has an unintended backdoor entrance via an unwalkable deep water river. Flying units are involved in these scenarios, and can possibly fly into the cells through this unintended backdoor.

This PR changes the map hexes from unwalkable to impassable.
2024-07-19 20:32:17 -05:00
Charles Dang
16405a5595 MP/Faction Select: fix help page handling (backport) 2024-07-18 11:54:19 -04:00
Nils Kneuper
07a04c0645 updated Finnish translation 2024-07-13 11:32:02 +02:00
Nils Kneuper
72f2fabadf updated Chinese (Simplified) translation 2024-07-13 11:30:45 +02:00
Nils Kneuper
46efc9cec9 updated Bengali translation 2024-07-13 11:29:53 +02:00
Steve Cotton
15794ceee7 updated German translation
Thanks to Wuzzy for all of these.

Also reverted a couple of places where 1.19's change from "default has
six factions" to "default has seven factions" had leaked into 1.18.
2024-07-11 22:50:15 +02:00
Nils Kneuper
ec16918236 updated British English translation 2024-07-06 10:00:27 +02:00
Nils Kneuper
4af6073c40 updated Czech translation 2024-07-06 09:58:19 +02:00
Nils Kneuper
10ff03c389 updated French translation 2024-07-06 09:56:46 +02:00
Wedge009
cf7ceb6f24 SoF: Align masked dwarf portrait to the right, consistent with S9. Resolves #9008.
(cherry picked from commit c67d130507)
2024-07-06 11:45:18 +10:00
Severin Glöckner
2f73ec0fdb German translation update 2024-07-05 12:18:23 +02:00
Steve Cotton
b4d6878169 wmltools3: fix regexp compatibility with Python 3.12
(cherry picked from commit 91f59a794b)
2024-07-05 12:18:23 +02:00
Gunter Labes
17d9d2ecd6 Fix "span" regex
This disallows matching "0-11-2" and "1," for example. It also avoids an exponential backtracking issue which could make this regex very slow.

(cherry picked from commit 28a8959854)
2024-07-05 12:18:23 +02:00
Steve Cotton
69cd90c915 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.

(cherry picked from commit 17c202d3fb)
2024-07-05 12:18:23 +02:00
Steve Cotton
06c0caf910 HttT S17 Don't create lava near the Sceptre
The lava is supposed to stay away from the Sceptre itself.
However, 60d114b changed from using sceptre_x,sceptre_y to using
a location_id, and missed updating these macros.
2024-07-05 12:18:23 +02:00
Subhraman Sarkar
88fc3cda4f open load map/save map as dialogs in the addon's map directory
with no addon selected they open in the editor/maps directory
2024-07-05 12:32:16 +05:30
Subhraman Sarkar
bf85b31c59 save inside add-on instead of saving inside editor/maps or editor/scenarios (#8910) 2024-07-05 12:32:16 +05:30
Subhraman Sarkar
4ac8b52563 add functionality to "Loyal" checkbox (Unit tool -> Place unit -> Right click menu) (#8445) 2024-07-05 12:32:16 +05:30
Steve Cotton
e42f83a8d2 Ignore GCC-14 and Clang false positives about dangling pointers
For GCC-13, cfb28fbfb5 (in master)
added -Wno-dangling-reference, and that commit explains why the
false positive is triggered by calling find_widget. For GCC-14
there's an attribute so we can flag this specific function as ok.

Clang complains about unknown attributes in the gnu:: namespace,
so has to have the #if, and the #if means we need the #ifdef.

There are still warnings in src/actions/attack.cpp, but that area is
being worked on for an infinite recursion bug, and those warnings log
in a single batch instead of being spread across multiple .cpp files.
2024-07-01 13:33:36 +02:00
loonycyborg
a56ff99f78
appstream manifest: merge <provides> tags to placate flathub's linter 2024-06-29 22:07:50 +03:00
Nils Kneuper
b446e077bf updated Chinese (Simplified) translation 2024-06-29 14:44:28 +02:00
Nils Kneuper
20636bb698 updated French translation 2024-06-29 14:43:10 +02:00
Nils Kneuper
e4fb2344c9 updated Bengali translation 2024-06-29 14:28:52 +02:00
Nils Kneuper
cb1639da4d updated British English translation 2024-06-29 14:27:14 +02:00
pentarctagon
57ceb7ac66 1.18.2+dev 2024-06-28 22:49:42 -05:00
pentarctagon
32b82e1c47 1.18.2 2024-06-28 22:42:43 -05:00
pentarctagon
ef95de6649 changelog 2024-06-28 22:41:17 -05:00
pentarctagon
f6c3a31e0e pot-update and regenerate doc files 2024-06-28 22:38:58 -05:00
gfgtdf
5c442ae9c6
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 20:17:33 +02:00
Nils Kneuper
5cd164ed8c updated French translation 2024-06-22 23:07:38 +02:00
Nils Kneuper
44cd0bf496 updated Ukrainian translation 2024-06-22 23:05:59 +02:00
newfrenchy83
791e23b2ba Fix damage_type types show in unit attack window[1.18]
If [damage_type]apply_to= is applied to a unit that does not have the range attack equivalent to that of the user this type will still be shown, which should not be.
2024-06-18 22:39:51 +02:00
Steve Cotton
d5b726df6e Fix warnings about a template id in a constructor
It's redundant, and GCC-14 warns that this isn't allowed in C++20.
2024-06-16 12:48:13 +02:00
Steve Cotton
087fa65dc5 Fix dangling reference warnings about refs to iterators
These are causing warnings with GCC-14.

An iterator can often be a struct containing a single pointer, so
creating a reference to such a small struct doesn't make sense.

The structure returned by child_range is likely to be exactly two
pointers, so it's not a burden to keep it even though back() has
already finished accessing the child_iterator.
2024-06-16 12:48:13 +02:00
Pentarctagon
0d27d59901 Add berserk weapon special abilities tests (#8973)
Changes:
* CHECK_STRIKES macro now takes a comma-delimited list of strike counts for when units have a different number of strikes for different weapons, and updates the existing usage in the attacks tests
* Fixed a typo in the attacks_zero test
* Adds tests for berserk as a weapon special ability.

Berserk's handling differs from attacks as a weapon special ability:
* A value less than 1 is treated as effectively infinite rounds of combat (undocumented)
* The cumulative attribute is handled differently - in some cases it sums the values instead of using the highest single value whereas for attacks it always uses the highest single value

Also now exclude data/tests/ from scons pot-update since it was hitting the argument limit for number of arguments to a script.
2024-06-15 20:21:47 -05:00
Gunter Labes
af9dd1bfb6
Remove left over debug print 2024-06-15 22:47:01 +02:00
Subhraman Sarkar
54f7c206a9 network_download_file: replace spaces with tabs
Merely a whitespace change

(cherry picked from commit 441b2bbfaa)
2024-06-15 14:15:01 +02:00
Subhraman Sarkar
d0111b33b4 replace deprecated CURLOPT_PROTOCOLS with CURLOPT_PROTOCOLS_STR
* replace deprecated CURLOPT_PROTOCOLS with CURLOPT_PROTOCOLS_STR
* use conditional compilation for curl 7.85.0

(cherry picked from commit c12bb8ef69)
2024-06-15 14:15:01 +02:00
Nils Kneuper
b7f703a330 updated Chinese (Simplified) translation 2024-06-15 12:49:15 +02:00
Nils Kneuper
d9fa0ed182 updated French translation 2024-06-15 12:48:08 +02:00
loonycyborg
94412ee7b4
Change id tag in appstream manifest to what is expected
Flathub linter complains about mismatched id in flatpak manifest and
appstream. Based on appstream docs it seems that reverse-DNS name is
expected without .desktop extension so appstream should be changed.
Extra <provides> and <replaces> tags added as per
https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/#renaming-id-tag
2024-06-12 04:48:54 +03:00
Dalas121
a37aadcbc5 Merge branch '1.18' of https://github.com/wesnoth/wesnoth into 1.18 2024-06-10 19:17:32 -05:00
Dalas121
2a54d4aaf1 Revert "EI S06b: revert string change for 1.18.1 freeze"
This reverts commit 6408559b02.
2024-06-10 19:17:22 -05:00
Dalas121
d1dd992d08 EI S10: add message about Owaec being able to recruit (#8987)
Owaec has a crown but little other indicator that he's a leader, and this scenario requires him to be used to recruit. Make it more obvious to the player.
2024-06-10 19:15:41 -05:00
gfgtdf
e13d4dcaf8 Fix game sending actions too soon leading to OOS erros
Previously undo_blocked() would return false positive results. Leading to OOS erros because the game would then send actions to other clients even though they were still undoable. This would then result in OOS erros when the player attempts to undo the move.

This line is probably not needed at all since using the rng should always set is_simultaneous_ to true, but lets keep the changes minimal for the 1.18 stable branch.
2024-06-10 13:46:51 +02:00
pentarctagon
d8cd3449e0 1.18.1+dev 2024-06-09 22:51:02 -05:00
pentarctagon
e461e35729 1.18.0 2024-06-09 22:48:59 -05:00
pentarctagon
daf204f6f7 pot-update and regenerate doc files 2024-06-09 22:46:17 -05:00
pentarctagon
80d07152c7 changelog_entries 2024-06-09 22:41:49 -05:00
Dalas121
c2a59869cf EI items: add [filter_second] to Sentinel Shield and set delay=0 (#8984)
Delay=0 fixes an annoying animation issue, as the default is delay=500.
2024-06-09 21:12:25 -05:00
Dalas121
08358a38db EI S13: fix gaoler rebuild breaking "free prisoner" events (#8980)
Formerly, EI S13 uses various Deathblades' max-moves status instead of [filter_second] for some reason. This breaks when deathblades get rebuild, which in the bug report was caused by the sentinel shield. Use [filter_second] instead.
2024-06-09 21:12:24 -05:00
Dalas121
6cc8b2e1e1 EI S11: drop equippable items when imprisoned (#8982)
This is thematic, and also prevents cheese with shield+dacyn and baneblade+gate
2024-06-09 21:12:24 -05:00
Dalas121
cfc85d63e2 EI S10, S11, S12: Dacyn difficulty tweaks (#8976)
Resolves #8969

In EI S10, Dacyn picks up a cursed amulet and his HP drops to 1. In EI S11, Dacyn remains on very low HP, and is surrounded by orcs. There's a convenient ford hex he can hide on and be protected, but several players did not notice this hex and complained about difficulty.

In S10, this commit also drops his XP to 0. 1) showing that the amulet interferes with his MoL-ing, and 2) preventing the player from deliberately AMLA-ing Dacyn in the next scenario (partially a difficulty issue, but mostly it's bad to punish blind playthroughs / reward foreknowledge).

In S11, this commit adds a gold pile on Easy/Normal hinting towards the hex, while on Easy Dacyn's HP is fully restored. Hard is unaffected.

In S12, this commit restores Dacyn's HP on Easy (since it would be odd if he had full HP S11 but low HP S12).
2024-06-09 21:12:24 -05:00
Dalas121
f880bbaec8 EI S09: fix Grug telling Gweddry he can recruit the wild ogres after having already done so (#8981) 2024-06-09 21:12:24 -05:00
Dalas121
677e950d75 Merge branch '1.18' of https://github.com/wesnoth/wesnoth into 1.18 2024-06-09 11:24:05 -05:00
Dalas121
1a3ed67ec2 EI S10: reduce difficulty on Easy/Normal (#8956)
https://www.reddit.com/r/wesnoth/comments/1d6a3e7/eastern_invasion_is_much_better_but_still_bad/

EI's S10 is overly hard on Normal, and especially on Easy (which is intended to be a very accessible difficulty). This PR increases the available gold and adds several villages, which aid in both defense and upkeep. This PR also drastically reduces the number of orcs on lower difficulties.

We also move Owaec to his keep to help imply his ability to recruit, and remove the related just-added [note] string to avoid violating 1.18.1 string freeze.
2024-06-09 10:54:30 -05:00
Nils Kneuper
2d4a675069 updated Ukrainian translation 2024-06-09 09:17:04 +02:00
Severin Glöckner
0c409d5391 terrain2wiki tool: link to images on stable 1.18 branch 2024-06-08 21:17:23 +02:00
Severin Glöckner
305166e977 terrain2wiki tool: python 3.12 compatibility 2024-06-08 21:16:18 +02:00
Severin Glöckner
1b55cee68a German translation update 2024-06-08 20:54:00 +02:00
Steve Cotton
55aa8b44cf Add a unit test for a weapon-special activating mid-attack
A weapon with poison, which does extra damage to poisoned opponents.
This tests that the weapon-special's filter is checked on each strike,
instead of being tested once and then cached during the battle.
2024-06-08 15:50:41 +02:00
Nils Kneuper
2a195e128b updated Chinese (Simplified) translation 2024-06-08 15:42:48 +02:00
Nils Kneuper
b4b67f83b2 updated Japanese translation 2024-06-08 15:41:47 +02:00
Nils Kneuper
8b95042949 updated French translation 2024-06-08 15:40:51 +02:00
Nils Kneuper
72a308ab32 updated Czech translation 2024-06-08 15:39:55 +02:00
Nils Kneuper
9da76b2123 updated Bengali translation 2024-06-08 15:38:43 +02:00
Dalas121
6408559b02
EI S06b: revert string change for 1.18.1 freeze
EI S06b objective strings were changed to be less misleading and more transparent. Revert this change, and re-implement after 1.18.1 releases and the string freeze is no longer in effect
2024-06-06 20:35:16 -05:00
newfrenchy83
b990c4c10b
Use type_adv_tree in some filters to support addons adding advancements to existing unit types (#8904)
Cherry-pick of 9dd2d5d94b
2024-06-05 11:50:46 +02:00
Steve Cotton
b1458835cc Fix the whitespace error 2024-06-02 15:15:29 +02:00
Dalas121
961a8d7835 EI: use "bonus objective" instead of "optional objective" (#8947)
"optional" may imply that the scenario will be completed once this objective is finished, which is not accurate for these scenarios.
2024-06-01 17:58:16 -05:00
Dalas121
ef4cf3d0ac EI S06b: clarify bonus objectives
https://forums.wesnoth.org/viewtopic.php?p=690528#p690528

Old verbiage suggested that the scenario would be won as soon as you moved any unit next to Yannic, and didn't give any indication that he'd need to be protected.
2024-06-01 17:57:57 -05:00
Severin Glöckner
e447ccf70d Add [part]text_alignment= to schema
[ci skip]
2024-06-01 19:24:16 +02:00
Nils Kneuper
c51b35f249 updated British English translation 2024-06-01 14:38:45 +02:00
Nils Kneuper
c9c7b5e547 updated Bengali translation 2024-06-01 14:37:26 +02:00
Nils Kneuper
d9619c1fca updated French translation 2024-06-01 14:36:37 +02:00
Nils Kneuper
5f1da43829 updated Chinese (Simplified) translation 2024-06-01 14:35:34 +02:00
pentarctagon
2d816e8786 fix for targeting macos 10.12
note that this will no longer be possible once macos-12 is removed from CI eventually
2024-05-31 11:34:29 -05:00
Charles Dang
9163d84c07 Bump vcpkg baseline
Gives us (among other things) these updates:

Boost:             1.82                            -> 1.84
OpenSSL/libcrypto: 3.1.0a-dev (runtime 3.1.0a-dev) -> 3.2.0a-dev (runtime 3.2.0a-dev)
libcurl:           8.1.2 (runtime 8.1.2-DEV)       -> 8.6.0 (runtime 8.6.0-DEV)
Cairo:             1.17.8 (runtime 1.17.8)         -> 1.18.0 (runtime 1.18.0)
Pango:             1.50.14 (runtime 1.50.14)       -> 1.50.14 (runtime 1.50.14)
SDL:               2.26.5 (runtime 2.26.5)         -> 2.30.0 (runtime 2.30.0)
SDL_image:         2.6.3 (runtime 2.6.3)           -> 2.8.2 (runtime 2.8.2)
SDL_mixer:         2.6.3 (runtime 2.6.3)           -> 2.8.0 (runtime 2.8.0)

(cherry picked from commit f1e6a0e0b1)
2024-05-31 09:35:04 -05:00
pentarctagon
635f6f035a after last minute translation updates 2024-05-26 11:03:12 -05:00
Steve Cotton
2580c34c12 Update the changelog
Just adding entries for commits that should have had a changelog_entries file,
not merging the existing changelog_entries files.
2024-05-26 15:14:13 +02:00
Nils Kneuper
d461156a3d updated Ukrainian translation 2024-05-26 11:44:43 +02:00
Nils Kneuper
56533dcf93 updated French translation 2024-05-26 11:43:53 +02:00
pentarctagon
d64b602e03 string freeze pot update. 2024-05-25 21:36:13 -05:00
Steve Cotton
bcc75d840b gui/language_selection: Rephrase text about becoming a translator
The link with details about individual compaigns is useful to players,
even if they aren't looking to become translators. So move it upwards.

The text about first-time players seemed confusing to me, as the choice
is already limited to languages that the player can read. Reworded it,
but after discussion in the PR, neither version was better than just
removing it.
2024-05-26 04:09:24 +02:00
Steve Cotton
4487b32063 Put the community dialog's strings in the wesnoth-lib domain
Most of the GUI, including the title screen's "Community" button,
is already in wesnoth-lib. So making this consistent also means
we're only adding one copy of "Community" to the .pot files.

Make the whitespace in this file consistent (using tabs).
2024-05-26 04:08:39 +02:00
gfgtdf
24b623ce5d
Fix #7478 game crash after reloading a mp game in debug mode (#8907)
This is not an optiomal fix as it can still crash if can_start_game() returns false, but its clearly am improvment to the situation in #7478 .

This also removes the "always show mp staging between scenarios in debug mode" feature, which imo never was that useful anyways.
2024-05-25 18:04:13 +02:00
Dalas121
f4a1d25d3f EI S04b: add objective note regarding herb distribution.
S04b's alternative objective involves collecting herbs that semi-randomly spawn around the map, hidden under fog. Herbs spawn in all directions, but the map layout and scenario design can lead players to expect herbs to all be in the east. This objective note clarifies herb placement.

https://forums.wesnoth.org/viewtopic.php?t=57915
2024-05-24 20:21:28 -05:00
Dalas121
d5203c100d EI S06b: weaken eastern leader guards on lower difficulty
To complete EI's S06b, the player must fight through a necromancer and his bodyguards. Prior to this commit, the necromancer's bodyguards did not vary by difficulty, making Easy disproportionately difficult.

Other leaders do not need to be fought directly to win. In addition, this is an optional mission labeled as more difficult. Therefore, I haven't adjusted other leaders' guards' difficulty scaling.

https://forums.wesnoth.org/viewtopic.php?t=57915
2024-05-24 20:20:46 -05:00
Dalas121
d84ee4ae2d EI S17b: fix Mal-Ravanal pausing to capture villages
Many turns into EI S17b, a pre-existing lich changes sides and transforms into Mal-Ravanal.

Before this commit, this process would un-capture any villages previously captured by that side, causing Mal-Ravanal to waste turns retaking them.
2024-05-24 20:20:18 -05:00
Jonathan-Kelly
12aca1caa0 WoF S11: fix easy win AI exploit (#8774)
Fixes #8759
2024-05-25 09:36:14 +10:00
Jonathan-Kelly
437e6f4820 WoF: fix Lua type error with cast to number (#8773)
Lua was getting this variable without being told it is a number rather than a string. On some systems it is interpreted as a string which breaks this monster spawner code and throws Lua error messages onto the player's screen.
2024-05-25 09:35:55 +10:00
pentarctagon
12e15b004c CI update 2024-05-22 19:23:53 -05:00
pentarctagon
f012d1199a sort the full list of files by name 2024-05-22 19:23:42 -05:00
pentarctagon
4fa1f4a027 print files/rows that have issues 2024-05-22 19:21:46 -05:00
pentarctagon
82fb578eea write updates back to same file 2024-05-22 19:21:39 -05:00
Dalas121
ea7a485629 EI: Prevent Dacyn from using the Plague Staff (#8892)
Fixes #8885
2024-05-22 18:28:08 -05:00
Dalas121
16db8c6dba EI: remove random traits from S16 townsfolk (#8896)
Units with traits may sometimes have quick and may sometimes not have quick. This causes civilians to randomly block certain castle hexes that the player can use to recruit.

Remove traits to prevent this random blocking. Increase MP 4->5 to prevent 2 castle hexes from always being blocked.
2024-05-22 18:27:35 -05:00
Dalas121
292dfd426a EI S09: add label to gold pile
EI's S09 has a small pile of gold some distance off the main path, visible through the shroud.

Without a label, players may over-commit units/upkeep to getting the gold without realizing it's only a small amount, and possibly worth skipping.
2024-05-22 18:27:16 -05:00
Earth-Cake
99d5190b79 liberty generals name achievement fix for dawn 2024-05-21 23:21:59 -05:00
Wedge009
4d425a87a4 wmlxgettext: Remove unused WmlDefineState class disabled-as-comment/string and resolve #8867 (Python 3.12 highlighting invalid escape sequence in string with SyntaxError).
[ci skip]
2024-05-21 23:33:54 +02:00
Dalas121
1f3982d0f9 EI: Prevent Dacyn from using the Plague Staff (#8892)
Fixes #8885
2024-05-21 11:15:08 -05:00
Wedge009
98808019d0 Tutorial S2: Only trigger comment about the 'Dumbo' orc if it is still alive after the attack.
Addresses final point in #5544.

(cherry picked from commit ef13ea4565)
2024-05-21 14:53:40 +10:00
Nils Kneuper
bc0e88458c updated French translation 2024-05-18 11:15:21 +02:00
Nils Kneuper
c7b09d0984 updated Italian translation 2024-05-18 11:13:57 +02:00
Nils Kneuper
f230cd6f11 updated Finnish translation 2024-05-18 11:12:45 +02:00
Iris Morelle
176140c9ff Update changelog 2024-05-16 22:32:36 -05:00
Iris Morelle
9aec6e2d06 gui/language_selection: Show locale codes if debug mode is enabled 2024-05-16 22:30:26 -05:00
Iris Morelle
7e45cc3bac gui/language_selection: Additional UI work for clarity
* Moved the Show All Languages checkbox from the main body to the
   bottom left of the dialog to save space and make it more obviously
   connected to the listbox.

 * Changed the Show All Languages checkbox label to reduce the word
   count a tiny bit.

 * Added text regarding translation percentages representing core
   textdomains only.

 * Added a link to gettext.wesnoth.org.
2024-05-16 22:30:18 -05:00
Iris Morelle
5ed6874de2 gui/language_selection: Remove redundant class variable 2024-05-16 22:30:02 -05:00
Iris Morelle
e786b4bd58 gui/language_selection: Use a custom label for the OK button 2024-05-16 22:29:53 -05:00
Iris Morelle
d7967f8883 gui/language_selection: Don't force even height for language column
While it sounds like a great idea on paper, in practice having the
language column have the same height on all rows causes issues because
of at least one entry having an unusually tall label because of
non-Latin characters involved in it.

[label] does not support setting the vertical alignment of text — only
the vertical alignment of the widget itself can be set. This doesn't
help in this case because the widget is always as tall as its row —
it's the text's positioning that needs adjusting.

It turns out to be a better look to have all text be vertically
centered by not letting the label's height be dictated by the row's,
and let the layout engine center the label if needed for any reason.
2024-05-16 22:29:45 -05:00
Iris Morelle
5f196160c5 gui/language_selection: Language dialog overhaul
This overhaul introduces a GUI option to show all languages regardless
of their completion threshold, as well as a side panel including a
general explanation of community translations and how players can
potentially contribute to them, plus a link to the main translations
page on the wiki.

A few points to make here:

 * The URL points to the main page on purpose, since it's meant to be
   a catch-all for all languages regardless of which one the player
   has got selected or configured (those are two different things at
   the moment).

 * There's an issue where when showing all translations, some of the
   non-Latin translation names cause the baseline of the language
   name labels to end up entirely misaligned with the completion
   labels. I am not entirely sure how to fix this right now.

 * Showing all translations alters the dialog's layout permanently. I
   believe there's no way out of this with the current GUI API.

 * We use the stock text colouring function used for unit defence
   values. This might not be entirely ideal because they are all very
   green for translation stats above the minimum threshold, so there's
   basically no variance by default until all translations are shown
   together.

 * An idea could be to add a link to the gettext.wesnoth.org stats
   page in the dialog.
2024-05-16 22:29:28 -05:00
Iris Morelle
60c39ea239 i18n: Add getter for the translation visibility threshold 2024-05-16 22:25:46 -05:00
Steve Cotton
7c8f357d09 Update German translation
Thanks to Aurelix.
2024-05-15 11:35:46 +02:00
pentarctagon
d17549b5f9 don't need to check the same thing 5 times. 2024-05-13 00:19:22 -05:00
pentarctagon
ad14fb5de8 update macos version used in CI 2024-05-12 23:21:02 -05:00
Nils Kneuper
8ada1bf323 updated Czech translation 2024-05-11 12:57:34 +02:00
Nils Kneuper
02ed6f2b58 updated Bengali translation 2024-05-11 12:56:24 +02:00
Nils Kneuper
67f3b6f9ab updated Finnish translation 2024-05-11 12:55:22 +02:00
Nils Kneuper
e861d33533 updated French translation 2024-05-11 12:54:08 +02:00
pentarctagon
306be61f57 remove unused threads commandline options 2024-05-07 18:58:24 -05:00
pentarctagon
0160eb6e6d Don't trigger achievement completion during replays.
Fixes #8858
2024-05-07 18:55:24 -05:00
Dalas121
21ea192584 EI S04b: Prevent aswaldan herbs from stacking (#8859)
In "Ill Humors", 2 spawn regions for aswaldan herbs overlap, which can result in both spawning on the same hex without any special visual indicator.

Credit to PointMeAtTheDawn.
2024-05-07 17:53:42 -05:00
Dalas121
f927bb344a EI: s10 fix owaec being able to enter the sanctuary (#8850)
Fixes #8843
2024-05-05 09:19:13 -05:00
Earth-Cake
48cee23179 EI - changed undead variants from 'spider' to 'ant' (#8849) 2024-05-05 08:16:24 -05:00
Nils Kneuper
96ee41d87b updated Norwegian translation credits 2024-05-04 16:02:39 +02:00
Nils Kneuper
0fda4450ae updated Norwegian translation 2024-05-04 16:01:19 +02:00
Nils Kneuper
4e06423b43 updated French translation 2024-05-04 15:57:55 +02:00
pentarctagon
545ba266bd Remove version-specific info from xcode projectfile
Instead set the Apple preferences folder from within the code rather than using -DPREFERENCES_DIR.
Remove -DHAS_RELATIVE_LOCALEDIR since that doesn't appear to actually do anything since its only usage is in filesystem_common.cpp, not filesystem.cpp.
2024-05-03 23:43:23 -05:00
Steve Cotton
8c83da78e2 EI: Add po hints about the plague staff 2024-05-03 17:05:01 +02:00
Wedge009
76cdd3bfb5 Add date/time reference to translation hint. Resolves #8822.
Current implementation of translation::strftime() uses boost.
Boost docs do not appear to have a 'current' or 'latest' link, instead only making documentation available by explicit version number.

(cherry picked from commit 5e9260570b)
2024-05-02 08:28:19 +02:00
pentarctagon
5491e48ad9 allow loading .mask files 2024-05-01 13:07:48 -05:00
pentarctagon
b9d2095ec0 1.18 status in readme. 2024-04-29 22:28:34 -05:00
Subhraman Sarkar
3dec7e6c78 add icon to windows installer and uninstaller (#8817)
(cherry picked from commit 6e2cbdce54)
2024-04-29 10:11:11 +10:00
Nils Kneuper
4fbb2a5228 updated Bulgarian translation 2024-04-27 11:48:58 +02:00
Nils Kneuper
c2a4745eec updated French translation 2024-04-27 11:46:41 +02:00
Nils Kneuper
4d952bbe61 updated Norwegian translation 2024-04-27 11:45:32 +02:00
Tahsin Jahin Khalid
ebe5149dbc HttT S16: fix li'sar missing her unrenamable=yes (#8782)
* S16: fix li'sar missing her unrenamable=yes

* S16: add one more instance of unrenamable=yes
2024-04-27 12:59:29 +06:00
Pentarctagon
4dfb946fc8 Add a button to the build info dialog to rerun the migrator. (#8791)
Add-ons: checks for any that exist in the chosen other version but not in the current version.
Preferences: adds attributes that don't exist from the chosen other version's preferences that aren't in the current version's preferences. for attributes that exist in both, use the attributes from the file that was modified most recently.
Credentials: move if the credentials file doesn't exist.

Fixes #7936
2024-04-27 00:51:36 -05:00
Gunter Labes
cfb2ca9fa6
Fallback to commit hash 2024-04-26 23:24:55 +02:00
Jonathan-Kelly
320aa7bf88 SoF S7: fewer and slower enemy outriders
This is to counteract the swifter and deadlier Elvish Outrider after the 1.18 core unit balance changes.

(cherry picked from commit b3802f44ea)
2024-04-26 19:21:08 +02:00
newfrenchy83
fc87104995
Fix EI: Plague Staff Doesn't Gain Arcane Damage When Equipped After Holy Amulet
Fix #8745 by using ability instead of weapon special.
2024-04-24 12:51:45 +02:00
gfgtdf
099b6bb3e0 Fix build with boost 1.85 2024-04-22 17:54:07 -05:00
Steve Cotton
3bf9b0f811 Fix a warning in the sdl2 conftest
The argv variable was unused. The build still succeeded,
but GCC emited a warning about it.

(cherry picked from commit c7acbd243a)
2024-04-22 21:49:59 +02:00
Gunter Labes
39cc21db8e Avoid invalid pointer access on recall
Should fix #8778.

(cherry picked from commit 5ec648a1b2)
2024-04-22 20:58:45 +02:00
Steve Cotton
9632febdb5 Unit test cumulative resistance with a max_value
A surprising result on 1.18, the max_value attributes get added together.

In 1.19, 82499d0785 changes this to something
logical, using `min(each individual max_value)` and disregarding the cumulative
attributes.
2024-04-22 19:28:24 +02:00
Steve Cotton
9b2016a4af Unit test cumulative resistance with a base value
These tests clarify what "cumulative" means for non-leadership abilites,
which since Wesnoth 1.1.3 doesn't seem to fit the English word.

For cumulative abilities, if the base value from the unit is higher that
the ability's value, then the base value is used instead. In the case of
a Skeleton with 40% base resistance, "cumulative=yes" is equivalent to
"value,cumulative=40,no".

In all of these cases, a single ability's value is used; "cumulative"
doesn't mean that the values from multiple abilities interact.

This is all when using value=, not when using add= or sub=.
2024-04-22 19:28:24 +02:00
gfgtdf
5327400b96 fix linger mode when ending the scenario in end_turn event
I am not really sure whether this is actually needed or whether it
actually worked before for some other reason, in any case the new
code is simpler and safer.

Backport, fixes #8779
2024-04-20 23:45:37 +02:00
Nils Kneuper
b426ae92a5 updated Russian translation 2024-04-20 15:45:34 +02:00
Nils Kneuper
f53dbc0b58 updated French translation 2024-04-20 15:44:18 +02:00
Nils Kneuper
e6b00ad9f1 updated Bengali translation 2024-04-20 15:42:59 +02:00
Wedge009
7e802aab98 Revert "Disable the Windows CI builds"
This reverts commit ac5f821729.

(cherry picked from commit 2c04c274fa)
2024-04-20 19:14:32 +10:00
Gunter Labes
cb2b850c01 Fix scons SDL version check
0aa8dc3 converted to a runtime test and broke the scons SDL version check since
it only links which trivially makes it work for cross compilation though.
2024-04-18 06:43:21 +02:00
Dalas121
b91e5e2343 EI S12: prevent ogres from saying the final goodbye in "Evacuation" (#8761)
(cherry picked from commit 3dadec9cac)
2024-04-16 10:20:41 +10:00
pentarctagon
4dfd2903c9 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:59:04 -05:00
Wedge009
2f57b412b6 Check log file actually exists before enabling Log File button (#8727)
* Check log file actually exists before enabling Log File button. Resolves #8691.

* Return empty string if output file path is empty.

(cherry picked from commit c62fd51f48)
2024-04-14 16:57:19 +10:00
Charles Dang
f90af33be4 Pardon the erroneous comment
(cherry picked from commit c07d5438c7)
2024-04-14 16:57:19 +10:00
Charles Dang
a3c1bc17cc Fix idle anim rate not being saved properly (fixes #8613)
(cherry picked from commit cd6f3fade7)
2024-04-14 16:57:19 +10:00
Nils Kneuper
d39ceb1aa3 updated Czech translation 2024-04-13 11:35:04 +02:00
Nils Kneuper
b8b1972ccf updated Slovak translation 2024-04-13 11:32:30 +02:00
Nils Kneuper
6d7eb170e3 updated Ukrainian translation 2024-04-13 11:31:27 +02:00
Gunter Labes
dbc3265794
Allow git describe to fail 2024-04-11 14:16:38 +02:00
Dalas121
f884868f2a EI: remove duplicate AMLAs (#8723)
Under some circumstances, units in EI could have their custom AMLAs listed multiple times in the advancement dialog.
2024-04-09 18:54:03 -05:00
Dalas121
f2c1ca464e EI: preserve XP when Dacyn receives scripted advancements (#8716)
* EI: retain experience when Dacyn advances to twilight mage
* EI: retain experience when Dacyn advances to fallen mage
2024-04-09 18:46:38 -05:00
Dalas121
b501342d3e EI: reduce Barrow/Pyre Wight vulnerability to arcane (#8715)
* Update Undead_Horse_Barrow_Wight.cfg arcane resist
* Update Undead_Horse_Pyre_Wight.cfg arcane resist
2024-04-09 18:25:05 -05:00
Gunter Labes
a9642e41f6
Fix mismatch between what gettext.w.o and wesnoth consider core textdomains
wesnoth-anl is pretty much an extraction of wesnoth-multiplayer which is core.
2024-04-09 21:14:08 +02:00
Steve Cotton
26ead85914 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.
2024-04-09 14:07:53 +02:00
Steve Cotton
37af71bd65 updated German translation 2024-04-07 21:52:20 +02:00
Steve Cotton
f9af941f1e Fix clicking on the sidebar going to the wrong trait
If the first trait of a unit has no name, then clicking on the units (other)
trait in the sidebar opened the wrong page in the help.
2024-04-07 08:05:30 +02:00
Steve Cotton
3ac1b686e8 Disable the Windows CI builds
Setting up vcpkg tries to build xz from source, which fails because the
entire xz repo has now been made private or taken down. The vcpkg team
have been advised not to switch to an alternative repo [1], so for now
our Windows builds will always fail.

Turn those builds off, so that we don't get familiar with seeing red
status markers on all PR's CI results.

[1] `https://github.com/microsoft/vcpkg/pull/37957` - second comment is
the vcpkg team's "We have been explicitly asked by security folks to not
change the upstream [to a different repo] for liblzma at this time."
2024-04-07 07:47:37 +02:00
Nils Kneuper
8ade92b096 updated Finnish translation 2024-04-06 15:07:11 +02:00
Nils Kneuper
4c5ff69b95 updated Ukrainian translation 2024-04-06 15:04:23 +02:00
Nils Kneuper
3cb4cc7d28 updated Bengali translation 2024-04-06 15:01:47 +02:00
Nils Kneuper
d23e0bd7bb updated Arabic translation 2024-04-06 15:00:49 +02:00
Steve Cotton
78dbf2d309 update German translation
s1m0n was in the credits for 1.16, but that was missed when his contributions
were copied to master. Fix that, along with adding his latest updates.

The fuzzy flag in -wof probably got readded by mistake when rebasing.
2024-04-06 11:27:21 +02:00
pentarctagon
f40e821c7b Add another query to the MP Activity Report queries
count by map and era
2024-04-04 14:54:59 -05:00
newfrenchy83
233295c35b
EI: Barrow Wight resistance against mixed damage type weapons
The Barrow Wight has the Shroud ability: "When defending, this unit has 50%
Fire and Arcane resistance." However, if the attack's original damage type
isn't Fire or Arcane, the Shroud ability fails to trigger. The Barrow Wight
takes massive Arcane damage (50% weakness) when defending against such attacks.

Because this is the stable branch, the API can't fix the root cause, which is
that ability filters don't consider the weapon's alternative damage type. This
adds tests to verify that the API still works as before, but changes the items
in EI that give units alternative damage types.
2024-04-04 14:15:14 +02:00
Wedge009
49d586a537 Revert "EI - show custom traits in help menu (#8652)"
This reverts commit 04d29f4e3b.
2024-04-03 16:12:45 +11:00
Subhraman Sarkar
6b1ccd9761 change horizontal scrollbar mode and update changelog
(cherry picked from commit 333b3edc42)
2024-04-03 13:03:39 +11:00
Subhraman Sarkar
3dae9a89cd add changelog and remove achievements dialog changes
(cherry picked from commit d692f6ba12)
2024-04-03 13:03:39 +11:00
Subhraman Sarkar
1a05133de7 scrollbar and height adjustments for achievements dialog
(cherry picked from commit 8c7660ce49)
2024-04-03 13:03:39 +11:00
Subhraman Sarkar
da79275657 fix double scrollbar bug
(cherry picked from commit 90dcf67076)
2024-04-03 13:03:39 +11:00
Dalas121
be306abb44 EI 12_Evacuation.cfg: fix Dacyn's halo not flickering (#8676)
(cherry picked from commit 4dd164e0b0)
2024-04-03 10:47:01 +11:00
Dalas121
ce35bfd13d EI: survivor trait and sentinel shield bugfix (#8667)
* EI: fix sentinel shield + survivor bug #8632
* EI: fix survivor weaponless bug #8633

(cherry picked from commit 4bed0f2666)
2024-04-03 10:47:01 +11:00
Dalas121
04d29f4e3b EI - show custom traits in help menu (#8652)
* EI - add dummy unit file so traits show up in help menu.
* EI - add help_text to traits

(cherry picked from commit 8deaad2b10)
2024-04-03 10:47:01 +11:00
pentarctagon
24082fe594 simplify always true condition a bit 2024-04-02 14:22:58 -05:00
pentarctagon
9682afbc26 reset back to the first tab 2024-04-02 14:22:50 -05:00
pentarctagon
d64cb1b2af Don't duplicate player names per mod used
Currently even though the results ultimately don't display duplicate information for the modifications used, the resultset coming back does have a row per modification and player, so it appears as though the player list is duplicated.

Fixes #8619
2024-04-02 14:22:40 -05:00
Steve Cotton
e4239634e5
[1.18] wmlxgettext: Fix "fix invalid escape sequence"
The original code was probably meant to strip trailing whitespace, which
turned out to be a bug when adce3fe79b
fixed the buggy regexp so that it started working. That has now been
removed.

Fixed handling of multiline plural strings, which was broken too.

One feature has been left unimplemented, and will cause wmlxgettext to error
out. For "long bracketed" strings, Lua allows the contents to start with a
newline, which is automatically stripped from the resulting string. Trying to
understand the original purpose lead me to this feature of Lua strings which we
don't use in Wesnoth; and I finally concluded that, if someone wants to use
that feature, it can be their problem to implement it.

This fixes commit adce3fe79b.
2024-04-02 12:26:17 +02:00
Nils Kneuper
d199f05097 updated Arabic translation 2024-03-31 17:50:05 +02:00
Iris Morelle
8845bb48e9 Update changelog 2024-03-30 18:18:25 -03:00
Iris Morelle
e2d1f924b1 Make the Changelog macOS app menu item more relevant
This changes the URL used for the changelog menu item from using a
direct GitHub file link to the master branch's changelog.md file to
using a https://changelog.wesnoth.org/X.Y.Z link, where X.Y.Z are
specifically the version number used in the macOS bundle's Info.plist
file.

Note that this may result in incorrect links for +dev versions, where
the Changelog link will simply send the user to the page for the
latest release and not the future release. This shouldn't be a problem
though, since people using those builds, especially on macOS, should
really already know where to find the most relevant changelog for the
version they're running -- in their own source tree.
2024-03-30 18:18:25 -03:00
Iris Morelle
3cc79ac681 fs: Replace deprecated Boost.Filesystem symbolic_link_exists()
This function has been deprecated since at least Boost 1.34 (2007).
2024-03-30 18:12:38 -03:00
Steve Cotton
c80fdc2283 Boost tests: run test_without_attribute_filter
It was added in 532d17f958, but
that commit missed adding it to boost_test_schedule.
2024-03-30 19:30:27 +01:00
newfrenchy83
09f465727d
Fix default argument in matches_if_present filters (#8650)
Due to confusion between NULL and std::nullopt, these filters used
zero instead of nullopt as the default value for this argument. However,
the effects are limited to experimental_filter_ability and that tag's _active
sibling, and result in a false positive when the filter matches a value of
zero. With those constraints, I (octalot) am happy to apply it to stable.

This was detected as a compilation error when building with musl libc,
thanks to iFoundSilentHouse for finding and reporting it.
2024-03-30 13:34:35 +01:00
Steve Cotton
f7a0f119de Tutorial S01: Better timing for the hints
No string changes, just adjusting when the hints at the top-left of the screen
appear and disappear.

The hint about crowns now appears after recruiting both elves, so that there
are units to compare the leader to, who have the same orb color but no crown.

The hint about traits appears when told to attack the quintain with the elves.
The player will probably find a strong or dexterous trait, and Delfador already
comments about those traits after attacking. Even if neither elf has those,
speedy or robust could also influence whether to use melee or ranged attacks.

There's now no hint on screen when first choosing which village to use for
healing; previously it was the hint about crowns which didn't seem relevant.
No strings are added in this commit, but a hint about checking the quintain's
movement range would fit here, see <https://r.wesnoth.org/t54644>.
2024-03-29 10:22:48 +01:00
Gunter Labes
4384caf0dd
Keep python 2 compatibility 2024-03-28 17:07:19 +01:00
Steve Cotton
72a102ccd4 updated German translation 2024-03-27 01:00:43 +01:00
Steve Cotton
76f3121b2f updated German translation
All of these are from René.
2024-03-26 14:46:01 +01:00
pentarctagon
d7dfd59910 achievements scrollbar auto 2024-03-26 00:31:43 -05:00
Toom
adce3fe79b fix invalid escape sequence
(cherry picked from commit 4be9aa8584)
2024-03-25 18:26:20 +01:00
Steve Cotton
84ed5488e0 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".
2024-03-25 18:22:27 +01:00
Nils Kneuper
35f5fac39f updated Arabic translation 2024-03-23 22:04:26 +01:00
Nils Kneuper
cdfbed4ea4 updated Bengali translation 2024-03-23 22:02:30 +01:00
pentarctagon
5c5167cba0 fix help portraits scaling too large 2024-03-22 17:45:15 -05:00
pentarctagon
6e625ef091 Attempt to fix data migration for steam
It *appears* that the migration prompt doesn't show up for steam players because steam automatically creates the <userdata>/saves/steam_autocloud.vdf file on start, since the saves folder is what's synced. Since the migration logic is looking for whether the userdata folder exists, this means it always exists when launched from steam.

So, fix that by checking a different subfolder under userdata (checking the logs folder is arbitrary, it could be any of them aside from the saves folder).
2024-03-22 17:45:08 -05:00
pentarctagon
cab17d16e8 logs these, since normalize_path can return an empty string 2024-03-22 17:41:15 -05:00
Gunter Labes
c2e9eab6c4
1.17 is deactivated 2024-03-22 22:27:27 +01:00
newfrenchy83
c6589a78b7 [1.18]fix shema validation for overwrite_specials
some weapon special can use overwrite_specials but i forget to put it in shema validation
2024-03-22 17:09:15 +01:00
loonycyborg
439c43a59e
Adjust itchio command for stable branch 2024-03-22 07:59:34 +03:00
pentarctagon
c4bc379411 Update appdata screenshots. 2024-03-21 18:28:53 -05:00
Iris Morelle
d1d60728a1
wesmere: Bump CSS version 2024-03-21 18:39:45 -03:00
Iris Morelle
1c94648dd5
wesmere: Use the correct version of jQuery 2024-03-21 18:39:38 -03:00
Iris Morelle
62641e9ed0
wesmere: Remove Google Fonts requirement 2024-03-21 18:39:32 -03:00
Gunter Labes
9a92c81fae
Add missing newline 2024-03-19 20:31:45 +01:00
Gunter Labes
0edc2b9ae4
Use unique flatpak branch name to allow parallel installation
Also use --jobs and simplify manifest adjustment.
2024-03-19 19:42:41 +01:00
Martin Hrubý (hrubymar10)
ebb1a2fea1
Fix macOS saves directory 2024-03-18 21:50:27 +01:00
pentarctagon
8051d9f8fe final 1.16 changelog update 2024-03-17 20:55:43 -05:00
pentarctagon
579a1314ae 1.18.0+dev 2024-03-17 19:14:02 -05:00
pentarctagon
8ba2b3ebd3 1.18.0 2024-03-17 19:11:38 -05:00
pentarctagon
ace2c8c9bc pot-update and regenerate doc files 2024-03-17 19:11:03 -05:00
pentarctagon
629f176fe5 changelog_entries 2024-03-17 19:07:02 -05:00
pentarctagon
4ad9ccbe38 Revert "Revert "Accept all 1.18 versions by default""
This reverts commit 6add53c677.
2024-03-17 19:03:22 -05:00
Severin Glöckner
b6f55dfbbb German translation: rename units 2024-03-17 23:06:36 +01:00
pentarctagon
6add53c677 Revert "Accept all 1.18 versions by default"
This reverts commit 5471d3cb98.
2024-03-17 15:31:17 -05:00
Nils Kneuper
4c29c98a6c updated Finnish translation 2024-03-17 20:20:42 +01:00
Nils Kneuper
54e0785f9d updated Dutch translation 2024-03-17 20:19:29 +01:00
Nils Kneuper
99b3e141f0 updated Chinese (Traditional) translation 2024-03-17 20:17:48 +01:00
Jonathan-Kelly
51e8f01627 WoF S11: tweak enemy gold
Testing by effectively droiding the player's side, the enemy side still lost even with 480 gold and otherwise default difficulty settings. So upping enemy side gold to 480 for all difficulty levels.
2024-03-17 14:11:30 -05:00
pentarctagon
530e042c97 Add an environment variable to disable logging to file
Fixes #8527
2024-03-17 12:26:01 -05:00
Gunter Labes
5471d3cb98
Accept all 1.18 versions by default 2024-03-17 14:09:32 +01:00
Iris Morelle
bd9677e597 Fix "implicit conversion turns floating-point number into integer" warnings
Found with Xcode 15.3:

  /Users/iris/Projects/wesnoth/src/game_config.cpp:551:18 Implicit conversion turns floating-point number into integer: 'double' to 'const int'
2024-03-17 00:40:07 +01:00
Hejnewar
ead20e4a17
Improve default settings for the timer
Action bonus - is often thought as inconsisnent and generally not very well understood not only by new players but aslo by players with mid tier experience, so removing it from initial setting should improve overall experience of a new player.
Turn bonus - 60 seconds is way too low and initial 270 is also not much for the whole game. 240/240 does better job at keeping the game in good pace while not being too opressive in my opinion, 360 reserve is aslo ok if you can save some time for more intensive turns.
2024-03-17 00:12:20 +01:00
Steve Cotton
a86fca0d01 updated German translation 2024-03-17 00:03:25 +01:00
Nils Kneuper
f53be636ba updated copyrights file for change Italian image translation 2024-03-16 17:02:17 +01:00
Nils Kneuper
2be2adec99 updated French translation 2024-03-16 16:55:03 +01:00
Nils Kneuper
1a0de0e4b2 updated Italian translation (incl. image changes) 2024-03-16 16:50:35 +01:00
Subhraman Sarkar
2b9ed47080 MP: Aethermaw: Update images with their 1.18 variants 2024-03-16 16:36:55 +01:00
pentarctagon
6d7fd11dab add secondary_authors to pbl schema 2024-03-16 01:26:44 -05:00
Iris Morelle
013b373541 Update changelog 2024-03-16 00:13:27 -03:00
Iris Morelle
7571420b3b gui/unit_recruit: Add unit type level number as a filtering criterion
The Recall dialog already did this, but Recruit did not.
2024-03-16 00:13:27 -03:00
Iris Morelle
0692916f73 gui/unit_recruit: Add alignment and race hints for filtering
This adds the human-readable version of each unit's alignment and
their (gendered) race name and plural race name as hints for the
filter box functionality, so that players can enter keywords such as
"liminal", "dwarves", "mermaid" and get what they expect even if those
words are not literally part of the unit type names.
2024-03-16 00:13:27 -03:00
Iris Morelle
032ee9ca18 gui/unit_recruit: Restructure filter criteria checks
This makes it easier to add any number of text criteria for filtering
without making the conditional increasingly unwieldy. Criteria that
shouldn't count because of conditions disabling them (such as the unit
type id only being considered when debug mode is eanbled) can just
become empty strings which will never match.
2024-03-16 00:13:27 -03:00
Iris Morelle
087faa728e gui/unit_recall: Add alignment and race hints for filtering
This adds the human-readable version of each unit's alignment and
their (gendered) race name and plural race name as hints for the
filter box functionality, so that players can enter keywords such as
"liminal", "dwarves", "mermaid" and get what they expect even if those
words are not literally part of the unit type names.
2024-03-16 00:13:27 -03:00
Nils Kneuper
119595fffe updated Polish translation 2024-03-15 20:59:59 +01:00
Jonathan-Kelly
58c53f9822 WoF S11: more enemy gold 2024-03-15 14:53:09 -05:00
Jonathan-Kelly
00a0552c18 WoF S10: smaller enemy waves 2024-03-15 14:53:09 -05:00
Jonathan-Kelly
4fd13e5145 WoF S9: yet more yetis 2024-03-15 14:53:09 -05:00
Jonathan-Kelly
b039c67200 WoF S7: slightly weaken guards 2024-03-15 14:53:09 -05:00
Jonathan-Kelly
86d459fc60 WoF S6: minor income consistency 2024-03-15 14:53:09 -05:00
Jonathan-Kelly
c750e78d6b WoF: adjust music 2024-03-15 14:53:09 -05:00
Iris Morelle
e33c8a3f3c 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-14 23:51:44 -04:00
Iris Morelle
860a760263 addon: Add getters for the server identification 2024-03-14 23:51:44 -04:00
pentarctagon
7ee7d59e96 fix tags and secondary_author for pbl editor 2024-03-14 22:05:41 -05:00
pentarctagon
055b0d72fc validate addon name when first entered as well 2024-03-14 22:05:32 -05:00
Jonathan-Kelly
ae3bb1331f WoF S9: move crannog village in from map edge
Two other maps and one other scenario which depict the same region get corresponding tweaks.

(cherry picked from commit a3a785f27b)
2024-03-15 08:45:03 +11:00
Gunter Labes
4ecb10731d
Fix indentation 2024-03-14 19:46:36 +01:00
Gunter Labes
4376f1c8cd
Set distribution channel for flatpak 2024-03-14 19:46:01 +01:00
Wedge009
abf559712a SotA S16: Keep Crelanu within his ring of protective holy waters. Resolves #8361.
Changelog added after cherry-picking.

(cherry picked from commit d106238410)
2024-03-13 13:26:33 +01:00
Iris Morelle
350437ebf7 Add -Wno-shorten-64-to-32 to compiler flags in Xcode
This is necessary with Xcode 15.3 to avoid about 750 warnings across
all of the codebase regarding "Implicit conversion loses integer
precision", most of which apply in cases where theoretical limits are
involved because of conversions from unsigned 64-bit integers (usually
size_t) to signed 32-bit (int).

Ideally we want to address these warnings, but given how many of them
there are all over the place this is not something that can reasonably
be done in such short notice before Wesnoth 1.18.0 is released, and in
the meantime they make the compiler output with Xcode unnecessarily
noisy and completely bury any relevant warnings from actual code
changes. In the meantime, this is best for productivity until we can
get to a place where we can fix all of them and force using
-Wshorten-64-to-32 for all platforms in CI.
2024-03-13 13:15:34 +01:00
Severin Glöckner
0808e89f27 ANL: swap order of events
This keeps village destrution events adjacent,
the events will also appear in order of id.

[ci skip]
2024-03-11 19:33:40 +01:00
Severin Glöckner
1de3ff043b ANL: make destruction events removable
[ci skip]
2024-03-11 14:38:49 +01:00
doofus-01
e4992dd518 minor cleanup of theme font macro (backport) 2024-03-10 14:07:26 -04:00
pentarctagon
cdf77c8bb7 fix accidental conditional inversion
fixes #8525
fixes #8524
2024-03-10 12:12:32 -05:00
newfrenchy83
90fe48ea18 [1.18]Fix Ambush Ability Does not Work in Bluff/Glutch Forest Terrain
Fix https://github.com/wesnoth/wesnoth/issues/8512 issue in 1.18
2024-03-09 12:32:17 -06:00
Nils Kneuper
70dd7d8f02 updated Czech translation 2024-03-09 15:07:39 +01:00
Subhraman Sarkar
8b58dbc07f Bengali logo for Wesnoth and enable bn image assets
* wesnoth logo localized to bengali
* update copyright

(cherry picked from commit 95c62173a3)

Enabling the image assets is
(cherry picked as commit f5ebda0996)
2024-03-09 11:43:34 +01:00
Iris Morelle
019c5352c2
wesmere: Death to the trailing stops in the site footer 2024-03-09 07:13:23 -03:00
Severin Glöckner
9b79c92acd ANL: make main events removable
[ci skip]
2024-03-09 01:49:02 +01:00
Nils Kneuper
3599083eb4 updated Chinese (Traditional) translation 2024-03-08 23:33:55 +01:00
Nils Kneuper
4977eb9d8c updated Japanese translation 2024-03-08 23:32:21 +01:00
Nils Kneuper
8f67d90767 updated French translation 2024-03-08 23:31:20 +01:00
Nils Kneuper
be9c2a9d38 updated Bengali translation 2024-03-08 23:30:23 +01:00
Nils Kneuper
62efe11705 updated Polish translation 2024-03-08 23:26:57 +01:00
gfgtdf
7422b02ab5 Fix #8460 [effect] apply_to=variation (#8475)
* Fix #8460 [effect] apply_to=variation

Previously the code could apply the variation effects
last, so that codes like
```
[effect]
  apply_to=variation
  ..
[/effect]
[effect]
  apply_to=hitpoints
  heal_full=yes
[/effect]
```
Would not set the unit hitpoints to the new variations
hitpoints because the variation effect was applied after
the healing effect.

In 1.16 this worked because healing was applied a little
too often but that lead also to bugs like #8342

* f prev

* f prev

* f prev

* f prev

* f prev

* Create modification_effect_type_variation.cfg

* Update wml_test_schedule
2024-03-08 12:54:11 -06:00
pentarctagon
a1c0f60524 Make sure animations are skipped when skipping animations in replays
Fixes #8227
2024-03-08 12:50:10 -06:00
Michal Fusatý
a70f1d0ced Adding myself to credits (#8470)
Based on https://wiki.wesnoth.org/SlovakTranslation
2024-03-08 12:49:57 -06:00
Steve Cotton
6797db582c updated German translation 2024-03-08 08:23:55 +01:00
Iris Morelle
d6a8c98211 EI: Bind translatable strings to wesnoth-units
Barrow Wight's definition includes a couple of attack name strings
from the wesnoth-units textdomain bound to wesnoth-ei by default
instead, which creates two unnecessary extra strings for translators
to translate. This change fixes this by binding these two strings to
wesnoth-units so their existing translations can be used.

(Pyre Wight does not require this change since it already uses the
wesnoth-units textdomain for the single attack name it uses.)
2024-03-07 15:13:19 +01:00
Steve Cotton
42822ac374 wmllint: drop the rule about [campaign]rank= being a multiple of 5
The idea of using multiples of 5 seems like a way to avoid having to change
multiple campaigns' ranks at once, because it leaves space to rearrange a
mainline campaign between two other campaigns.

But enforcing "it must be a multiple of 5, even if that means changing other
campaigns" loses the advantage of using multiples. For example, WoF currently
has rank=152, which triggers the warning, which has caused a PR to be opened
that changes WoF, SoF, LoW and SotA - because keeping them in order requires
four campaigns to change.
2024-03-06 08:58:25 +01:00
pentarctagon
de65fad72e use the currently selected map's path when opening a new file
currently the editor defaults to its maps directory even when you open a map file somewhere without it being in an "add-on", for example opening a map in a mainline campaign's maps folder.
2024-03-05 19:54:56 -06:00
Jonathan-Kelly
37150b4e22 WoF S11: fix wmllint error by reorganizing side 2
Since wmllint gets confused if a side's contained [ai] block comes after any of its contained [unit] blocks. This refactor should make the side 2 code block more human readable too.
2024-03-05 17:04:33 +01:00
Iris Morelle
db30ca53ae
gui/outro: New clock-based timing logic for the text fading (#8454)
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.

I for one hope players wouldn't be running Wesnoth for that long
anyway. The game isn't exciting enough to justify it.
2024-03-05 08:21:55 +01:00
Steve Cotton
43dd442a4f update German translation 2024-03-04 16:14:30 +01:00
Steve Cotton
4fc7906f3e updated German translation 2024-03-03 14:32:35 +01:00
Nils Kneuper
60a9ac8f6d updated British English translation 2024-03-03 09:17:56 +01:00
pentarctagon
95bf03f357 pot update 2024-03-02 16:46:47 -06:00
Nils Kneuper
9153d704ae updated Japanese translation 2024-03-02 23:42:41 +01:00
Steve Cotton
fa353495d3 Mark a translated string as fuzzy
The markup in it isn't parsing, which is causing CI builds to fail.
2024-03-02 21:13:20 +01:00
Nils Kneuper
0fdd140b62 updated Japanese translation 2024-03-02 14:51:21 +01:00
Nils Kneuper
660c982f1e updated French translation 2024-03-02 14:49:56 +01:00
Nils Kneuper
caac0c0b83 updated Spanish translation 2024-03-02 14:48:48 +01:00
Jonathan-Kelly
bac29601fa WoF: add wmllint 'skip-side' magic comments 2024-03-01 20:08:16 -05:00
Jonathan-Kelly
827b3950e8 WoF: fix wrongly capitalized variable name 2024-03-01 20:08:16 -05:00
Steve Cotton
fb758041ca Use missing_mandatory_wml_tag instead of extra translatable strings
The logic is that the strings included the names of WML tags, but
weren't clear that they were WML tags, and so the tag names are
being translated.

This reverts almost all of the string changes of PR #7600, which
were in commit f5be4cffb7, as well
as a few similar strings which weren't in 1.16.x.
2024-03-02 00:04:32 +01:00
Steve Cotton
8660561ad9 Multiplayer: Add a po hint about "Matchmaking" 2024-03-01 22:38:35 +01:00
Steve Cotton
7ac222916a DM S18: Add a po hint about grammatical tense of some text 2024-03-01 22:36:37 +01:00
pentarctagon
f620e21c12 The method is static, but these variables can't be.
static variables are only initialized the first time they are encountered, even if they are only defined in the body of the method. therefore their value here is set to the first language used when this method is called, but won't change later if the language changes because they've already been initialized.

Fixes #8393

(cherry picked from commit ef972bb0a0)
2024-03-01 14:08:07 +01:00
pentarctagon
79973dc787 more copyright updates 2024-02-29 09:47:47 -06:00
Celtic Minstrel
612224c54e [LuaDoc] Use an alias for a sync function and declare every possible call form with @overload instead of specifying optional parameters 2024-02-29 09:18:42 -05:00
Celtic Minstrel
b71b97b468 [LuaDoc] Declare terrain_map index-by-location operator 2024-02-29 09:18:39 -05:00
Steve Cotton
2c01b8e69b Update German translation
wesnoth-lib and wesnoth-editor from Sobek
2024-02-29 14:47:27 +01:00
pentarctagon
1d693d324c add graph 2024-02-29 00:00:58 -06:00
Wedge009
718b3e5c68 Set gold laurel first in case of only one difficulty setting.
Also use dense formatting as per existing code.

(cherry picked from commit 1c78750176)
2024-02-28 14:07:41 +11:00
Wedge009
45b8e936ca Remove spurious if condition.
(cherry picked from commit c25321b713)
2024-02-28 14:07:41 +11:00
Wedge009
13c0fa6391 Keep laurel decorations consistent with difficulty level (resolves #8442).
(cherry picked from commit a84561390a)
2024-02-28 14:07:41 +11:00
pentarctagon
b853e9e10c update text post logging fix 2024-02-27 10:41:53 -06:00
newfrenchy83
4ed1d509dc
update list of boost headers used in compilation 2024-02-27 16:40:11 +01:00
pentarctagon
a32a698ca2 and backport this.. 2024-02-26 12:31:36 -06:00
Celtic Minstrel
bbe353c8dd [Lua] Fix obviously broken functions in ai_helper.
These functions are not used anywhere, and they have other issues besides the one fixed in this commit – they're implied to return all moves, but they only return one move for each possibly destination hex. However, this will make them at least be minimally usable.
2024-02-26 13:19:55 -05:00
Celtic Minstrel
7a83817989 [Lua] Remove nonexistent parameter 2024-02-26 13:19:55 -05:00
Celtic Minstrel
da12e97bca [Lua] Suppress nodiscard warning 2024-02-26 13:19:55 -05:00
Celtic Minstrel
652f98792e [Lua] Fix incorrect function name 2024-02-26 13:19:55 -05:00
Celtic Minstrel
3ac99d1d86 [Lua] Fix missing parameter warning when passing empty filter 2024-02-26 13:19:55 -05:00
Celtic Minstrel
7f5c687196 [Lua] Avoid reusing no-longer-needed variables for different meanings
This raises Lua warnings about mismatched types
2024-02-26 13:19:55 -05:00
Celtic Minstrel
a9e4a3cce8 [Lua] Fix call of nonexistent function 2024-02-26 13:19:55 -05:00
Rafael Fillipe Silva
92b8a8cb00 add scons rules do detect boost-graph
Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:17:20 -06:00
Rafael Fillipe Silva
3110a1762c add boost-graph dependency to codeql workflow
Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:17:11 -06:00
Rafael Fillipe Silva
510167b26c add tests for link cycle validation
Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:17:04 -06:00
Rafael Fillipe Silva
41dfd886c7 implement cycle detection for type aliases (links)
Since the detection happens after loading the config tree, it is necessary to expose the links and subtypes of the types alias and composite, respectively.

This implementation builds a graph of all links to detect cycles, ignoring all other types.

To handle links in elements of lists, all subtypes of composite types are visited, keeping the type name of the parent composite type.

Signed-off-by: Rafael Fillipe Silva <rfsc.mori@gmail.com>
2024-02-26 10:16:58 -06:00
Rafael Fillipe Silva
b7797864d6 format changes related super mandatory keys validation with clang-format 2024-02-26 10:16:49 -06:00
Rafael Fillipe Silva
4738455f14 add tests for mandatory key validations considering super tags 2024-02-26 10:16:42 -06:00
Rafael Fillipe Silva
7a769a9d2c verify if all mandatory keys are specified, including the ones from the super tags
This pattern presents the same infinite loop issue as the find_key and find_tag calls on wml_tag. The solution is the same, to use a helper to keep track of the already seen tags and stop when a cycle is detected.
2024-02-26 10:16:35 -06:00
Rafael Fillipe Silva
40fad78f5c add tests to missing super detection 2024-02-26 10:16:28 -06:00
Rafael Fillipe Silva
8f856bf05d detect when a super defined in the schema doesn't exist
Note that this is only detected if the tag referencing the missing super is used in a .cfg file. The super element itself doesn't need to be used for the detection to work.

The schema self validator should already catch this, but it deserves a warning of its own as the schema self validator can be disabled.
2024-02-26 10:16:20 -06:00
Rafael Fillipe Silva
5b0d72c9ca add tests to cover super cycle detection while validating a .cfg file 2024-02-26 10:16:13 -06:00
Rafael Fillipe Silva
e419eb903c detect schema super cycles while validating a .cfg file
Note that if the .cfg file does not use the tags that causes a cycle, those won't be detected.

This change exposes the super_refs_ so the schema validator does not need to reinvent wml_tag::expand when detecting super cycles.

The super dependency graph is built during the validation of each tag, finishing and reporting cycles at the end of the root tag.
2024-02-26 10:16:06 -06:00
Rafael Fillipe Silva
d13c2cc47a add the super's full path to the tag's super_list
This allows for better diagonistic when the specified super doesn't exist and when super cycles are detected.
2024-02-26 10:15:59 -06:00
Rafael Fillipe Silva
52b7c2e428 add a test to cover the fix to find_key's infinite loop/crash
Adds a test with a schema example containing a super cycle and a .cfg file containing an unknown key to this schema. Previously, this would cause an infinite loop or crash. Now an exception for invalid key should be thrown.
2024-02-26 10:15:52 -06:00
Rafael Fillipe Silva
ae13828cfd handle super cycles while searching for a key or for a tag
A super cycle may be found during the validation, leading to an infinite loop. For example, calling find_key on an unknown key defined in the .cfg file may trigger this behavior if a cycle exists.

To handle this, a new version of these functions was introduced, keeping the original in the class' private scope. During the search there is a bookkeeping helper that will cause the routine to return nullptr if the search goes back to the initial tag context.
2024-02-26 10:15:45 -06:00
Rafael Fillipe Silva
dd1d7e3ca7 fix wml_tag::iterator CRTP parameter
Forwards the Map type parameter instead of defaulting to `std::map<string, T>`.
2024-02-26 10:15:37 -06:00
Rafael Fillipe Silva
526a09df2a add tests for super cycle detection on schema self validator
Add test for the already existing validation where a tag shouldn't set itself as its own super.

Add test for the new cycle detection when validating a schema.
2024-02-26 10:15:27 -06:00
Rafael Fillipe Silva
dba52e903c implement super cycle detection for the schema self validator
The super tag dependency forms a directed graph. Boost Graph's depth first search implementation was used with a back edge detector to find the cycles.

This is a preparation for enumerating all keys that a tag can use, including the keys from the super tags. If cycles aren't handled, it is impossible to validate mandatory keys without entering an infinite loop.
2024-02-26 10:15:19 -06:00
Steve Cotton
6bfd776157 HttT S06: Make Elensefar's defenses look damaged by the Orcish siege
Just some debris embellishments to suggest that the towers at the
end of the bridges were hit with siege weapons. The defense stats
are still the same and there's no dialogue change to go with this.

(cherry picked from commit b9cb577bac)
2024-02-26 13:13:45 +01:00
Nils Kneuper
8ba1eb84b4 use correct font file instead whatever it was before... 2024-02-26 08:37:40 +01:00
pentarctagon
d24f75e8f4 Multiply help portait scaling by the pixel multiplier.
Fixes #8275
2024-02-26 00:27:55 -06:00
pentarctagon
523467c40b looks like this never got updated 2024-02-25 21:10:15 -06:00
doofus-01
fe5f4556e5
skeletal rider and alternative bear portraits (backport #8453) (#8458)
* adding skeletal rider and alternative bear portraits (backport #8453)
2024-02-25 15:15:42 -08:00
pentarctagon
cb6fb85fe1 update steam runtime 2024-02-25 13:02:48 -06:00
pentarctagon
1aa56c01a3 Revert d4b7064904
Fixes #8401
2024-02-25 10:30:47 -06:00
Iris Morelle
c64777433a HttT S5b: Fix duplicate loyal trait for Delurin
NAMED_LOYAL_UNIT has the loyal trait built in, so this results in an
extra copy of it being granted to the unit.
2024-02-25 18:46:59 +11:00
Nils Kneuper
918431dce9 Added new font "Lohit-Bengali.ttf" to support Bengali translation 2024-02-24 19:30:37 +01:00
Nils Kneuper
83fc5a0c56 add "noconvert" flag to Bengali translator name 2024-02-24 16:23:32 +01:00
Nils Kneuper
40fc9a8be7 updated French translation 2024-02-24 15:10:18 +01:00
Nils Kneuper
2d7fc054dd updated British English translation 2024-02-24 15:09:09 +01:00
Nils Kneuper
9e8ede348f updated Bengali translation, activated in credits
This introduces a new string for the translation!
2024-02-24 15:07:48 +01:00
pentarctagon
55e141313f bump again 2024-02-23 15:11:16 -06:00
Gunter Labes
3e8f352e2d
Fix logic mistake from the refactor in f8bd32e 2024-02-22 14:10:06 +01:00
Gunter Labes
6d052aa72e
Add copyright job to notification 2024-02-22 10:48:35 +01:00
Gunter Labes
77ad4bb1be
Update used actions to avoid deprecated Node.js 16 2024-02-21 20:19:16 +01:00
pentarctagon
e115745125 change default client keepslive timeout to 20 seconds 2024-02-21 13:16:31 -06:00
Gunter Labes
cc7dda2ba0
Fix logic mistake from the refactor in f8bd32e 2024-02-21 14:48:09 +01:00
Wedge009
f719ae8fc9 Bat images were moved from undead directory to bats in #6655.
(cherry picked from commit a59c32f9e2)
2024-02-21 11:15:01 +11:00
Wedge009
2c56a58a42 Saurian Prophet/Seer portrait was converted from PNG to WebP.
[ci skip]

(cherry picked from commit b334f6707b)
2024-02-21 11:15:00 +11:00
Gunter Labes
1095bf104d
Update CI branch name configuration value for 1.18
Also update used actions to avoid deprecated Node.js 16.
2024-02-21 01:05:07 +01:00
Steve Cotton
982d264094 Update German translation 2024-02-20 12:14:55 +01:00
pentarctagon
4906f3cc7a 1.17.26+dev 2024-02-19 21:10:15 -06:00
21892 changed files with 475282 additions and 594238 deletions

View file

@ -1,4 +0,0 @@
---
Checks: '-*,modernize-use-nullptr,performance-unnecessary-value-param'
WarningsAsErrors: true
...

View file

@ -13,7 +13,3 @@ indent_size = 4
[*.{cpp,hpp}]
indent_style = tab
indent_size = 4
[*.lua]
indent_style = tab
indent_size = 4

View file

@ -1,5 +1,5 @@
name: Bug Report
description: Create a bug report to help us improve the game.
description: Create a report to help us improve the game.
labels: ['Bug']
body:
@ -8,11 +8,17 @@ body:
attributes:
label: Game and System Information
description: |
- What version of the game are you running? (If you built wesnoth yourself, mention the exact commit)
- What version of the game are you running?
- Where did you download it from? (Steam, Mac App Store, our website, built from source, etc.)
- If you're using a custom build, what compiler did you use, and what commit did you build at?
- What OS are you running?
value: |
- **Version:**
- **Downloaded from:**
- **Build info:**
- **OS:**
validations:
required: true
- type: textarea
id: description

View file

@ -2,16 +2,16 @@ name: CI
on:
push:
branches: [ master ]
branches: [ 1.18 ]
pull_request:
branches: [ master ]
branches: [ 1.18 ]
workflow_dispatch:
jobs:
checks: # checks that don't need a wesnoth binary
runs-on: ubuntu-latest
container:
image: wesnoth/wesnoth:2404-master
image: wesnoth/wesnoth:2204-master
options: --tty # docker create options
env:
CLICOLOR_FORCE: 1
@ -31,9 +31,6 @@ jobs:
- name: Whitespace and WML indentation check
if: success() || failure()
run: ./utils/CI/fix_whitespace.sh; git status; git diff --exit-code
- name: WML missing images check
if: success() || failure()
run: utils/CI/check_wml_images.sh
- name: Run luacheck
if: success() || failure()
run: luacheck .
@ -41,12 +38,12 @@ jobs:
if: success() || failure()
run: doxygen doc/doxygen/Doxyfile
copyright: # check takes a bit longer and does not need to run in docker (sound/music only)
copyright: # check takes a bit longer and does not need to run in docker
runs-on: ubuntu-latest
steps:
- { uses: actions/checkout@v4, with: { fetch-depth: 50 } }
- name: Sound/Music copyright check
- name: Copyright check
run: ./update_copyrights
ubuntu:
@ -54,20 +51,18 @@ jobs:
fail-fast: false
matrix:
include:
# the check for WML tests below may need to be adjusted if configurations are changed
- { cfg: debug, tool: scons, cc: gcc, cxx: g++, std: 17, lto: false, sys_lua: false }
- { cfg: release, tool: cmake, cc: gcc, cxx: g++, std: 20, lto: true, sys_lua: false }
- { cfg: release, tool: cmake, cc: clang, cxx: clang++, std: 17, lto: true, sys_lua: true }
- { tool: scons, cc: gcc, cxx: g++, cfg: debug, lto: false, sys_lua: false }
- { tool: cmake, cc: clang, cxx: clang++, cfg: release, lto: true, sys_lua: true }
runs-on: ubuntu-latest
container:
image: wesnoth/wesnoth:2404-master
image: wesnoth/wesnoth:2204-master
options: --tty # docker create options
env:
TOOL: ${{ matrix.tool }}
CFG: ${{ matrix.cfg }}
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CXX_STD: ${{ matrix.std }}
CXX_STD: 17
LTO: ${{ matrix.lto }}
SYS_LUA: ${{ matrix.sys_lua }}
CLICOLOR_FORCE: 1
@ -90,15 +85,10 @@ jobs:
scons "$@" build="$CFG" ctool="$CC" cxxtool="$CXX" cxx_std="$CXX_STD" \
extra_flags_config="-pipe" forum_user_handler=true \
nls=false enable_lto="$LTO" system_lua="$SYS_LUA" force_color=true \
jobs=2 --debug=time glibcxx_debug=true glibcxx_assertions=true compile_db=true
jobs=2 --debug=time glibcxx_debug=true glibcxx_assertions=true
}
build strict=true wesnoth boost_unit_tests
build cdb
# disable all warnings since we have coverage on them in a standard build, and clang-tidy
# triggers false positive compiler warnings that clang itself won't
run-clang-tidy -quiet -use-color -j 2 -extra-arg="-w" -warnings-as-errors='*' '^(?!.*src/modules/|.*build/)'
apt remove -y -qq libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
build strict=false wesnothd campaignd
@ -109,7 +99,7 @@ jobs:
cmake "$@" -DCMAKE_BUILD_TYPE="$CFG" -DCXX_STD="$CXX_STD" \
-DEXTRA_FLAGS_CONFIG="-pipe" -DENABLE_MYSQL=true \
-DENABLE_NLS=false -DENABLE_LTO="$LTO" -DFORCE_COLOR_OUTPUT=true -DLTO_JOBS=2 \
-DENABLE_SYSTEM_LUA="$SYS_LUA -DCLANG_TIDY=true" .
-DENABLE_SYSTEM_LUA="$SYS_LUA" .
}
rm -R /usr/local/lib/cmake
rm /usr/local/lib/libboost*
@ -128,27 +118,19 @@ jobs:
if: success() || steps.build.outcome == 'success'
run: |
./wesnoth --version
for opt in data userdata usercache
for opt in config data userconfig userdata
do
output=$(./wesnoth --nobanner --"$opt"-path)
if [ "$output" = "" ]; then printf 'option --%s-path prints nothing to stdout!\n' "$opt" >&2; exit 1; fi
printf '%s-path: %s\n' "$opt" "$output"
done
- name: WML validation
# only run on release builds (takes ~10 times as long on debug); since there are multiple release builds
# but running the following tests multiple times doesn't make much sense use cc==clang as the check
if: matrix.cc == 'clang' && (success() || steps.build.outcome == 'success')
if: success() || steps.build.outcome == 'success'
run: ./utils/CI/schema_validation.sh
- name: Run WML tests
# only run on release builds (takes ~6 times as long on debug)
if: matrix.cc == 'clang' && (success() || steps.build.outcome == 'success')
run: ./run_wml_tests -v -v -g -c -t 20 -bt 1000 -a=--userdata-dir=ud
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cc == 'clang' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-Linux
path: ud
# only run on release builds (takes ~10 times as long on debug)
if: matrix.cfg == 'release' && (success() || steps.build.outcome == 'success')
run: ./run_wml_tests -g -c -t 20 -bt 1000
- name: Run play tests
if: success() || steps.build.outcome == 'success'
run: ./utils/CI/play_test_executor.sh
@ -156,7 +138,8 @@ jobs:
if: success() || steps.build.outcome == 'success'
run: ./utils/CI/mp_test_executor.sh
- name: Run unit tests
if: success() || steps.build.outcome == 'success'
# only run on release builds (takes ~10 times as long on debug)
if: matrix.cfg == 'release' && (success() || steps.build.outcome == 'success')
run: ./run_boost_tests
steam-runtime:
@ -233,7 +216,7 @@ jobs:
translations:
runs-on: ubuntu-latest
container:
image: wesnoth/wesnoth:2404-master
image: wesnoth/wesnoth:2204-master
env:
LANGUAGE: en_US.UTF-8
LANG: en_US.UTF-8
@ -253,7 +236,7 @@ jobs:
make pot-update; echo "Ran make pot-update"
make mo-update; echo "Ran make mo-update"
make clean
scons translations build=release --debug=time nls=true jobs=2; echo "Ran scons translations"
scons pot-update; echo "Ran scons pot-update"
scons update-po4a; echo "Ran scons update-po4a"
@ -263,7 +246,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cfg: [ Release ]
cfg: [ Debug, Release ]
runs-on: macos-13
env:
CFG: ${{ matrix.cfg }}
@ -288,7 +271,6 @@ jobs:
[ -x "build/$CFG/unit_tests" ] || { printf 'Failed to build unit test executable!\n' >&2; exit 1; }
- name: Create disk image
working-directory: projectfiles/Xcode
continue-on-error: true # allow failures since this is not essential and it does fail spuriously (hdiutil: create failed - Resource busy)
run: hdiutil create -volname "Wesnoth_$CFG" -fs 'HFS+' -srcfolder "build/$CFG" -ov -format UDBZ "Wesnoth_${CFG}.dmg"
- name: Upload disk image
uses: actions/upload-artifact@v4
@ -297,13 +279,7 @@ jobs:
path: projectfiles/Xcode/Wesnoth_${{ matrix.cfg }}.dmg
- name: Run WML tests
if: matrix.cfg == 'Release'
run: ./run_wml_tests -g -c -t 30 -bt 350 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth" -a=--userdata-dir="$PWD/ud"
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cfg == 'Release' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-MacOS
path: ud
run: ./run_wml_tests -g -c -t 30 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth"
- name: Run unit tests
run: ./run_boost_tests --path=projectfiles/Xcode/build/"$CFG" --executable=unit_tests
@ -311,7 +287,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cfg: [Release]
cfg: [Debug, Release]
env:
CFG: ${{ matrix.cfg }}
VCPKG_FEATURE_FLAGS: dependencygraph
@ -320,7 +296,7 @@ jobs:
defaults:
run:
shell: cmd
runs-on: windows-latest
runs-on: windows-2019
steps:
- { uses: actions/checkout@v4, with: { submodules: "recursive" } }
@ -343,21 +319,14 @@ jobs:
run: cmake -DCMAKE_BUILD_TYPE=%CFG% -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true
-DENABLE_TESTS=true -DENABLE_MYSQL=false -DENABLE_NLS=false
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_INSTALL_OPTIONS=--debug
-DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_GENERATOR_PLATFORM=x64 -G "Visual Studio 17 2022" .
-DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_GENERATOR_PLATFORM=x64 -G "Visual Studio 16 2019" .
- name: Build wesnoth, wesnothd, campaignd and unit tests
run: MSBuild.exe wesnoth.sln -p:Configuration=%CFG%
- name: Run WML unit tests
if: matrix.cfg == 'Release'
run: python run_wml_tests -v -g -c -t 20 -p %CFG%/wesnoth.exe -a=--userdata-dir=ud
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cfg == 'Release' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: WMLTest-userdata-Windows
path: ud
run: python run_wml_tests -v -g -c -t 20 -p %CFG%/wesnoth.exe
# run after all other jobs have completed to check overall build status
notification:

View file

@ -6,7 +6,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
workflow_dispatch:
jobs:
analyze:
@ -16,7 +15,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
@ -50,12 +49,11 @@ jobs:
- name: Install dependencies
if: matrix.language == 'cpp'
run: |
utils/autorevision.sh -t h > src/revision.h
sudo apt update
sudo apt install scons libboost-system1.83-dev libboost-filesystem1.83-dev libboost-iostreams1.83-dev \
libboost-serialization1.83-dev libboost-locale1.83-dev libboost-regex1.83-dev libboost-random1.83-dev \
libboost-program-options1.83-dev libboost-thread1.83-dev libboost-context1.83-dev libboost-test-dev \
libboost-coroutine1.83-dev libboost-graph1.83-dev libasio-dev libsdl2-dev libsdl2-image-dev \
sudo apt install scons libboost-system1.74-dev libboost-filesystem1.74-dev libboost-iostreams1.74-dev \
libboost-serialization1.74-dev libboost-locale1.74-dev libboost-regex1.74-dev libboost-random1.74-dev \
libboost-program-options1.74-dev libboost-thread1.74-dev libboost-context1.74-dev libboost-test-dev \
libboost-coroutine1.74-dev libboost-graph1.74-dev libasio-dev libsdl2-dev libsdl2-image-dev \
libsdl2-mixer-dev libvorbis-dev libpango1.0-dev libssl-dev libcurl4-openssl-dev liblua5.4-dev
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
- name: Autobuild

View file

@ -1,88 +0,0 @@
name: Image metadata check CI
on:
push:
branches: [ master ]
paths: [ '**.webp', '**.png', '**.jpg', '**.jpeg' ]
pull_request:
paths: [ '**.webp', '**.png', '**.jpg', '**.jpeg' ]
permissions:
contents: read
jobs:
build:
name: Image Metadata
runs-on: ubuntu-latest
env:
BASE_SHA: ${{ github.event_name == 'push' && github.event.before || github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event_name == 'push' && github.event.after || github.event.pull_request.head.sha }}
steps:
- name: exiftool installation
run: |
sudo apt-get install --assume-yes exiftool
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: check image EXIF metadata
run: |
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.(webp|je?pg)$')
# cycle through the changed image files, make sure they have the right fields
for file in "${image_files[@]}"; do
# check Artist tag, fail if missing
artist="$(exiftool -p '$Artist' "$file")"
if [ "$artist" ]; then
printf 'Artist tag in %s is %s\n' "$file" "$artist"
else
printf 'no Artist EXIF tag in %s\n' "$file"
exit 1
fi
# check Copyright tag, fail if missing or wrong type
copyright="$(exiftool -p '$Copyright' "$file")"
case $copyright in
'GNU GPL v2+'|'CC BY-SA 4.0'|CC0)
printf 'Copyright tag in %s is %s\n' "$file" "$copyright"
;;
'')
printf 'no Copyright EXIF tag in %s\n' "$file"
exit 1
;;
*)
printf 'Copyright tag %s in file %s is not an accepted license! Must be one of: "GNU GPL v2+", "CC BY-SA 4.0", "CC0"\n' "$copyright" "$file"
exit 1
;;
esac
done
- name: check png XMP metadata
run: |
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.png$')
# cycle through the changed image files, make sure they have the right fields
for file in "${image_files[@]}"; do
# check Creator tag, fail if missing
artist="$(exiftool -p '$XMP:Creator' "$file")"
if [ "$artist" ]; then
printf 'Creator tag in %s is %s\n' "$file" "$artist"
else
printf 'no Creator XMP tag in %s\n' "$file"
exit 1
fi
# check Rights tag, fail if missing or wrong type
copyright="$(exiftool -p '$XMP:Rights' "$file")"
case $copyright in
'GNU GPL v2+'|'CC BY-SA 4.0'|CC0)
printf 'Rights tag in %s is %s\n' "$file" "$copyright"
;;
'')
printf 'no Rights XMP tag in %s\n' "$file"
exit 1
;;
*)
printf 'Rights tag %s in file %s is not an accepted license! Must be one of: "GNU GPL v2+", "CC BY-SA 4.0", "CC0"\n' "$copyright" "$file"
exit 1
;;
esac
done

4
.gitignore vendored
View file

@ -127,7 +127,6 @@ wesnoth.plg
*.exe
*.dll
*.so
compile_commands.json
# library files
.libs
@ -166,8 +165,6 @@ po/**/Makefile*
data/tools/unit_tree/**/files
data/tools/unit_tree/**/reports
data/tools/unit_tree/**/Locale
data/tools/macro_reference.html
about.wiki
# doc
doc/doxygen/html
@ -222,7 +219,6 @@ config.h
callgrind.out.*
data/dist
clean.sh
widgets_tested.log
# clangd cache
.cache/clangd

View file

@ -1,4 +1,4 @@
# set minimum version
# set minimum version
cmake_minimum_required(VERSION 3.14)
project(wesnoth)
@ -171,7 +171,6 @@ option(GLIBCXX_ASSERTIONS "Whether to define _GLIBCXX_ASSERTIONS" OFF)
option(GLIBCXX_DEBUG "Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC. Requires a version of Boost's program_options that's compiled with __GLIBCXX_DEBUG too." OFF)
option(ENABLE_POT_UPDATE_TARGET "Enables the tools to update the pot files and manuals. This target has extra dependencies." OFF)
option(FORCE_COLOR_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
option(CLANG_TIDY "Enable clang-tidy linter checks." OFF)
if(UNIX AND NOT APPLE AND NOT CYGWIN)
option(ENABLE_NOTIFICATIONS "Enable Window manager notification messages" ON)
@ -256,11 +255,6 @@ if(NOT MSVC)
endif()
endif()
### Enable clang-tidy linting
if (CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy -Wno-unknown-warning-option")
endif()
### Set the final compiler flags.
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${CXX_FLAGS_USER}")
@ -480,7 +474,7 @@ if(NOT MSVC)
else()
set(CMAKE_CXX_FLAGS "/W3 /WX /wd4503 /wd4351 /wd4250 /wd4244 /wd4267 /we4239 /wd4275 /EHsc /utf-8 /Zc:__cplusplus" CACHE STRING "Global flags used by the CXX compiler during all builds." FORCE)
set(CMAKE_C_FLAGS "/WX" CACHE STRING "Global flags used by the C compiler during all builds." FORCE)
add_definitions(-D_WIN32_WINNT=0x0A00 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)
add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG_LUA")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
@ -533,7 +527,7 @@ if(ENABLE_GAME OR ENABLE_TESTS)
find_package(VorbisFile REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Fontconfig REQUIRED)
find_package(SDL2 2.0.18 REQUIRED)
find_package(SDL2 2.0.10 REQUIRED)
if(NOT MSVC)
# for everything else, use pkgconfig
# SDL2_image and SDL2_mixer don't seem to have any cmake configuration available at all

View file

@ -2,7 +2,7 @@
## Prerequisites
Wesnoth requires a compiler with sufficient C++17 support such as GCC 11 and
Wesnoth requires a compiler with sufficient C++17 support such as GCC 7 and
later, or a version of Clang with equivalent support.
You'll need to have these libraries and their development headers installed in
@ -19,9 +19,8 @@ order to build Wesnoth:
* System
* Coroutine
* Graph
* Charconv (This requires boost 1.85 or higher and is optional but reccomended especially for clang builds)
* SDL2 libraries:
* SDL2 >= 2.0.18 (macOS: 2.0.22 due to needing https://github.com/libsdl-org/SDL/commit/3bebdaccb7bff8c40438856081d404a7ce3def30)
* SDL2 >= 2.0.10 (macOS: 2.0.22 due to needing https://github.com/libsdl-org/SDL/commit/3bebdaccb7bff8c40438856081d404a7ce3def30)
* SDL2_image >= 2.0.2 (with PNG, JPEG, and WEBP support)
* SDL2_mixer >= 2.0.0 (with Ogg Vorbis support)
* Fontconfig >= 2.4.1
@ -174,7 +173,7 @@ false value.
| `strict=<boolean>` | `ENABLE_STRICT_COMPILATION=<boolean>` | Whether to treat compiler warnings as errors or not. Primarily intended for developers. |
| `prefsdir=<directory name>` | `PREFERENCES_DIR=<directory name>` | Hardcoded user preferences and user data directory. The default is to leave this unspecified so that Wesnoth will use separate XDG paths such as .config/wesnoth and .local/share/wesnoth/<version> for its user preferences and data, respectively. |
| `cxxtool=<program>` | `CMAKE_CXX_COMPILER=<program>` | Specifies which C++ compiler to use. By default, the system's default C++ compiler will be automatically selected during configuration. |
| `ccache=<boolean>` | `CMAKE_CXX_COMPILER_LAUNCHER=ccache` | Whether to run the compiler through ccache first. Useful if the compiler executable is not a symbolic link to ccache. Requires ccache to be installed first. If using CMake, use CMAKE_C_COMPILER and CMAKE_CXX_COMPILER instead. |
| `ccache=<boolean>` | | Whether to run the compiler through ccache first. Useful if the compiler executable is not a symbolic link to ccache. Requires ccache to be installed first. If using CMake, use CMAKE_C_COMPILER and CMAKE_CXX_COMPILER instead. |
| `extra_flags_<buildtype>=<flags>` `extra_flags_config=<flags>` | `CXX_FLAGS_USER=<flags>` | Additional compiler flags to use when compiling a specific build type (SCons-only). To apply the same flags to all builds, use extra_flags_config (SCons) or CXX_FLAGS_USER (CMake) without a build type suffix. Alternatively, you may specify your flags in the CXXFLAGS environment variable. |
| `fifodir=<full path>` `server_uid=<UID>` `server_gid=<GID>` | `FIFO_DIR=<full path>` `SERVER_UID=<UID>` `SERVER_GID=<GID>` | Directory and owner id for the wesnothd control FIFO file. This is relevant only if you wish to be able to communicate with a local wesnothd instance through a named pipe. You must run wesnothd with the same UID specified at build time for this to work. |
| `enable_lto=<boolean>` | `ENABLE_LTO=<boolean>` | Controls using Link Time Optimization. Enabling will result in a smaller, faster executable at the cost of increased time to compile and link. For cmake, use LTO_JOBS=N tells how many threads to use during linking. |

View file

@ -50,7 +50,7 @@ Wesnoth can be played on Windows, macOS, and Linux, and can be installed using:
* standalone installers on [SourceForge](https://sourceforge.net/projects/wesnoth/files/) (Windows and macOS)
* [Flatpak](https://flathub.org/apps/details/org.wesnoth.Wesnoth) (Linux)
Additionally, Wesnoth is available for [iOS](https://apps.apple.com/us/app/battle-for-wesnoth/id575852062) and [Android](https://sourceforge.net/projects/wesnoth-on-android/files/).
Additionally, Wesnoth is available for [iOS](https://apps.apple.com/us/app/battle-for-wesnoth/id575852062) and [Android](https://play.google.com/store/apps/details?id=it.alessandropira.wesnoth114).
To build the game from source, see [INSTALL](/INSTALL.md) for instructions.

View file

@ -120,7 +120,6 @@ opts.AddVariables(
BoolVariable("OS_ENV", "Forward the entire OS environment to scons", False),
BoolVariable("history", "Clear to disable GNU history support in lua console", True),
BoolVariable('force_color', 'Always produce ANSI-colored output (GNU/Clang only).', False),
BoolVariable('compile_db', 'Produce a compile_commands.json file.', False),
)
#
@ -190,11 +189,6 @@ if env['distcc']:
if env['ccache']: env.Tool('ccache')
if env['compile_db']:
env.Tool('compilation_db')
cdb = env.CompilationDatabase()
Alias('cdb', cdb)
boost_version = "1.67"
def SortHelpText(a, b):
@ -232,7 +226,6 @@ You can make the following special build targets:
update-po = merge message catalog templates with localized message catalogs for particular lingua
update-po4a = update translations of manual and manpages
af bg ca ... = linguas for update-po
translations = build all translations
dist = make distribution tarball as wesnoth.tar.bz2 (*).
data-dist = make data tarball as wesnoth-data.tar.bz2 (*).
binary-dist = make data tarball as wesnoth-binaries.tar.bz2 (*).
@ -370,7 +363,7 @@ if env["prereqs"]:
def have_sdl_other():
return \
conf.CheckSDL2('2.0.18') & \
conf.CheckSDL2('2.0.10') & \
conf.CheckSDL2Mixer() & \
conf.CheckSDL2Image()
@ -378,14 +371,13 @@ if env["prereqs"]:
env["PKG_CONFIG_FLAGS"] = "--dont-define-prefix"
have_server_prereqs = (\
conf.CheckCPlusPlus(gcc_version = "8") & \
conf.CheckCPlusPlus(gcc_version = "7") & \
conf.CheckBoost("iostreams", require_version = boost_version) & \
conf.CheckBoostIostreamsGZip() & \
conf.CheckBoostIostreamsBZip2() & \
conf.CheckBoost("program_options", require_version = boost_version) & \
conf.CheckBoost("random", require_version = boost_version) & \
conf.CheckBoost("smart_ptr", header_only = True) & \
conf.CheckBoostCharconv() & \
CheckAsio(conf) & \
conf.CheckBoost("thread") & \
conf.CheckBoost("locale") & \
@ -672,7 +664,7 @@ for env in [test_env, client_env, env]:
env[d] = os.path.join(env["prefix"], env[d])
if env["PLATFORM"] == 'win32':
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0A00"])
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0601"])
if env["PLATFORM"] == 'darwin': # Mac OS X
env.Append(FRAMEWORKS = "Cocoa") # Cocoa GUI

View file

@ -81,7 +81,7 @@ code_blocks_target_translations = {
# XCode #
#=======#
def modify_xcode(filename, targets, remove):
def add_to_xcode(filename, targets):
"""Add the given file to the specified targets.
"""
projectfile = rootdir.joinpath(
@ -103,47 +103,36 @@ def modify_xcode(filename, targets, remove):
f"Could not find target '{tname}' in Xcode project file")
# groups are organized by directory structure under "src"
# except for tests, which have a separate root, "tests"
if pathlib.Path("tests") in filename.parents:
src_groups = project.get_groups_by_name("tests")
else:
src_groups = project.get_groups_by_name("src")
src_groups = project.get_groups_by_name("src")
if len(src_groups) != 1:
raise Exception("problem finding 'src' group in xcode project")
src_group = src_groups[0]
parent_group = src_group
for d in filename.parts[:-1]:
if d == "tests":
continue
found_groups = project.get_groups_by_name(d, parent=parent_group)
if len(found_groups) != 1:
groupname = parent_group.get_name()
raise Exception(f"problem finding '{d}' group in '{groupname}'")
parent_group = found_groups[0]
if remove :
# Remove from all targets if we want to remove
for file in project.get_files_by_name(filename.name, parent=parent_group):
project.remove_file_by_id(file.get_id())
else:
# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return
# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return
# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)
# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)
# that's done, save the file
project.save()
@ -153,7 +142,7 @@ def modify_xcode(filename, targets, remove):
# source_lists #
#==============#
def modify_source_list(filename, source_list, remove):
def add_to_source_list(filename, source_list):
source_list_file = rootdir.joinpath("source_lists", source_list)
sl_lines = open(source_list_file).readlines()
file_line = filename.as_posix() + '\n'
@ -162,16 +151,12 @@ def modify_source_list(filename, source_list, remove):
if filename.suffix != ".cpp":
return
if remove:
if file_line in sl_lines: sl_lines.remove(file_line)
else:
# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return
sl_lines.append(file_line)
# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return
sl_lines.append(file_line)
sl_lines.sort()
open(source_list_file, 'w').writelines(sl_lines)
@ -179,18 +164,13 @@ def add_to_source_lists(filename, targets):
translated_targets = [source_list_target_translations[t] for t in targets]
print(" source_list targets:", translated_targets)
for t in translated_targets:
modify_source_list(filename, t, False)
def remove_from_source_lists(filename):
# remove from all tagerts if -r was specified.
for t in source_list_target_translations.values():
modify_source_list(filename, t, True)
add_to_source_list(filename, t)
#==============#
# Code::Blocks #
#==============#
def modify_code_blocks_target(filename, target, remove):
def add_to_code_blocks_target(filename, target):
cbp_file = rootdir.joinpath(
"projectfiles",
"CodeBlocks",
@ -204,33 +184,30 @@ def modify_code_blocks_target(filename, target, remove):
elem = f"\t\t<Unit filename=\"{filename_for_cbp}\" />\n"
if remove:
if elem in cbp_lines: cbp_lines.remove(elem)
else:
# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return
# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return
# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
break
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
break
index += 1
cbp_lines.insert(index, elem)
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
break
index += 1
cbp_lines.insert(index, elem)
open(cbp_file, 'w').writelines(cbp_lines)
def modify_code_blocks(filename, targets, remove):
translated_targets = code_blocks_target_translations.values() if remove else [code_blocks_target_translations[t] for t in targets]
def add_to_code_blocks(filename, targets):
translated_targets = [code_blocks_target_translations[t] for t in targets]
print(" code::blocks targets:", translated_targets)
for t in translated_targets:
modify_code_blocks_target(filename, t, remove)
add_to_code_blocks_target(filename, t)
def sanity_check_existing_cpp_hpp(filenames):
"""
@ -302,8 +279,6 @@ if __name__ == "__main__":
help="which build targets to add the file to")
ap.add_argument("--no-checks", action="store_true",
help="do not check whether the files exist, etc")
ap.add_argument("-r", "--remove", action="store_true",
help="remove the specified files from projectfiles instead of adding them, --target is then ignored")
# By default, recognise --help too
options = ap.parse_args()
@ -320,13 +295,7 @@ if __name__ == "__main__":
sanity_check_existing_cpp_hpp(filenames)
for filename in filenames:
if options.remove:
print(f"removing '{filename}' from all targets")
modify_xcode(filename, options.target, True)
remove_from_source_lists(filename)
modify_code_blocks(filename, options.target, True)
else:
print(f"adding '{filename}' to targets: {options.target}")
modify_xcode(filename, options.target, False)
add_to_source_lists(filename, options.target)
modify_code_blocks(filename, options.target, False)
print(f"adding '{filename}' to targets: {options.target}")
add_to_xcode(filename, options.target)
add_to_source_lists(filename, options.target)
add_to_code_blocks(filename, options.target)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1,014 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 B

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 112 B

Some files were not shown because too many files have changed in this diff Show more