the game_config_view object offers const
access to the game_config object, furthermore
it allows the game_config config object to be
replaced by a vector of config objects which
is what we will do later.
If a save directory from another version is found, a drop-down list of
directories is added below the filter box in the Load Game dialog.
Refactor save_index_class to allow instances for other directories.
Design idea: all new saves go in to the main save directory. Games can be
loaded from other directories, but those directories are treated as read-only.
When building an index for other directories, the index is kept in memory and
not written to disk - this results in some noticeable lag in the UI when
opening the other versions' directories, but not the usual save dir.
This ensures the invalid characters are never saved internally in the first place, so this should
cover any case besides the aforementioned bug that might crop up.
The old name was too easy to confuse with a side's map staring position, something
I've done several times.
(cherry-picked from commit 8f93d0a7c67f77e3917c5a24c55a9d450579a423)
This replaces the caption with something more apropos than the generic
"Save Game" caption. It necessitates a minor API change though.
(cherry-picked from commit b7e08977edd703ad9f146fd81768b2f09c39facd)
The code was frantically converting spaces to underscores and back to keep
the facade up, and sometimes it failed (#1567).
The solution is obvious: simply use spaces for real in savefile names.
This way the conversion is only needed in one place (when generating the
suggested filename).
Fixes#1567. As a minor bonus, this also makes the "save game" dialog show
the filename with spaces.
Follow-up to commit 057a53055f74348c56d97c2c7ae0ab11a71b88cd.
Otherwise, Menu -> Back to... would be broken whenever the logic differs
between that feature and actual saving.
* Dropped unused CVideo class member references.
* Replaced the lone usecase of the CVideo member in loadgame with the singleton and removed said member.
* Removed CVideo references from a bunch of addon management functions.
* Cleaned up a *lot* of now-unnecessary forward CVideo declarations.
This also removes a bunch of unnecessary CVideo arguments from various savegame functions that
emerged as I cleaned up the unused parameters. savegame::save_game did take a CVideo pointer
that did look like it was intended to be a sort of do-show-dialog flag, but since that parameter
was never passed as null, I removed it.
[ci skip]
I ran the command used in 9b7b1751fdda, excluding results in lua/ and spirit_po/.
Also, once again, for some reason actions/vision.hpp gets registered as massively changed
(similar to f11fa0652af0) despite nothing really having changed at all.
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.
For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
* Moves load_game_exception to savegame.hpp and cleans some #includes
* Removes the load_game_exception statis members and replaces them with
a non-static load_game_metadata member.
* Adds loadgame::DIALOG_TYPE to remove the gui1 dependency.
* Fixes loading of replay saves.
* Adds soem mising override specifers in savegame.hpp
* If no game was show in the dialog (due to an invalid filter) one could still use Enter to load a game
* In the same situation above, ESC would cause a crash
* Canceling the Select Difficulty dialog would still try to load a game
This might have been the intended behavior, but it's not optimal.
First we remove the snapshot_ memaber form savegame class which was
previously copied with saved_game.set_snapshot
Second we use copy and swap in saved_game::set_snapshot
saved_game::set_scenario, this makes it possible to apply copy elison
and saves another copy of the snapshot if the compiler is smart enough.
This is fixes a minor bug:
When loading a save from the in-game load dialog, as soon as the
user clicks "ok" to load a savefile, an exception would be thrown
which effectively quits the game, before determining the integrity
and version info of that file.
It's better not to exit a running game if the new game can't be
loaded, so in this commit check these things and abort before
exiting if appropriate.
This is a chearry pick by me (gfgtdf) of 66176b1738. It differes a lot from the original becasue since there were so much merging conflics i decided to do it mostly from scratch.
Conflicts:
src/addon/manager.cpp
src/addon/manager_ui.cpp
src/campaign_server/campaign_server.cpp
src/config_cache.cpp
src/create_engine.cpp
src/editor/map/context_manager.cpp
src/editor/map/map_context.cpp
src/font.cpp
src/game_config_manager.cpp
src/gamestatus.cpp
src/gui/dialogs/editor/custom_tod.cpp
src/gui/dialogs/lobby/lobby_data.cpp
src/gui/dialogs/mp_create_game.cpp
src/gui/widgets/settings.cpp
src/hotkeys.cpp
src/image.cpp
src/multiplayer_lobby.cpp
src/network.cpp
src/playcampaign.cpp
src/preferences.cpp
src/savegame.cpp
src/serialization/preprocessor.cpp
src/tests/main.cpp
src/wesnoth.cpp
src/widgets/button.cpp
we don't want to expose the fileds "snapshot", "carryover_sides".
instead we only add classification, and mp_game_setting to resources
which are members of game_state.
in order to do that, we have to add a do_autosave method to
play_controller.
this commit also moves some code from game_state::write_snapshot to
play_controller::to_config which was intended to be in a different
commit.