36266 Commits

Author SHA1 Message Date
gfgtdf
6ac17427c6 Remove special handling of linger mode in playmp_controller
To make the code simpler.

the sp linger function calls play_slice() which playmp_controller already overwrites, after a little fix of that we can remove a bit of code
2024-04-09 00:41:40 +02:00
gfgtdf
b79e305419 split process_network_data() into smaller functions 2024-04-09 00:41:40 +02:00
gfgtdf
9d7fd59cc8 remove turn_info class
All of its functions were moved to playmp_controller. Since they
were already so interconnected, this makes things a little easier.

Also it was always a bit confusing that this class was called
turn_info when all it did was to process network data.
2024-04-09 00:41:40 +02:00
gfgtdf
0b1cc36e51 small function reorder 2024-04-09 00:41:40 +02:00
gfgtdf
102ba5801e remove redundant error handling code in linger()
Since 1.18 linger() is called indirectly by play_scenario_main_loop()
and play_scenario() which already catches therse erros and offers the option to save the game then.

The special handlng of ingame_wesnothd_error was removed since it
was only added to fix the case of the host leaving resulting in the
game aborting (which should no loner be the case)
2024-04-09 00:41:40 +02:00
gfgtdf
c452f498de enable 'reveal_map' in sp
It defaults to false, the change is mostly to make the code simpler
2024-04-09 00:41:40 +02:00
gfgtdf
dd91316104 Remove wrong comment
The option to load a game is only disabled in networked
multiplayer not in local multiplayer
2024-04-09 00:41:40 +02:00
gfgtdf
69fc479cfa simplify sending of [turn] data
1) We remove the syncmp_handler class which was a
   bit too complicated for its rather simple task
2) We move network related stuff out of playsingle_controller
2024-04-09 00:41:40 +02:00
gfgtdf
4b287691ef remove unneeded sync_network call
this was added at some place in the past when games woudl end via a
game_end_exception, and is not needed anymore§
2024-04-09 00:41:40 +02:00
gfgtdf
38d95cc3ee don't reveal map after mp campaign games by default
It now matches the behavior in sp, this makers especially sense
as sp campaigns can also be played in mp mode.
2024-04-09 00:41:40 +02:00
Steve Cotton
71c2f65a82 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.

