We don't need the check-if-we-need-to-remove-existing-entry behavior when loading defaults,
since we always want the defaults as a base. This splits load_hotkeys into two functions,
one which directly sets the hotkeys list and the other which will check before adding.
This replaces deactivate_all_scopes followed by set_scope_active. These cases didn't have restorer behavior.
I'm not sure if using restorer behavior would be ok, will need to evaluate that. This is just to clean up
code while matching current behavior.
The existing code searched for `[units][advancefrom]` instead of
`[unit_type][advancefrom]`, so wasn't triggering. It was planned
for removal in 1.17, so simply mark it as already-removed in 1.15.3.
The deprecation warning is shown on stdout/stderr, but not in the
in-game UI, so it's generally not visible to players. I think it
would be better if it was visible, but OTOH it's something that's
easy for someone to check all add-ons for with a simple grep.
(cherry picked from commit f2fa807e6107c63aa9b38f36e5ad8a8fcfacf9a9)
The current issue is that, when loading a replay that requires addons from the main menu, it's checking for which addons can be enabled with game_classification.active_addons(...) before it reloads the cache to contain addons (such as eras) that are behind the #ifdef MULTIPLAYER define. It is of course impossible to find addon content before it has been loaded, which results in things like OOS errors due to unknown unit types.
Fixes#6283
Whether or not it's the campaign being played, this warning
gets printed if any add-on has a [campaign]extra_defines=
attribute with one of the deprecated strings (a hardcoded
list about 20 lines above the line that's changed here).
(cherry picked from commit c1499e06b55eb109502f6ae4272f16ca6661181b)
This additionally:
* Makes all copyright notices identical aside from the starting year for Wesnoth-specific source files. Files not included: mariadbpp, lua, spirit po, xbrz, and bcrypt (crypt_blowfish).
* Removes all attribution from the files, since the vast majority of them are outdated or seemingly just outright incorrect. For example, I would guess that Dave is no longer the sole author of the majority of Wesnoth's current code.
As of PR #4963, the engine ignores all global tags defined by add-ons that are not active, that is, that are not used in the current game. Whether an add-on counts as active is determined based on a list of possible tags with add-on ids. The [test] tag is not included in this list, resulting in test scenarios in add-ons not working any more.
The game keeps track of the version it last cleaned the cache, and if it's less than the current version,
it will perform a cache clean when the game_config_manager is created.
This was taken from the value in game_launcher, which was set to true if commandline_options::editor was set.
This uses that value instead of passing in the flag manually, which is consistent with the other defines.
This also removes game_launcher::jump_to_editor since it's no longer needed.
It didn't really make much sense to keep it here. The manager singleton is now local to its implementation
and initialized in game_config_manager::init_game_config like the credits data.
This chooses a method that minimizes the need to alter the way log messages are written.
Only a few places that did unusual things with the logger needed to be updated.
* Fixes#4223, by making the --validate and --validate-* options imply --nocache.
* Fixes#4224, showing an error if you misspell the id argument to
--validate-addon. The application doesn't (but should) quit automatically to
avoid the user spending time on a non-functional validation run, however it
does at least disable all add-ons, which should have the same end result.
* Shows a warning that --validate-addon needs the user to play the add-on, it
doesn't automatically check the add-on. This was my misunderstanding when
logging issue #4225, which has now been repurposed into a feature request for
a new tool that does what I thought --validate-addon did.
Now, during an active game, (that is: not during
campaign selection for example) the engine hides
all toplevel tags from addons that are not
involved in the current game. 'involved' here
means providing one of the [campaign], [scenario],
[era], [multiplayer], [modification] or [resource]
tags that are active in the current game.
Fixes#4832
This commit prepares a patch to disable unused
addons during a game. We try to reduce codes
that change the game_config config object.
In particular this removes a code that changes
the order of terrain graphics tag. This could
in theory break code that relied on that order
but afaik the terrain_graphics tags offers a
`precedence` that allows users to specify the
order in which terrain graphics are applied.
so no additional compatabiltiy code is needed.
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.
we changed also its implementation to use [modify_unit_type]
instead. This simplifies the implementation.
Now it also can no longer cause OOS if used recklessly.
But the new implementation also might not cover 100% of
its previous usecases, in particular this means that
[advancefrom] now only effects [campaign] within the same
addon. This might sound like it breaks compatability for
addons that have their units in a differnt addon and used
[advancefrom] but most of those would have casued OOS
before, so i think this actually an improvement.
Currently this is disabled by default
Use --validate command-line argument to enable
The following new features were added in the schema format:
* Union, intersection, and list types
* Keys can specify a union of known types on-the-fly
* Key and tag names can include wildcards (* and ?, glob-style)
* Tags support any_key=yes, which means unrecognized subtags will be ignored
* Tags and keys support deprecated=yes (unimplemented)
* Specify max=infinite instead of max=-1
This makes it so addon metadata (title, version) will be fetched from _server.pbl if
present and _info.cfg if not (see #3278).
This also eliminates the temporary addon_source struct and unifies the metadata parsing
and actual loading stages. They used to be separate since single-file addons were a
thing, but those were removed in 3f640b8e718e4c45d8f73798d839bfea0b413fab.
Also a bunch of minor code cleanup.
(cherry-picked from commit cd3c13aca223e8a8c681556fe8020915d98058e0)
See comment for explanation. This was a better solution that adding mutexes to
the cache accessors; that had performance downsides.
(cherry-picked from commit 011cbfe3b8fd2d634e3294484f4cb9b255eac029)
previously 918cdfcb36/src/saved_game.cpp (L293) would fail for [resource] because cfg["addon_id"] was empty.
(cherry-picked from commit 7ef9f9a18fdb25b993e0a2b3f533b0f4d04dc53f)
A few catch blocks modify something in their exceptions, so those are kept non-const.
(cherry-picked from commit 2bf4d68c87b69256266b7745a9e3453693794e35)
previously, if people wanted to make use of mp leader selection in mp
campaign they had to sxplicitly set no_leader=no and faction_lock=no,
with the new code its clear that no_leader= is just an alias for
faction_lock with type
(cherry-picked from commit 3797837c746b4cd371d83f5eaed94b57f1b1cd01)