81750 Commits

Author SHA1 Message Date
gfgtdf
d98a32d35c
Update changelog.md 2023-03-20 01:15:28 +01:00
gfgtdf
790948f623 Use the MP "Back To .." Feature in SP too #7460
Previously the behavior was the following:
- When the  "Back to Turn" button was pressed in SP, The gamestate is
  reset to the gamestate of that turn.

- When the "Back to Turn" button is pressed in MP, The gamestate is
  reset to the gamestate of that turn and a replay is started
  replaying the game until the current gamestate (using the usual
  replay UI). This is in particular useful to replay the enemies
  moves (for example in case you were afk)

Using the MP version also in SP will not only also give
the campaign player a quick way to review the enemies turn,
but also allow the player to restart the gamestate from an
arbitiary point (instead of just the begin of the turn) by
pressing the "Continue from here" button in the the replay

Furthermore, the Autosaves can still be reloaded normally via
the usual Load game menu.

This might need some finetuning based on feedback, in particular:
- Should this be optional, via a game preference?
- Should the 'replay' start in a paused state instead of replaying
  right away like it does currently?
- Should we allows addons to disable this feature (in case that
  they know that their addon breaks replays)?
- Or when a huge majority of players dislikes this we can also of
  course easily revert it.
2023-03-20 01:10:01 +01:00
gfgtdf
d0176732a4 Fix redo error after reloading #7253
The code was checking for [commands] instead of [command]
when loading savefiles.
2023-03-20 01:06:40 +01:00
gfgtdf
e7e763c27a Do not assert on redo error
Previously It used the default error handler, which asserts (which
makes sense since it executes actions right after they were evaluated
by the ui). For executing commands from the network a custom error
handler is used aswell.

We fix this by giving a custom error handler which shows an error
message instead.
2023-03-20 00:58:01 +01:00
gfgtdf
d086379b27
Update changelog.md 2023-03-19 21:41:03 +01:00
gfgtdf
eae4ffab61 Make 'Back to..' Feature work during ai turns
I am not completely sure whether it is safe to use 'Back to..' during
events/actions. The exception would mess up the current gamestate
but the current gamestate is replaced anyways.
2023-03-19 21:18:05 +01:00
gfgtdf
874dda7015 Make the MP "Back to ..." featute more robust
We now check that the loaded file is in fact  a previous gamestate from
the same branch, we do that by checking the [replay] data,  We
_could_ in theory additionally check the [replay_start] but i think this
is pretty safe.
2023-03-19 21:18:05 +01:00
gfgtdf
741c261ccf Remove skip_next_turn
It was agreed on that [end_turn] during turn end events ending the
next sides turn is counterintuitive and undocumented behaviour.
Note that it is always possible to end the next sides turn by
spawning an event:
```
inside a turn end event...
...
[event]
	name = "side_turn"
	[end_turn]
	[/end_turn]
[/event]
```
2023-03-19 21:18:05 +01:00
gfgtdf
e8d12ed728 Do not show carryover dialog on replays and observers 2023-03-19 21:18:05 +01:00
gfgtdf
761fcdf97c simplify init_side_end
the commit that added that gui_->invalidate_all() call
is very old and said its related to replays only
2023-03-19 21:18:05 +01:00
gfgtdf
ee46a6e671 fix missing check for network_processing_stopped_ 2023-03-19 21:18:05 +01:00
gfgtdf
e52a1d6aa7 small replaycontroller refactor 2023-03-19 21:18:05 +01:00
gfgtdf
b3dd7e6ac2 enable linger mode in replays 2023-03-19 21:18:05 +01:00
gfgtdf
a8c5d15f43 Remove explicit enable button calls
We improve can_execute_command for the entturn button, and replace
button->enable calls with set_button_state/queue_rerender calls
This is more robust in case someone else wants to update buttons.

We remove a call to button->enable in playturn.cpp which probably had
no effect since the linger mode for the clients automaticially ends
there already.

We create a new function to check set to gui to linger mode or not,
in particular is removes the linger overlay in init_scenario, in case
that we want to reset the replay from linger mode.
2023-03-19 21:18:05 +01:00
gfgtdf
045473dff5 Remove unused save_blocker class
While the idea was good, the implementation was a bit confusing, in partuclar its unclear why it used SDL semaphones instead of a simple int counter (like
command_disabler). (Also a std::function over a class method function pointer would be better). Also it supported the  delayed
save in certain cases. For a new implementation it'd probably be easier just to checek whether a save was requested at certain safe points.
2023-03-19 21:18:05 +01:00
gfgtdf
2e6d498318 Remove useless call to save_blocker
do_init_side() already uses command_disabler (as part of set_scontext_synced)
So save_blocker has no effect since the savegame button is disabled.
2023-03-19 21:18:05 +01:00
gfgtdf
89ae0419d1 Remove display::parse_team_overlays
This function made no sense since it invalidated the tiles with
overlays depending on which side is currently playing, but the
overlays don't depend on the currently activive side, but rather
on which side is currently viewing the game.
2023-03-19 21:18:05 +01:00
gfgtdf
26c81d315a add todo comment 2023-03-19 21:18:05 +01:00
gfgtdf
a34ebd0b5e add comment 2023-03-19 21:18:05 +01:00
gfgtdf
3372fbfae2 Remove unused textbox_info variable 2023-03-19 21:18:05 +01:00
gfgtdf
2cce1ad790 cleanup some includes 2023-03-19 21:18:05 +01:00
gfgtdf
ad27b58543 show carryover message for observers
carryover_show_gold not only shows the carryover message but also
calculates the carryover amount and stores it in the team object.
So omitting this call will result in wrong carryover data when the
observer saves the game in linger mode.
Furthermore carryover_show_gold seems to support generating messages
to observers alredy.
2023-03-19 21:18:05 +01:00
gfgtdf
2845e864f4 refactor playsingle_controller game loop.
The main intention is to move the linger mode into the
loop so that the replay can play until linger mode
is reached. In particular to allow replays to show
victory events aswell.
2023-03-19 21:18:05 +01:00
gfgtdf
e3d1e2b4f5 remove some level_result_defines options
they were only used in test_result which is already a string, there
is no need to have an additional not_set/invalid value
2023-03-19 21:18:05 +01:00
gfgtdf
e6369fee38 use different variable to remember to autosave 2023-03-19 21:18:05 +01:00
gfgtdf
62c120de30 refactor play_controller variables and game_data::phase
Instead of having variables init_side_done_, linger_ and the
END_TURN_STATE enum, we now have more possible states in
game_data::PHASE enum and a boolean end_turn_required_
variable.

