Commit Graph

650 Commits

Author SHA1 Message Date
pentarctagon
219fa494ca 1.19.9 2025-02-17 16:12:35 -06:00
pentarctagon
ca0f7a0a17 other copyright updates 2025-02-17 13:17:59 -06:00
pentarctagon
47417814a6 Remove configure_engine
it's mostly a wrapper around things which are already available via create_engine
2025-02-15 11:04:37 -06:00
Charles Dang
99ee4a7703
Split text attribute handling into its own API (#9890) 2025-02-15 00:33:46 -05:00
ForestDragon
93509c8499
Implement Reachmap Color and Opacity Options (#9877)
Co-authored-by: Descacharrado <Luis_koopa@hotmail.com>
Co-authored-by: Gunter Labes <soliton@wesnoth.org>
Co-authored-by: Charles Dang <exodia339@gmail.com>
2025-02-14 23:39:49 -05:00
pentarctagon
11523799e8 1.19.8 2025-01-19 11:53:14 -06:00
Pentarctagon
d8abcff103
wesnothd: use lambdas instead of rs_base (#9747) 2025-01-15 21:14:00 -05:00
Celtic Minstrel
57c74d41b3 Add --plugin option to the Xcode scheme 2025-01-15 09:46:42 -05:00
Celtic Minstrel
ef66ad5aae Make enable_lua_ptr movable and non-copyable 2025-01-15 09:46:42 -05:00
Pentarctagon
f61b7b77ec
Add additional functionality for the in-game add-ons manager (#9693)
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)
2025-01-14 09:35:46 -06:00
Subhraman Sarkar
bab3dd6e35 unified units dialog with configurable options
instead of having multiple dialogs with similar UI, we use only one dialog to which multiple configurations and data can be set.
2024-12-29 22:00:00 +05:30
pentarctagon
4a689a687d 1.19.7 2024-12-18 16:57:02 -06:00
gfgtdf
79798b9f2b remove unused cpp file 2024-12-15 05:24:12 +01:00
gfgtdf
f29f8fb368 move the carryover gold handling and dialog to lua
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.
2024-12-15 05:17:57 +01:00
gfgtdf
5801b5bcdb
use to/from_chars in attribute_value and lexical_cast (#8790)
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.
2024-12-08 22:28:10 +01:00
Martin Hrubý (hrubymar10)
b21b828f8d
Use new MCS for Xcode project 2024-12-07 17:58:52 +01:00
pentarctagon
99469ba31d 1.19.6 2024-11-26 12:16:03 -06:00
pentarctagon
383ba03664 1.19.5 2024-10-21 12:10:10 -05:00
Charles Dang
5e4728d69e Remove make_unit_ptr
Only used in one place anymore which already included unit.hpp anyway, so there's no benefit here.
2024-10-18 12:51:01 -04:00
Gunter Labes
dbcd6527d2
Remove unused SDL_net framework 2024-10-12 22:42:38 +02:00
Subhraman Sarkar
c2757a1d35 markup refactor: replace hardcoded markup strings
Examples:
formatter() << "<b>" << "Hello" << "</b>" becomes just markup::bold("Hello")
formatter() << font::span_color(color) << text << "</span>" becomes formatter() << markup::span_color(color, text)
also adds markup.cpp/markup.hpp to XCode and CodeBlocks source files and removes text_formatting.cpp/hpp from projectfiles.
2024-10-10 01:31:14 -04:00
Subhraman Sarkar
f5906d6224 remove find_widget.hpp 2024-09-27 06:04:57 +05:30
Charles Dang
1261d88b15
Removed a bunch of unused GUI1 stuff (#9375)
Don't need these now that the GUI2 help browser is merged.
2024-09-23 23:54:47 -04:00
Subhraman Sarkar
5958ca209e reformat the ToD page and bugfixes
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.
2024-09-23 19:49:44 -04:00
Celtic Minstrel
d910171b3d Rewrite the help markup parser.
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
2024-09-23 19:49:44 -04:00
Charles Dang
03e11a62e1 Removed GUI1 Help interface code
Not needed anymore since we're moving to GUI2 for this dialog.
2024-09-23 19:49:44 -04:00
pentarctagon
ff9c4461ae 1.19.4 2024-09-17 21:21:55 -05:00
Celtic Minstrel
d4278fa1be Lua API: Add __dir metamethod to units metatable
This implements a new system for registering attributes, adapted from the system for widget attributes.
2024-09-15 15:27:39 -04:00
pentarctagon
e865a5fd61 1.19.2 2024-08-18 23:22:05 -05:00
Charles Dang
f8ca3ccd36 Update CodeBlocks and XCode projectfiles 2024-08-08 17:26:35 -04:00
Celtic Minstrel
2679fec5f2 Add utils/optional_fwd to the Xcode project 2024-07-23 09:29:45 -04:00
pentarctagon
7cf3a8d853 1.19.2 2024-07-21 22:38:25 -05:00
Charles Dang
8792655e26 Bump macOS deployment target to 10.13 2024-07-08 22:02:32 -04:00
pentarctagon
6189964a77 1.19.1 2024-06-17 10:49:01 -05:00
Gunter Labes
11465fec86
Update added/removed header files in Xcode project
Header files added/removd in commits: c4c292fa3b, 43f5644e36, 3279973960, c5b1fa9dfd, d954d307bc, 01f28b12ae, 63d14217c9, 6d77fdc48c, 0e85fac29c, 0b646dec8a and 6c5a8e923d
2024-06-16 20:36:45 +02:00
Pentarctagon
971073055e
Refactor the preferences into a proper singleton. (#8930)
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.
2024-06-09 11:34:09 -05:00
Subhraman Sarkar
43f5644e36
Rich Text Label widget for Help Browser GUI2 port (#8655)
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.
2024-06-06 16:33:37 +05:30
pentarctagon
d39e42b672 1.19.0 2024-05-26 15:13:59 -05:00
Subhraman Sarkar
92d66554dd
UI : About dialog (#8803)
* 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
2024-05-21 09:43:32 +05:30
Subhraman Sarkar
03a46f1d7c
Combobox, Tab Container and Editability in Text Box (#8390)
* new combobox and tab container widgets
* ediability in text box via the editable key
2024-05-06 09:56:44 +05:30
pentarctagon
e89ade1f8d Remove version-specific info from xcode projectfile
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.
2024-05-03 23:39:00 -05:00
Pentarctagon
b3f6f80010
Add a button to the build info dialog to rerun the migrator. (#8791)
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
2024-04-27 00:45:41 -05:00
pentarctagon
39987cd1ca Add a Community button to the title screen.
This opens a dialog with links to the forums, discord, etc, plus a donate button that links to Wesnoth's SPI page.
2024-04-15 16:50:42 -05:00
gfgtdf
0d9dfb64d2 Remove src/playturn.cpp 2024-04-09 04:18:46 +02:00
Subhraman Sarkar
0b646dec8a New Unit Type Editor UI in Scenario Editor 2024-03-26 13:23:38 -05:00
Iris Morelle
dce011919c Add -Wno-shorten-64-to-32 to compiler flags in Xcode
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.
2024-03-13 23:04:29 -03:00
Rafael Fillipe Silva
c7e643bffd add a test to cover the fix to find_key's infinite loop/crash
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.
2024-02-26 10:12:43 -06:00
Rafael Fillipe Silva
fd6cd7c2a2 add tests for super cycle detection on schema self validator
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.
2024-02-26 10:12:43 -06:00
Rafael Fillipe Silva
dafb78cdf1 implement super cycle detection for the schema self validator
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.
2024-02-26 10:12:43 -06:00
pentarctagon
d1b3ede924 1.17.26 2024-02-19 21:05:54 -06:00