Commit Graph

12509 Commits

Author SHA1 Message Date
TÖRÖK Attila 6aa2dde859 chore: Update quick-xml to 0.35.0 2024-06-30 11:17:38 +02:00
Crowdin Bot c07f5cfca5 chore: Update translations from Crowdin 2024-06-30 10:13:29 +02:00
TÖRÖK Attila 9d11eb9816 web/extension: Fix AMO submission status checking 2024-06-30 10:06:27 +02:00
Tom Schuster 5618a3d048 avm2: FP10 version DisplayObject rotationX/Y/Z and scaleZ
Fixes #16910
2024-06-30 09:48:40 +02:00
Kamil Jarosz 3ff48e9e92 tests: Add avm2/edittext_html_font_size_swf13 test 2024-06-29 22:57:55 +02:00
Kamil Jarosz 156fda9a40 tests: Add avm2/edittext_html_font_size_swf12 test 2024-06-29 22:57:55 +02:00
Kamil Jarosz 19649cc69b text: Do not clamp font size for SWF13+ 2024-06-29 22:57:55 +02:00
Kamil Jarosz fd051c1b34 tests: Add avm2/edittext_html test 2024-06-29 22:57:55 +02:00
Kamil Jarosz c350be43b8 avm2: Implement TextField.getTextRuns() 2024-06-29 22:57:55 +02:00
Kamil Jarosz bcbf3ba3d1 text: Support TextFormat.display 2024-06-29 22:57:55 +02:00
Kamil Jarosz 5c41e80d0c tests: Add avm2/text_run test 2024-06-29 22:57:55 +02:00
Kamil Jarosz 3bf5e28348 avm2: Implement TextRun 2024-06-29 22:57:55 +02:00
Kamil Jarosz b10e9fbe59 tests: Add focus_highlight_avm2_button_bounds test 2024-06-29 22:42:25 +02:00
Kamil Jarosz 95cc3c52f3 avm2: Fix highlight bounds for buttons
Similarly to AVM1, AVM2 buttons also use their
hit bounds as highlight bounds.
2024-06-29 22:42:25 +02:00
Kamil Jarosz dd9698e8cc tests: Add edittext_at_point_methods_basic test
This test verifies the basic behavior of getCharIndexAtPoint
and getLineIndexAtPoint methods of TextField.
2024-06-29 22:28:16 +02:00
Kamil Jarosz a3dddbd80d avm2: Roughly implement `TextField.*IndexAtPoint`
Both implementations currently use `screen_position_to_index`, which
is inaccurate, and that's why these methods still produce a stub warning.
However, this implementation makes some games work, is a lot better than
a perfect implementation which would require a lot of work and time,
and infinitely better than no implementation at all.
2024-06-29 22:28:16 +02:00
Kamil Jarosz a9708a8017 debug_ui: Draw bounds on hover
When the user hovers on world bounds and highlight bounds,
debug rects signifying their positions are automatically drawn.
2024-06-29 21:57:32 +02:00
Kamil Jarosz 59a8d1e8a1 debug_ui: Improve debug rect bounds calculation
Before this patch, it was possible that some objects did not have a
debug rect despite existing on the stage and interacting with the user.
That was the case for instance for buttons with hit bounds and no up state.

This patch ensures that debug rect is at least as big as highlight bounds,
which are used to highlight focused objects on the stage.
2024-06-29 21:57:32 +02:00
Kamil Jarosz 056650337e chore: Remove unnecessary returns 2024-06-29 11:29:02 +02:00
Kamil Jarosz 13c23664cc tests: Add avm2/edittext_get_line_index_of_char test
Verifies the behavior of TextField.getLineIndexOfChar().
2024-06-29 11:29:02 +02:00
Kamil Jarosz ee8c9e21fa avm2: Implement TextField.getLineIndexOfChar() 2024-06-29 11:29:02 +02:00
Crowdin Bot f2bbd241f9 chore: Update translations from Crowdin 2024-06-29 10:18:55 +02:00
TÖRÖK Attila 7374c89ee8 web/extension: Check last version on AMO, skip submission if not yet approved 2024-06-29 09:16:31 +02:00
Daniel Jacobs 948987b743 extension: Only show onboarding page on first install 2024-06-28 13:31:23 -04:00
Crowdin Bot 02f15fd27c chore: Update translations from Crowdin 2024-06-28 00:59:58 +02:00
Kamil Jarosz db13a4e9e6 desktop: Properly map alphabetic characters as input
This patch fixes handling alphabetic inputs, so that
uppercase letters are not ignored.
2024-06-28 00:30:31 +02:00
Kamil Jarosz b75d4cdce0 desktop: Handle properly keys with modifiers
FP recognizes modifiers for numpad keys, but ignores them for non-numpad
keys, so that pressing Shift+3 produces key codes for Shift and Key3,
but pressing Shift+Numpad7 produces keycodes for Shift and Home.
2024-06-28 00:30:31 +02:00
Kamil Jarosz cda7ac6024 desktop: Ignore AltGr key
FP ignores AltGr as a key, and issues keys based on the character
produced by its combination with other characters.
2024-06-28 00:30:31 +02:00
Kamil Jarosz 1d41d23332 tests: Add avm2/edittext_line_methods test
This test verifies the behavior of line-related methods of TextField:
* getLineLength(),
* getLineOffset(), and
* getLineText().
2024-06-27 22:02:41 +02:00
Kamil Jarosz b55d4d1021 avm2: Fix TextField.getLineText()
This patch makes the implementation more performant, simpler, and
fixes its behavior related to returning the line delimiter and tabs.
2024-06-27 22:02:41 +02:00
Kamil Jarosz 4f457da07b tests: Remove avm2/textfield_getlinetext test
The output.txt of this test was invalid,
because it skipped a carriage return after one of the lines.
This has of course something to do with the whole CR/LF/CRLF newline
madness, as the trailing CR formed a CRLF with the "real" newline
character LF, and (I suspect) git replaced it with LF ignoring
CR completely, which badly influenced the current implementation.