The intention is to make the code simpler to prepare a refactor
to move the linger code into the play_scenario function so that
the replay will be able to execute victory events.

It is still a bit arbitrary which variables are part of game_data
or game_state tho imo.
2023-03-19 21:18:05 +01:00
gfgtdf
c61c7a6feb removed unneeded set_snapshot calls
I'm pretty sure that both of these cases don't need special handling,
because playcampaign.cpp calls set_snapshot unconditionally after
play_scenario.
The commit that added these calls is also quite old and
the code has been refactores multiple times since then.
2023-03-19 21:18:05 +01:00
Wedge009
469c2a07cb SotBE: Replace unfortunate wording.
Kapou'e does not appear to be making a comical statement, 'our rear' could be interpreted as 'rear end', or posterior.

[ci skip]
2023-03-19 15:13:22 +11:00
Pentarctagon
baf5d105a6 1.17.14+dev 2023-03-18 21:49:52 -05:00
Pentarctagon
f4ac9e03de 1.17.14 1.17.14 2023-03-18 21:48:59 -05:00
Pentarctagon
61a40a5847 changelog update 2023-03-18 21:41:26 -05:00
Pentarctagon
81330fc785 pot-update and regenerate doc files 2023-03-18 21:39:38 -05:00
TheShadowOfHassen
282000ef4f
NR: Dialog/ Story Rewrite: Scenario One. (#7454) 2023-03-18 14:43:37 -07:00
gfgtdf
752079cbd2 Add some comments 2023-03-18 22:14:26 +01:00
gfgtdf
3635719e67 Add some comments 2023-03-18 22:11:28 +01:00
gfgtdf
d954d307bc move carryover message to new file
This will in particular make future refactors of that code easier.
2023-03-18 19:04:39 +01:00
gfgtdf
8710ae0ee6 try to fix add_source_file 2023-03-18 19:04:39 +01:00
Nils Kneuper
8596abc4c0 updated Czech translation 2023-03-18 12:39:12 +01:00
Nils Kneuper
d82fdd0fd8 updated French translation 2023-03-18 09:59:29 +01:00
Elvish_Hunter
e58589e4ce woptipng: ignore thread niceness on Windows
Fixes #7457.
2023-03-17 23:30:39 +01:00
Iris Morelle
353aa4dbd2 campaignd: More verbose output if config::error is thrown
In the event that we unwind back to main().
2023-03-17 23:22:38 +01:00
Iris Morelle
4c6310e4a3 campaignd: Ensure [server_info] is always valid
Fixes an issue where the licensing terms would be empty when
interacting with a campaignd instance that has no [server_info] at all.

The previous method to retrieve [server_info] resulted in all the
defaults being ignored if the tag itself was missing in the config file,
due to poor logic to avoid the dreaded "Mandatory WML child missing yet
untested for" error.

This removes the non-const version of the method since it's unused,
will never be used, and would need a different implementation anyway.
Honestly this method is pretty pointless since it's only used once
during startup.
2023-03-17 23:22:38 +01:00
Pentarctagon
94dbccdd63 Add success/failure popups after attempting to download a replay. 2023-03-17 15:20:42 -05:00
Nils Kneuper
bbde2deed3 updated Italian translation 2023-03-17 19:08:55 +01:00
Tahsin Jahin Khalid
419d6a988f WC: delete irrelevant TODO
re-added already
2023-03-17 23:00:58 +08:00
Elvish_Hunter
b41bb0249f wesnoth_addon_manager: added --version flag 2023-03-17 11:00:02 +01:00
Elvish_Hunter
390f21c872 wesnoth_addon_manager: added new --terms flag (prints the server upload terms) 2023-03-17 10:52:20 +01:00
Hejnewar
2b01dd8d74
UtBS - Update and Fixes (#7450)
* UtBS unit balance changes

* UtBS xp and recall cost changes

* Requested fixes and improvements
2023-03-16 22:04:20 +01:00
gfgtdf
c13e128f71 remove unused function 2023-03-16 18:44:01 +01:00
gfgtdf
0b1535f286 Fix unit being constructed too early 2
previously custom effects did not work on dismissed units when
the dismissial was undone after the game was reloaded.
2023-03-16 18:44:01 +01:00