164 Commits

Author SHA1 Message Date
Tommy
3e657955cb Add loading_screen::spin() function to update progress animation.
It should be called frequently by loading functions, particularly
inside loops which may load many things.
2022-06-16 16:12:15 +12:00
Charles Dang
7e76e21a87 Fixed hotkey scope regression
See comment in hotkey/hotkey/hotkey_command.hpp for explanation. This isn't a good solution,
but I need to figure out a better one.
2022-05-26 22:41:44 -04:00
Charles Dang
b4ee34dfff Hotkey/Item: optimized loading of default hotkeys
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.
2022-05-26 17:55:08 -04:00
Charles Dang
1c287b812a Hotkey: added option to disable restore behavior when passing a new scope bitset to scope_changer
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.
2022-05-26 16:05:29 -04:00
Pentarctagon
340023921d
2022 copyright update. 2022-03-06 19:07:13 -06:00
Steve Cotton
3439d069d0 Fix deprecation of [advancefrom], mark as already removed
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)
2022-02-02 12:00:48 +01:00
Pentarctagon
44bfb3af0b
Only try to activate required addons after loading all addons present.
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
2022-01-01 13:33:38 -06:00
Pentarctagon
7ffe2f84ee Get the scenario_id from the addon content list sent by the server if it's not otherwise available.
Fixes #6285
2021-12-19 17:50:35 -06:00
Steve Cotton
ec0c260e0e Print which campaign is causing the extra_defines warning
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)
2021-12-11 15:59:23 +01:00
Pentarctagon
57ce449af8
Re-add attribution to copyright notices.
These are mostly useless and outdated/wrong, but apparently it's probably illegal to remove them.
2021-07-27 20:21:38 -05:00
Pentarctagon
ba75e1af50
Copyright update.
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.
2021-07-26 11:38:03 -05:00
Steve Cotton
fc0b764403 Fix an intermittent crash with keyboard input during the load screen 2021-06-28 16:08:14 +02:00
mattsc
91115ba84e Add [test] to list of tags with add-on id
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.
2021-02-23 13:08:37 -08:00
Charles Dang
4512d17c0b Game Conifg Manager: implemented an automatic WML cache file cleaning step
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.
2021-01-22 14:59:39 +11:00
Charles Dang
4d54b2a7fd Used std::optional directly since we support C++17 now 2021-01-17 11:48:14 +11:00
Charles Dang
ef5296faf5 Game Config Manager: removed jump_to_editor ctor argument
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.
2021-01-09 11:38:33 +11:00
Charles Dang
148574a3a9 Game Config Manager: simplified a util function 2021-01-09 11:05:51 +11:00
Charles Dang
dbf9d355cf Moved advanced prefs manager out of game_launcher
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.
2021-01-09 03:39:44 +11:00
Charles Dang
4b12410086 Game Classification: added convenience type check functions
Shortens a bunch of code
2021-01-03 04:45:49 +11:00
Pentarctagon
4c2b725ec0 Change all doxygen comments to the same format. 2020-12-31 23:59:28 -06:00
Charles Dang
63030fef14 Game Config Manager: minor code cleanup
Fixes a stray space in the ENABLE_DWARVISH_RUNESMITH entry in the 1.14 deprecated advancement macros list.
2020-12-19 00:03:55 +11:00
Charles Dang
8da8d3ee55 Game Config Manager: code formatting 2020-12-18 23:55:41 +11:00
Charles Dang
50ed04319d FIlesystem: used scoped enums 2020-12-05 22:03:01 +11:00
Charles Dang
cb537f781b
Converted uses of boost::optional to utils::optional (#5329) 2020-12-02 08:16:05 +11:00
Celtic Minstrel
a1f44d8f64 Implement thread-safety in the logging system
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.
2020-10-14 08:49:52 -04:00
Charles Dang
6b89bf86a7 Removed trailing tabs and whitespaces from C++ source
[ci skip]

I ran the same command from 9b7b1751fdda.

Excludes:
* lua/
* spirit_po/
2020-10-09 14:14:38 +11:00
Steve Cotton
3f93c263a9 Improve user-friendliness of the validation options
* 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.
2020-10-02 18:34:18 +02:00
gfgtdf
fa75ad5f76
remove outdated comment 2020-08-28 12:00:27 +02:00
gfgtdf
b0eef4cfad fix color_range from addons
fixes #5101
2020-08-26 15:36:36 +02:00
gfgtdf
6fb3573978 fix modify_unit_type macros 2020-07-03 14:28:13 +02:00
gfgtdf
5759404121 disable unused addons during a game
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
2020-06-29 15:16:05 +02:00
gfgtdf
b63a3be678 game_config_manger refactoring
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.
2020-06-29 15:16:05 +02:00
gfgtdf
93aa2ca409 deploy new game_config_view object
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.
2020-06-29 15:16:05 +02:00
Pentarctagon
9ecfdae09b
Fix for getting the addon versions with --report. 2020-06-12 21:53:04 -05:00
Pentarctagon
177348bdb3 Add installed addons and addon versions to the build report.
This would be useful since often one of the things asked when a user reports issues is if they have any addons installed.
2020-06-10 18:47:26 -05:00
gfgtdf
d39fe3ad6d
fix advancefrom compatibility code 2020-03-13 21:43:37 +01:00
gfgtdf
5c655160cd imporve deprecation message for [advancefrom] 2020-03-12 19:15:17 +01:00
gfgtdf
240ca58a37 deprecate [advancefrom]
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.
2020-03-12 19:15:17 +01:00
Zaal Tonia
94ad15e5b0 Do a better job of catching pbl parse errors for addons 2019-04-24 18:45:59 -05:00
Celtic Minstrel
9cccfd73b0
Extend the image localization system to sounds and music (#3935)
Fixes #2987
2019-03-03 16:13:30 -05:00
Celtic Minstrel
8ef0c1734d Add several command-line options to invoke the schema validator 2018-11-03 17:09:25 -04:00
Celtic Minstrel
3a65a14bcb Implement validation of the core game config WML
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
2018-10-23 22:36:40 -04:00
gfgtdf
9cc105f018 show add-on loading times on --log-debug=config
(cherry-picked from commit 6781fe17ca40e1f8af5f117c7e3645b3ab6f599c)
2018-10-07 03:24:21 +00:00
Martin Hrubý
96bbebb514 Fix building with Xcode 10 (#3460)
Resolves #3458.

(cherry-picked from commit 50301f84e33d828c39835bc47f04dd1107631960)
2018-10-07 03:24:17 +00:00
Martin Hrubý (hrubymar10)
674fda85b7 Migrate links to https if available - Fwd c18537edc0678f40a209797d72dfaba3e5e88545
(cherry-picked from commit bc4d22dc72e79c3d6a3364ac896e473afd298246)
2018-10-07 03:23:36 +00:00
Charles Dang
611bacf3b6 Cleaned up addon loading process
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)
2018-10-07 03:22:55 +00:00
Charles Dang
0313deefe9 Game Config Manager: handle clearing image cache in main thread
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)
2018-10-07 03:22:11 +00:00
gfgtdf
e59a50b2f5 fix require_resource in [resource]
previously 918cdfcb36/src/saved_game.cpp (L293) would fail for [resource] because cfg["addon_id"] was empty.

(cherry-picked from commit 7ef9f9a18fdb25b993e0a2b3f533b0f4d04dc53f)
2018-10-07 03:21:27 +00:00
Charles Dang
d9fb6c0bf5 Catch all exceptions (where possible) as const references
A few catch blocks modify something in their exceptions, so those are kept non-const.

(cherry-picked from commit 2bf4d68c87b69256266b7745a9e3453693794e35)
2018-10-07 03:20:58 +00:00
gfgtdf
3d95d04461 fix handling of no_leader= (again)
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)
2018-10-07 03:19:35 +00:00