When started with the command line argument --addon-info, the Info button is shown on the add-ons manager which then allows:
* querying the downloads by version of the currently selected add-on
* querying the count of total add-ons uploaded vs the count of add-ons using forum_auth
* deleting an add-on (requires being a member of the Site Administrators or Forum Administrators forum groups)
* hiding an add-on (requires being a member of the Site Administrators or Forum Administrators forum groups)
The idea is to make it easier for umc devs to implement
their own carryover / early finish bonus mechanics. Maybe
we can also make use of it in Worls Conquest.
This makes attribute_value and lexical_cast use the "new" to/from_chars api.
Its main advantages are:
- It's guaranteed to be locale independent, hopefully fixing all cases of #3945 and similar
- It fixes some cases config serialization, in particular the test
```
cfg["x"] = "9.87654321";
BOOST_CHECK_EQUAL(cfg["x"], 9.87654321);
```
- Previously the lexical_cast implementation used exception
handling for invalid formats (catching std::invalid_argument)
which made noise during debugging (and is also slower if it
is not optimized out).
- It's faster
So far afaik the only compiler which has a complete and proper to/from_chars implementation is msvc, gccs implementation of from_chars sometimes uses strtod under the hood and clang simply hasn't implemented from_chars for floating point numbers yet at all (actually the upcomig clang 20 will have it). Luckily for us, there is now also boost::charconv that can be used. So this raises to minimum build requirement to have at least one of:
- msvc 2019 update 5
- gcc 11
- clang 14 (i have added a fallback implementation of from_chars for this case, that doesn't support all of its features, and is probably certainly not as fast as the boost version, but supports the features that we use from it)
- boost 1.85
Since in particular the gcc implementation isn't that good (at least it on gcc11), boost charconv is the preferred implementation that is used if available.
This also removes a strange overload for
pointers to integers in lexical_cast while changing lexical_cast to use the new api.
Although not perfect, this makes the page usable. Using the previous version leads to multiple complex bugs at this point.
also stops a y calculation bug in table.
It is now roughly a superset of Pango and supports the following new features
* XML character entities, including decimal and hex entities, common named entities (apos, quot, lt, gt, amp), and even unrecognized named entities
* Nesting tags within each other (new-style only)
* Attributes without a value
The current preferences handling is a mess:
* it's essentially a global config object that anything can modify in any way the caller wants, which is managed across multiple source files which have their own oddities and interdependencies.
* the general preferences has its own bit of SDL event handling and while I get the idea behind `events::sdl_handler` there's no reason to have SDL events handled in the preferences instead of just calling the relevant preferences setter for each event when it happens.
* the general preferences is where most of the preferences are handled and has its `base_manager` struct, which is part of the `manager` struct in the game preferences, which is then implicitly initialized as part of game_launcher's constructor.
* the editor preferences are the only preferences in a sub-namespace `preferences::editor` while all other preferences are just in the `preferences` namespace.
* the display, editor, and lobby preferences are all dependent on including the game preferences, the credentials are dependent on including the general preferences (but not the game preferences), the game preferences are dependent on including the general preferences, and the advanced preferences are entirely their own thing which is dependent on none of the other preference functionality and manages its own singleton.
* nothing checks whether the preferences file has actually been loaded before allowing values to be read from or written to the preferences config - if you attempt to get a value too early in wesnoth's initialization it will silently just give you whatever the default value for that preference happens to be.
With this there is instead a single access point (with exceptions handled via friend functions/classes), all predefined preferences are accessed via their own setter/getter, and all mainline preferences are defined in a single file (preference_list.hpp) so it's easily findable what preferences exist and where they're used. Having the list of all mainline preferences listed out also allows the lua preferences API to provide that full list rather than just the list of the preferences that have been set so far. Also it now checks for whether the location of the preferences file is known before attempting to load the preferences file and asserts if someone attempts to use the preferences too early.
A rich text label widget that can show text marked up with help markup.
Also includes the GUI Test Window, accessible in the title screen after launching wesnoth using --clock option. It can be used as dialog template/example or as a place to test GUI2 code.
* Redesigned the version dialog to serve as a general purpose About dialog.
* Credits button removed from title screen
* Moved community dialog contents to about dialog as new tab
Co-Authored-By: Pentarctagon
* Bugfixes to the tab_container widget
* Success indication mechanism on copy buttons
Instead set the Apple preferences folder from within the code rather than using -DPREFERENCES_DIR.
Remove -DHAS_RELATIVE_LOCALEDIR since that doesn't appear to actually do anything since its only usage is in filesystem_common.cpp, not filesystem.cpp.
Add-ons: checks for any that exist in the chosen other version but not in the current version.
Preferences: adds attributes that don't exist from the chosen other version's preferences that aren't in the current version's preferences. for attributes that exist in both, use the attributes from the file that was modified most recently.
Credentials: move if the credentials file doesn't exist.
Fixes#7936
This is necessary with Xcode 15.3 to avoid about 750 warnings across
all of the codebase regarding "Implicit conversion loses integer
precision", most of which apply in cases where theoretical limits are
involved because of conversions from unsigned 64-bit integers (usually
size_t) to signed 32-bit (int).
Ideally we want to address these warnings, but given how many of them
there are all over the place this is not something that can reasonably
be done in such short notice before Wesnoth 1.18.0 is released, and in
the meantime they make the compiler output with Xcode unnecessarily
noisy and completely bury any relevant warnings from actual code
changes. In the meantime, this is best for productivity until we can
get to a place where we can fix all of them and force using
-Wshorten-64-to-32 for all platforms in CI.
Adds a test with a schema example containing a super cycle and a .cfg file containing an unknown key to this schema. Previously, this would cause an infinite loop or crash. Now an exception for invalid key should be thrown.
Add test for the already existing validation where a tag shouldn't set itself as its own super.
Add test for the new cycle detection when validating a schema.
The super tag dependency forms a directed graph. Boost Graph's depth first search implementation was used with a back edge detector to find the cycles.
This is a preparation for enumerating all keys that a tag can use, including the keys from the super tags. If cycles aren't handled, it is impossible to validate mandatory keys without entering an infinite loop.