80411 Commits

Author SHA1 Message Date
Pentarctagon
af445f905b Update docker images to Ubuntu 22.04. 2022-04-21 20:30:34 -05:00
Wedge009
f82079bcc0 SoF S9: Allow for Gryphon Riders to trigger an event on the final runic tablet, and add translator hint
Things in the scenario didn't quite make logical sense considering the presence of Gryphon Riders. This resolves the issue by allowing them to trigger an event, and by acknowledging them in the endlevel dialog. Additionally, one translator hint is added for the "Smash" text when the rune is smashed.
2022-04-22 11:30:03 +10:00
Steve Cotton
bfd0ef9af7 Add debug for "[event] is missing name or id"
The problem with this warning was that it didn't include any clue about what
had triggered it - just that there's a broken event somewhere, and it could be
in a scenario, macro, unit_type or even from another add-on if you're using a
non-default era.

When run with `--log-debug=wml`, this makes Wesnoth print out whatever the
contents of the affected [event] tag are.

(cherry picked from commit d6b56969a012853fbfc55844b1eac98a70c0346b)
2022-04-21 15:29:57 +02:00
Celtic Minstrel
d31261f060 Update Xcode project 2022-04-20 23:08:04 -04:00
Tommy
9ece8ccc71 Remove warning about leaking drawing surface.
It does get correctly freed by the wrapper when reassigned.
2022-04-20 20:00:16 +12:00
Steve Cotton
0f6a94f2a7 Unit tests for [drains], [poison] and [slow], with apply_to=opponent
Slightly different to PR #6582, which was the 1.16 version of this. The five
lines that were labelled `preserving known bug` are changed to test that it's
been fixed.

Here `apply_to=opponent` means that the weapon special gives the opponent the
ability, the unit that should get poisoned or slowed is the unit that has the
weapon special.

There's a known bug in 1.16, that `apply_to=opponent` check the wrong unit to
see it it's `unpoisonable`, `undrainable` etc. It also checks the wrong unit to
see if it's already poisoned or slowed, so a battle between two units that both
have reverse-poison results in at most one being poisoned.

Most of the credit for this is Newfrenchy's, as he's already written a fix
and a WML based test. This commit uses a Lua test instead to test more
combinations of statuses.

This adds a `COMMON_KEEP_A_B_UNIT_TEST` macro, which is a counterpart to the
`GENERIC_UNIT_TEST` macro that starts the leaders next to each other, ready
to attack. The `A_B` is because I'm planning a multiple-side variant too.

There's no test for [petrify], as simulate_combat doesn't provide a stat for it.

This tests only 3 of the 6 abilities whose behavior changed in 650f70405ff.
My thoughts on testing the others are:
* [firststrike]'s test is in 650f70405ff.
* [drains], [poison] and [slow] are tested here.
* [petrify] ends combat, it's also not exposed in simulate_combat's stats.
* [plague] triggers after combat ends.
2022-04-19 15:27:49 +02:00
Tommy
b530a47502 Implement automatic pixel scale and enable it by default.
It will try to match the default resolution (1280x720). It will also try
to ensure that the scaled resolution is less than 1920x1080. This will
result scaling as soon as the 1920x1080 resoluton is exceeded, requiring
a minimum supported resolution of 960x540 or less, however in practice this
is not a huge problem even with the existing 800x600 theme.

In any case the pixel scale can of course be overridden in preferences.
2022-04-18 17:25:06 +12:00
Tommy
cf0da8b1ac Update pixel scale in real-time from prefs dialog.
This will never reduce the drawing resolution beyond the minimum window
size specified in preferences/general.cpp.

The minimum window height has been reduced from 600px to 540px!
This is to that a 1920x1080 display can use a pixel scale of 2.
It could be changed back, but a better solutuion would be updating the
default theme to accomodate this form factor.
2022-04-18 17:25:06 +12:00
Tommy
ab10d4d219 Fix remaining input issues with scaled display.
There is a new sdl::get_mouse_state() function that should be used in place
of SDL_GetMouseState() in every case. It returns coordinates relative to
the drawing surface.