(cherry picked from commit f9af941f1ec7165ad135cba465717203a4007287)
2024-04-08 01:20:01 +02:00
Gunter Labes
bc5d69d35e
campaignd: Assign port 15019 to 1.19 2024-04-06 22:27:10 +02:00
newfrenchy83
57c8e0cce0
Fix attack::damage_type bug for ability resistance
When [damage_type] is used but the opponent uses the resistance ability
against the added type, the ability filter only detected the original type and
the new type was not affected.
2024-04-04 18:01:36 +02:00
pentarctagon
6607da7b89 simplify always true condition a bit 2024-04-02 14:21:44 -05:00
Iris Morelle
caadb3abbd gui/language_selection: Remove redundant class variable 2024-04-02 09:51:46 -03:00
Iris Morelle
7a1d6afafa 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-04-02 09:51:46 -03:00
Iris Morelle
a58dd956cc i18n: Add getter for the translation visibility threshold 2024-04-02 09:51:46 -03:00
pentarctagon
75be23ad3f reset back to the first tab 2024-04-01 14:44:59 -05:00
pentarctagon
c6126104d4 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-01 14:44:59 -05:00
Subhraman Sarkar
d803cd9c96
remove leftover print statement from #8451 (#8674) 2024-04-01 17:48:55 +05:30
Iris Morelle
55290c8715 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-31 02:44:04 -03:00
Iris Morelle
1e33024171 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:47 -03:00
newfrenchy83
21e2ec5847
Fix default argument in matches_if_present filters (#8649)
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:30 +01:00
Subhraman Sarkar
0bef2252a1
basic support for filtering campaigns based on completion status (#8451) 2024-03-26 13:24:14 -05:00
Subhraman Sarkar
0b646dec8a New Unit Type Editor UI in Scenario Editor 2024-03-26 13:23:38 -05:00
Steve Cotton
3d71a2e4d8 Automatically replace missing .jpg images with .webp if found
Give .jpg files the same logic that .png files were given in
8f06da197462e376bf25704253299a886622ba58, because many files
were renamed in 51b58ad218fc285717c7d5889fdfeda59f017ca6.
UMC using the old name for images will trigger a warning, but
the player will still see the image file.

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

(cherry picked from commit 84ed5488e0676a1cff6989ae3caa75a68f739bf7)
2024-03-25 21:02:18 +01:00
pentarctagon
0a613aac16 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:44:39 -05:00
pentarctagon
8674958cfb fix help portraits scaling too large 2024-03-22 17:44:24 -05:00
pentarctagon
0786acb0aa logs these, since normalize_path can return an empty string 2024-03-22 17:40:44 -05:00
pentarctagon
c00cfe2a05 Add an environment variable to disable logging to file
Fixes #8527
2024-03-17 12:23:31 -05:00
Hejnewar
c25d87bc9a
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:51:18 +01:00
Iris Morelle
19d8eeb5e9 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:42:25 +01:00
Iris Morelle
854b812ed4 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:16 -03:00
Iris Morelle
df4039d593 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:16 -03:00
Iris Morelle
3a8c234df7 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:16 -03:00
Iris Morelle
9f5e61b803 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:16 -03:00
pentarctagon
07100d0759 validate addon name when first entered as well 2024-03-14 22:03:45 -05:00
pentarctagon
b4f988a220 fix tags and secondary_author for pbl editor 2024-03-14 22:03:45 -05:00
newfrenchy83
24a75ba95c
fix math include necessary in game_config.cpp for compile file. (#8542) 2024-03-12 13:12:15 -04:00
shijie.chen
d88ddec6f1
Remove unnecessary header files (#8531)
Co-authored-by: shijie.chen <shijie.chen@goland.cn>
2024-03-12 00:07:48 -04:00
Charles Dang
5b05815d5c
Disambiguate operator<< for optimer (#8532) 2024-03-11 16:39:45 -04:00
Steve Cotton
8974d04147 Revert "GUI2/Outro: don't keep unnecessary copy of current text"
It's necessary, because text_index isn't always in-bounds for
the text_ vector. See 987827b475393104c47412fefb937ca1fe614211
for the bug number.

Note: the build of campaignd is currently broken by commit
3f61aaa8f4689d4e368089a7b4000168c2417cef, but there's a PR which
should merge shortly to fix that.

This reverts commit 82fa0742a12e8a44ea9094a344600232aa169a9e.
2024-03-11 20:37:18 +01:00
Charles Dang
82fa0742a1 GUI2/Outro: don't keep unnecessary copy of current text 2024-03-11 13:14:42 -04:00
Charles Dang
3f61aaa8f4 Move optimer to utils namespace for consistency 2024-03-11 12:54:58 -04:00
pentarctagon
195f630637 fix accidental conditional inversion
fixes #8525
fixes #8524
2024-03-10 12:11:51 -05:00
pentarctagon
1074ba704e Make sure animations are skipped when skipping animations in replays
Fixes #8227
2024-03-08 12:47:45 -06:00
gfgtdf
851c909cd3
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-07 01:25:59 +01:00
pentarctagon
c9a343da9d 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:28 -06:00
Iris Morelle
f8c4bf2130 gui/outro: New clock-based timing logic for the text fading
This version uses SDL_GetTicks() as a monotonic source to avoid the
previous version's pitfalls, namely the fact that the game's framerate
may not necessarily be a constant, and in particular, the old code
assumed a completely different framerate than what we ended up with
after the texture-based rendering changes in 1.17.x, resulting in an
almost-unnoticeable text fade due to the update() function being
called WAY more often than before.

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

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

The server info shown in the bottom left is changed from "<encryption
status> <server address>" to add "— <server id> (<server version>)"
right after it, with the server version in parentheses being included
only if debug mode is enabled to avoid redundancy or confusing values
(such as "wesnoth.org — 1.18 (1.17.19+dev)").
2024-03-01 22:33:31 -05:00