Commit graph

84085 commits

Author SHA1 Message Date
pentarctagon
ffcd19916b do this right 2024-07-08 17:42:20 -05:00
pentarctagon
bf512a5e1a handle unknown preferences. 2024-07-08 17:42:20 -05:00
pentarctagon
e9f13b1958 Implement reading/writing the synced and unsynced preferences
Reading the preferences will now:
* read the default preferences (if defined) and add them into the preferences config
* read the unsynced preferences and add them on top of any default preferences
* read the synced preferences and add them on top of the default and unsynced preferences.

Writing the preferences works basically the same way, just that it writes out preferences to either the synced or unsynced preferences file depending on the preference. This is determined by the std::arrays added to preferences.hpp and is checked at compile time via the static_assert these these arrays and the prefs_list are all constexpr - forgetting to add a new preference or remove an existing preference to these arrays will cause a compile error.

This also means that unknown preferences will not be written back out, so the removal of any existing "password" and "password_is_wrapped" preferences no longer needs to be explicitly done. Additionally, the clear() and erase() methods are removed:
* clear() is not desireable in the first place and it's not actually applicable to anything currently using it since they're just single attributes at the root of the config object anyway
* erase() is a one liner method that's not needed anymore since all handling now has access to the preferences_ config object
2024-07-08 17:42:20 -05:00
pentarctagon
54ab301343 Move the MP alerts preferences to prefs_list 2024-07-08 17:42:20 -05:00
pentarctagon
80fe9ba84d Move data that should be synced between computers to a common dir
Fixes #8059
2024-07-08 17:42:20 -05:00
ZombieKnight
56afa893bb
WFL: Use correct argument for the second location in rotate_loc_around (#9077) 2024-07-08 08:32:12 -04:00
Gothyoba
7b54d42d4b Updated link to android version in README
The app has been removed from the play store
2024-07-07 22:12:32 +05:30
Toom
35e405dde5 Pick Advance: remove irrelevant objects, closes #5707 2024-07-07 13:56:24 +02:00
Toom
1f0ffe0058 Pick Advance: merge moveto event into turn_refresh, closes #8954 2024-07-07 13:56:24 +02:00
Nils Kneuper
b0e9ac1947 updated British English translation 2024-07-06 10:00:17 +02:00
Nils Kneuper
c0a9d90d18 updated Czech translation 2024-07-06 09:58:09 +02:00
Nils Kneuper
eb23047ad8 updated French translation 2024-07-06 09:56:43 +02:00
Wedge009
c67d130507 SoF: Align masked dwarf portrait to the right, consistent with S9. Resolves #9008. 2024-07-06 11:44:32 +10:00
Steve Cotton
b0c8b69942 Ignore GCC-14 and Clang false positives about dangling pointers
For GCC-13, cfb28fbfb5 (in master)
added -Wno-dangling-reference, and that commit explains why the
false positive is triggered by calling find_widget. For GCC-14
there's an attribute so we can flag this specific function as ok.

Clang complains about unknown attributes in the gnu:: namespace,
so has to have the #if, and the #if means we need the #ifdef.

There are still warnings in src/actions/attack.cpp, but that area is
being worked on for an infinite recursion bug, and those warnings log
in a single batch instead of being spread across multiple .cpp files.

(cherry picked from commit e42f83a8d2,
with an improvement to the documentation after cherry-picking)
2024-07-05 23:19:01 +02:00
Steve Cotton
5e8df616d9 Fix warnings about a template id in a constructor
It's redundant, and GCC-14 warns that this isn't allowed in C++20.

(cherry picked from commit d5b726df6e)
2024-07-05 23:19:01 +02:00
Steve Cotton
1c9e3f220c Fix dangling reference warnings about refs to iterators
These are causing warnings with GCC-14.

An iterator can often be a struct containing a single pointer, so
creating a reference to such a small struct doesn't make sense.

The structure returned by child_range is likely to be exactly two
pointers, so it's not a burden to keep it even though back() has
already finished accessing the child_iterator.

(cherry picked from commit 087fa65dc5)
2024-07-05 23:19:01 +02:00
Charles Dang
791eed42cf Optimize color_range reference palette generation
For this specific codepath on game launch, it reduces it's execution time from ~18ms to ~1ms.
2024-07-05 16:19:02 -04:00
Subhraman Sarkar
4c1b1ebe20 reduce hardcoded extensions in python files, only instance at wmltool3.py 2024-07-05 09:05:26 +05:30
Subhraman Sarkar
078c618f3a reduce hardcoded extensions in cpp files, only instance at filesystem.cpp 2024-07-05 09:05:26 +05:30
Steve Cotton
c930a7e476 Delete the wmltools3.Translation class
Appears to be unused, and is still Python2 code. To be Python3, these
lines need to change:

- f = file(fn)
+ f = open(fn, encoding="utf-8")

- gettext = f.read().decode("utf8")
+ gettext = f.read()

Even knowing how to make it work, it still doesn't seem useful to keep.

wmlunits uses html_output.Translation, but that's not this class. It's
a wrapper around Python's standard gettext library, in html_output.py.
2024-07-04 16:37:39 +02:00
Steve Cotton
de48a16034 Remove unused dawn.png image, update copyrights.csv
dawn.png was leftover from the Time of Day being shown with an overlay
image; 074e157400 removed dusk.png and
night.png. The image itself should be a transparent blue hexagon, but
the alpha channel was corrupted, and so it appeared completely
transparent.

In copyrights.csv, make the capitalisation of Kitty's name consistent,
and attribute the orb-disengaged.png image.
2024-07-04 14:56:23 +02:00
Subhraman Sarkar
9496dd4edf add po hint 2024-07-04 02:31:47 +02:00
Subhraman Sarkar
b6e8142780 use correct font for tick character (#9055) 2024-07-04 02:31:47 +02:00
pentarctagon
1c19eb0da0 mention cmake flag 2024-07-03 09:16:23 -05:00
pentarctagon
2991c38955 change back to dot 2024-07-03 08:47:13 -05:00
Severin Glöckner
bf3cf83dfd German translation update 2024-07-03 12:38:29 +02:00
Pentarctagon
6812eac403
show a message when nothing exists to migrate (#9025) 2024-07-02 18:14:06 -05:00
pentarctagon
f1b90e91a9 fixup 2024-07-02 17:49:07 -05:00
Steve Cotton
91f59a794b wmltools3: fix regexp compatibility with Python 3.12 2024-07-02 19:42:13 +02:00
Steve Cotton
17c202d3fb GUI2/Game Load: Apply filter when changing directory
When the user types something into the filter box and then changes to
a different version, apply the filter immediately instead of showing
the full list of files.

The drop-down to switch between directories is hidden unless savegames
from other versions are detected. The button will appear at the
bottom-left in master, and at the top of the dialog in 1.18.
2024-07-02 16:02:26 +02:00
pentarctagon
b77b983319 address feedback. 2024-07-01 13:51:40 -05:00
pentarctagon
171423bb8a remove scons' use of removed relative prefs dir functionality 2024-07-01 13:51:40 -05:00
pentarctagon
c6a4d1d4da deduplicate binary paths list 2024-07-01 13:51:40 -05:00
pentarctagon
cc3a02bd32 Fix finding the current exe name on macOS 2024-07-01 13:51:40 -05:00
pentarctagon
d911a86a8f ensure the userdata is initialized before trying to use the preferences 2024-07-01 13:51:40 -05:00
pentarctagon
7895b843fa Prevent program hang when compiled with relative path PREFERENCES_DIR
Fixes #2000
Fixes #9007
2024-07-01 13:51:40 -05:00
Toom
081866af7b
Add unit_hits, unit_misses events
Added new events "unit hits/misses" to simplify creating events that use attacker+defender hits/misses (issue #7782)
2024-06-30 12:02:55 +02:00
loonycyborg
55b6010f77
appstream manifest: merge <provides> tags to placate flathub's linter 2024-06-29 22:08:32 +03:00
Subhraman Sarkar
103b80ff01
Editor enhancements (#8903)
Map/Scenario Editor

* Rename Load Map to Load Map/Scenario (since it can load both), Edit Scenario to Edit Scenario Settings, Save Map to just Save.
* Rearrange menu order
* Add icon for the preferences menu item (used the preexisting settings.png icon)
* Open folder correctly at Add-on's scenario directory instead of editor/scenarios. (#8910)
* Show Save Scenario As only for Scenarios
* Use the settings.png icon for Preferences menu item
* Add functionality to "Loyal" checkbox (Unit tool -> Place unit -> Right click menu) (#8445)
* Show warning when maps are saved in scenarios folder or vice versa (#8911)
* Unit List moved to Units menu from File menu to reduce some pressure from the latter.
* Status Table menu item disabled since it does nothing. (Should be reenabled once the functionality has been added.)
* Improve reload functionality in Editor (F5). Reload happens directly from memory and no temp files are needed. Also, the undo/redo stacks will be preserved. (#9024)

Time Schedule Editor

* Browse buttons now set wesnoth style paths instead of just pasting the absolute path returned by the file dialog
* Change text boxes from inactive to uneditable.
* Code generation improvements
* Add copyright notice to tod_new_schedule
* Confirmation messages
* Preview buttons for image and sound files and new icons for the preview button (2 sets : preview image and preview sound)

Unit Type Editor
 * Confirmation messages
 * New icons for the preview button (2 sets : preview image and preview sound)

Add-on menu
 * Two new menu entries for (1) opening the Add-on selection dialog, (2) opening the folder corresponding to the Add-on
The open add-on folder option shows a GUI2 file dialog at the add-on's folder which can be used to open any file. If it is a loadable map/scenario it will be opened in the editor, otherwise the OS's default application for that file will be opened.

File Dialog
 * Redesigned with new icons
 * New Open External button that opens selected file/folder in the platform's default application (independently of what pressing Open would do). This could be used to quickly open a folder or preview the file before actually selecting it.
 * Extension checking and filename validation. (See #8911)
2024-06-29 21:56:54 +05:30
Nils Kneuper
28a6a2a8b1 updated Chinese (Simplified) translation 2024-06-29 14:44:17 +02:00
Nils Kneuper
18af036313 updated French translation 2024-06-29 14:42:55 +02:00
Nils Kneuper
bcd370c149 updated Bengali translation 2024-06-29 14:28:43 +02:00
Nils Kneuper
d232827762 updated British English translation 2024-06-29 14:27:00 +02:00
gfgtdf
88113a738d
Handle require_modification as the client expects
Since 05d1e4b9ba, the client interprets require_modification="" as
defaulting to "yes". However, wesnothd was still defaulting it to
"no", causing an error message when trying to join games.

Fixes #8805 "Add-on version check prevents joining game".
2024-06-27 10:25:23 +02:00
Charles Dang
a1fe293b88 color_t: flip hex check logic for readability
Improves 6f32635788
2024-06-27 00:28:18 -04:00
Charles Dang
b505f8f744 Replace stray uses of std::make_optional
C++17 CTAD makes it unnecessary.
2024-06-27 00:27:15 -04:00
pentarctagon
291be986f6 Revert "GUI2/Addon Manager: make addon id more prominent, debug-only"
This reverts commit 78620c7d61.
2024-06-25 19:18:42 -05:00
pentarctagon
dc8637b08b Revert "GUI2/Addon Manager: hide addon id label earlier"
This reverts commit d1bf5dd778.
2024-06-25 19:18:35 -05:00
Gothyoba
16c4a57556
Tutorial: AToTB is a "novice" campaign 2024-06-25 18:42:32 +02:00
Steve Cotton
87b6371523 AToTB: Warn in the description how hard the challenging difficulty is 2024-06-25 14:03:26 +02:00