With this, the pixel scale option seems to be working without issue.
2022-04-18 17:25:06 +12:00
Tommy
d130622b96 Initial indirect rendering prototype.
Rendering is now done to a separate surface. All routines that previously
wrote directly to the framebuffer now write to this surface. When the screen
is flipped, this surface is copied directly to a streaming texture, which is
then scaled to the window's rendering surface for display.

This has enabled a drawing resolution that differs from display resolution.
It is active and for the most part works. Input events are converted to the
correct scale by SDL, so most input handling routines can be used unchanged,
but one or two are causing problems so there are some bugs. To test this,
change the "pixel_scale" preference. Don't expect a playable game with
any pixel scale other than 1 yet.
2022-04-18 17:25:06 +12:00
Tommy
3a781c87ad Add pixel scale preference option. 2022-04-18 17:25:06 +12:00
Steve Cotton
c5dec73784 Unit tests: make separate files for each starting position
Turn the 4 side setup of the firststrike_and_laststrike test into a macro
called `COMMON_KEEP_A_B_C_D`for reuse in other tests.

The comment for `GENERIC_UNIT_TEST` gets a couple of extra paragraphs.

All the files get wmlindent run on them, which reindents `FAIL_IF_NOT`.

The main reason for having these is separate files is Git's fuzzy-patch
matching when merging and rebasing. Having large blocks of identical text
in `wml_unit_test_macros.cfg` can mean the wrong section gets patched.
2022-04-18 04:48:53 +02:00
Pentarctagon
073d4111b2
1.17.3+dev 2022-04-16 19:35:46 -05:00
Pentarctagon
4a6ba74ea8
1.17.3 1.17.3 2022-04-16 19:34:19 -05:00
loonycyborg
d10a784486
pot-update and regenerate doc files 2022-04-17 03:29:07 +03:00
doofus-01
62f583529e
Update changelog.md 2022-04-16 10:04:16 -07:00
doofus-01
19fcc1424f
Deprecation of old-style _PLFB and script-generated macros
1.17 terrain-graphics macros clean-up (#6606)
2022-04-16 10:01:09 -07:00
Steve Cotton
1183858f25 Update changelog 2022-04-16 10:36:06 +02:00
Pentarctagon
0a7ef1edf1
Add SQL to list unique users per day per source. 2022-04-15 10:27:36 -05:00
Pentarctagon
4cae3beea0
Add SQL to list unique users per day. 2022-04-15 09:45:16 -05:00
Pentarctagon
6dc52f0837
Add changelog entry. 2022-04-12 21:09:04 -05:00
Pentarctagon
08d134ae7b Add support for forum_auth when uploading to campaignd. 2022-04-12 21:06:18 -05:00
Charles Dang
6d3ec1b979 GUI2/Dispatcher: minor doc cleanup 2022-04-12 21:18:25 -04:00
Charles Dang
e14c9279bc GUI2/Dispatcher: made mouse_behavior a scoped enum 2022-04-12 21:16:14 -04:00
Charles Dang
509dffcfb3
Merge pull request #6623 from wesnoth/even-more-dispatcher
Even more dispatcher
2022-04-12 20:27:47 -04:00
Charles Dang
d29f86c2e1 Removed [dis]connect_signal static_assert
Passing the incorrect function  is already a compiler error, and while MSVC builds, GCC et al don't.
Keeping this in history for reference.
2022-04-12 18:42:36 -04:00
Charles Dang
e8e1572442 GUI2/Dispatcher: simplify signal type alias names 2022-04-12 16:43:26 -04:00
Charles Dang
9cec01b680 GUI2/Dispatcher: used default default ctors, disallowed copying signal_queue 2022-04-12 16:24:05 -04:00
Charles Dang
eee2f09216 GUI2/Dispatcher: even further simplified [dis]connect_signal
Macros be-gone!
2022-04-12 16:22:34 -04:00
Charles Dang
ea28127d91 Fixup 2022-04-12 09:33:12 -04:00
Charles Dang
e36b8acace Revert "GUI2/Distributor: address *potential* nullptr dereference"
This reverts commit 9caf43ed732f621d6d752ff5dede54466d5d4b4c. I was mistaken, this is actually meant
to check if mouse_focus_ is a styled_widget or not, and if it's not, fire events unconditionally.
2022-04-12 07:36:44 -04:00
Charles Dang
168986232a Convert compression::format to a scoped enum 2022-04-12 07:35:15 -04:00
Charles Dang
9caf43ed73 GUI2/Distributor: address *potential* nullptr dereference
This has been here since 2009 when this block of code was added (0d72daac2e1157f0d069ff07eb359a9581272cdc).
It's not clear mouse_focus_ would ever be null here, but if it ever was, this would have tried to deference
it and crash. To be safe, I've wrapped both fire() calls in a not-null check.
2022-04-12 07:14:57 -04:00
Charles Dang
b4d1717767 GUI2: small misc cleanup things 2022-04-12 07:03:39 -04:00
Charles Dang
d2e0fb32f8 GUI2/Distributor: code formatting, minor cleanup 2022-04-11 11:01:57 -04:00
Wedge009
aa6b5b493d Avoid potentially using unit IDs that are no longer valid
Resolves #6603 (crash with musl implementation of libc)
2022-04-11 16:26:00 +02:00
Charles Dang
c1d7e65cbc
GUI2/Distributor: further cleanup (#6622)
* GUI2/Distributor: further cleanup started in 988bf973e96efaed9eec268c8d1ba5f4ed3bed37

This restores the template to mouse_button, but it keeps the struct-based approach for specifying ui_events.
2022-04-11 07:52:54 -04:00
Celtic Minstrel
fafafbacf6
Update changelog.md 2022-04-10 20:58:12 -04:00
Charles Dang
65d8c201a5
GUI2/Dispatcher: encode event categories in their enum values (#6621) 2022-04-10 17:56:27 -04:00
Celtic Minstrel
a76aa9bddc
Add wesnoth.interface.add_floating_label as a replacement for wesnoth.print (#5837)
This returns a label handle which allows you to remove, reposition, or replace the label later.

In addition to all the features of wesnoth.print, you can now specify where the label appears onscreen, as well as a fadeout time separate from the duration.

You can also anchor the text to an edge or corner instead of centering in on the screen,
specify the maximum width it can occupy as an absolute width or a percentage,
and specify a background colour and transparency.

It includes a demo scenario that demonstrates many of the capabilities of the API.
To play the demo scenario, run with -toverlay_text_demo or select it from the in-game test list.
2022-04-10 13:00:29 -04:00
Nils Kneuper
75168c44ac updated Czech translation 2022-04-09 12:01:24 +02:00
Steve Cotton
c7acca4ea7 SoF: Consistently use lower-case after ellipses
Sadly, this takes the campaign up to 100 string changes between 1.16.2 and
1.16.3. The only one of these that was already going to change for 1.16.3 is
S04t's volcanic forge one.

(cherry picked from commit a1e60f061dd85237215966e5733a8da8f7ec126b)
2022-04-09 01:27:48 +02:00
Pentarctagon
a89340bd44
Fix for clang's -Wrange-loop-construct. 2022-04-08 14:16:50 -05:00
Pentarctagon
c3a5763f03
Fix schema. 2022-04-08 11:49:02 -05:00
Pentarctagon
3e79bf173e
Fix misnamed template parameter. 2022-04-08 09:32:08 -05:00
Charles Dang
be73a7cc62 GUI2: further cleaned up dispatcher implementation 2022-04-08 04:09:37 -04:00
Charles Dang
c8f1e63742 Merge branch 'master' of github.com:wesnoth/wesnoth 2022-04-08 03:08:07 -04:00
Charles Dang
ff3bd38a6f GUI2/Static Registry: removed some unnecessary typedefs
Better for intellisense.
2022-04-08 03:03:16 -04:00
Charles Dang
a3b6f57e4d Game Load: revamped design 2022-04-08 03:02:21 -04:00
Charles Dang
6b329a020a Loading Screen: added an (as-yet unused) image background layer 2022-04-08 02:59:11 -04:00