Commit graph

1774 commits

Author SHA1 Message Date
Celtic Minstrel
91c7536789 Add --plugin option to the Xcode scheme 2024-10-07 08:42:59 -04:00
Celtic Minstrel
42991138d9 Make enable_lua_ptr movable and non-copyable 2024-10-07 08:42:40 -04:00
Subhraman Sarkar
f5906d6224 remove find_widget.hpp 2024-09-27 06:04:57 +05:30
newfrenchy83
291e4bb0e5 update codeblock projectfiles 2024-09-24 14:39:39 +02:00
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
newfrenchy83
33976efcfc add 'core' folder in folder list of boost folder used in include 2024-09-10 16:15:37 +02: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
newfrenchy83
bf420cd7dd update list of boost headers used in compilation 2024-02-27 15:21:11 +01: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
Subhraman Sarkar
6c5a8e923d
Spinner and multiline textbox widgets (#8199) 2024-02-13 11:54:34 -06:00
pentarctagon
79ca90648a 2024 copyright update - misc 2024-01-20 22:41:50 -06:00
pentarctagon
971e05c63a 1.17.25 2024-01-20 20:02:42 -06:00
Eugene
9f99a4ef7d
Simplify nearest neighbor rescale (#8240) 2024-01-20 16:50:14 -06:00
Martin Hrubý (hrubymar10)
9125f7dab0
Fix Xcode builds 2023-12-19 17:04:46 +01:00
Martin Hrubý (hrubymar10)
be04167fff
Fix Xcode build on newest macOS versions 2023-12-17 19:24:58 +01:00
Martin Hrubý (hrubymar10)
23f3a7fe9c
Switch Xcode builds to the new MCS 2023-12-17 19:24:58 +01:00
pentarctagon
ce9874868d 1.17.24 2023-12-16 21:10:37 -06:00
Subhraman Sarkar
f1f67ae5df
Add functionality to Time Schedule Editor (#8066)
selected schedule will write to utils/schedule.cfg on scenario save

HOTKEY_EDITOR_CUSTOM_TODS is disabled unless user loads scenario

custom_tod:Preview button and associated callback added.

editor:translatable attributes now written with leading underscore

editor:support for multiple custom time schedules
2023-12-14 17:12:07 -06:00
pentarctagon
eda0ed3e16 1.17.23 2023-11-20 11:31:45 -06:00
Gunter Labes
2e191db2e7
Ignore implicit conversion warnings 2023-11-04 22:48:45 +01:00
pentarctagon
fec4f1771d 1.17.22 2023-10-16 23:29:23 -05:00
pentarctagon
56a6c8284c 1.17.21 2023-09-16 22:42:30 -05:00
newfrenchy83
a6883aabe0
Update list of boost modules 2023-08-21 15:03:38 +02:00
Pentarctagon
347745f19c 1.17.20 2023-08-19 21:04:11 -05:00
Steve Cotton
cc8dddea6e Support negative numbers in ranges
Adds support for using these in the weapons and ability filters:
* "-1", which was previously treated as an parse error (no number before the separator).
* "-3--1"
* "-infinity" as the lower number in the range, provided a different upper number is given.

This treats "-infinity" (with no other number), "-infinity--infinity",
"infinity" (with no other number) and "infinity-infinity" as errors. It seems
unlikely that someone would intend to use a filter that can't match any
reasonable number.

The range "-infinity-infinity" will be parsed successfully. I don't see a use
case for that, but nor do I see a reason to add extra C++ to reject it.
However, it's not added to the schema, as I think it's good for the schema to
give a warning when someone creates a filter which will accept every value
(including accepting the default, so "-infinity-infinity" accepts the unset
value too).

Includes new unit tests for the C++ and the Lua stringx.parse_range functions.
The next commit adds more WML tests, but is kept separate to credit the author.

This started as a change to move common filter functions from unit.cpp to
somewhere that they could be reused for other config-based filters. In the
process a missing feature was found and added, the move is still included in a
single Git commit because the move was required in order to make these
functions accessible to the Boost unit tests.

Two CodeBlocks project files additionally get src/utils/any.hpp added,
which was in one of them but missing from the other two. I noticed because
these are alphabetically at the start of the src/utils file list.

Thanks to @CelticMinstrel for the review comments and Xcode project updates.
2023-08-11 21:59:06 +02:00