This test will be replaced with a proper test when
the implementation is fixed.
2024-06-27 22:02:41 +02:00
Kamil Jarosz 9a6708f4b1 avm2: Implement TextField.getLineOffset() 2024-06-27 22:02:41 +02:00
Kamil Jarosz 57b371900b avm2: Implement TextField.getLineLength() 2024-06-27 22:02:41 +02:00
Kamil Jarosz 8569df9503 text: Add start and end text positions to LayoutLine
By adding start and end positions to LayoutLine, it's now easy to
calculate the line length, get its text, or search through lines.
2024-06-27 22:02:41 +02:00
Kamil Jarosz dcafb3d291 text: Assume at least one span is present during layout
After some past refactors, it's true now that during layout there's
at least one text span, which is ensured by the span normalization.
This refactor simplifies code.
2024-06-27 22:02:41 +02:00
Kamil Jarosz a606fcc8ed text: Implement Debug for LayoutContent 2024-06-27 22:02:41 +02:00
Kamil Jarosz 47ea369047 text: Add text positions to all layout boxes
This refactor adds positions to all layout boxes, not only texts.
Positions for bullets and drawings are used only for obtaining
information about their location relative to other layout boxes,
so that searching and other various operations on boxes are easier.
2024-06-27 22:02:41 +02:00
Aaron Hill 8bea6d4ef9 avm2: Parse and load DoAbc/DoAbc2 tags during frame execution
Parsing and loading the definitions from an DoAbc/DoAbc2 tag
is visible to ActionScript - any definitions will become accessible,
and the script initializer will be run when accessing any of those
definitions.

We now delay the actual parsing/loading traits from DoAbc2 tags.
This is run before we process any SymbolClass tags, and only runs
the first time that we execute a frame.

This also fixes an issue where we would incorrectly produce a
`VerifyError` during preloading when trying to load a superclass
for a `Class` for a tag in a future frame. That frame might require
other class definitions to be populated first (e.g. by a `Loader`
in the first frame).
2024-06-27 21:44:40 +02:00
TÖRÖK Attila e75299702b chore: Bump bitstream-io to 2.4.2 2024-06-27 21:19:36 +02:00
TÖRÖK Attila b68583e2ee Revert "ci: Release and test with Rust 1.78 instead of stable"
This reverts commit 4448e37d98.
2024-06-27 21:19:36 +02:00
TÖRÖK Attila c02c6d2d44 chore: Update `wgpu-core` and `wgpu-hal` to 0.21.1 2024-06-27 21:19:36 +02:00
Crowdin Bot c470adfe71 chore: Update translations from Crowdin 2024-06-27 10:06:38 +02:00
Crowdin Bot c6ed64cced chore: Update translations from Crowdin 2024-06-26 03:16:13 +02:00
Kornelius Rohrschneider 76d3cd95a4 tests: Add form loader encoding tests
Several form loader encoding tests have been added. They test whether
the form loader uses the correct encoding to decode text files with
different SWF versions and settings.
One test has been marked as known failure as it tests how Flash decodes
invalid UTF-8 characters (when decoding as UTF-8), which is not yet
implemented in Ruffle.
2024-06-26 02:37:44 +02:00
Kornelius Rohrschneider 4d6dd38616 core: Make the form loader use Windows-1252 if SWF version <= 5
The form loader now loads files using Windows-1252 if the SWF version is
smaller than 6. This roughly matches Flash's behaviour (Flash uses
Windows-1252 on Windows, on macOS a slightly different custom encoding
is used).
Previously, UTF-8 has been (wrongly) used for all SWF files if
System#useCodepage hasn't been set to true, leading to incorrectly
displayed characters.
2024-06-26 02:37:44 +02:00
Kornelius Rohrschneider 0b30b7fdda core: Use HTTP response encoding if existing
If System#useCodepage has been set to true, the form loader now uses the
encoding specified in the HTTP response content type field, if existing,
to decode remote text files. chardetng is now (only) used if the HTTP
response doesn't specify any encoding or if the file is local.
2024-06-26 02:37:44 +02:00
Kornelius Rohrschneider 870bdae6fd core: Add support of non-UTF-8 encodings to the form loader
Flash's form loader loads text files in the local system codepage if
System#useCodepage has been set to true. Previously, Ruffle always
(wrongly) used UTF-8, leading to incorrectly displayed characters.
This has been fixed. Ruffle now supports loading files with an encoding
other than UTF-8.
As Ruffle doesn't always have access to the system codepage and as it's
not reliably the correct encoding, the crate chardetng has been added.
It's used instead of the system codepage to detect the encoding, and the
data is converted into UTF-8.
2024-06-26 02:37:44 +02:00
TÖRÖK Attila 837c922b55 chore: web: Regenerate `package-lock.json`
Like this:
  $ rm -rf package-lock.json node_modules/
  $ npm update
  $ npm install --save --save-dev --save-peer
2024-06-25 19:39:11 +02:00
Daniel Jacobs 38e48099d0 chore: Fix formatting 2024-06-24 20:17:34 -04:00
Daniel Jacobs 3b6cc37324 extension: On Chrome, adding permissions for a specific site adds many 2024-06-24 20:17:34 -04:00