Commit Graph

564 Commits

Author SHA1 Message Date
Adam Scott 37248d7c87 Add `@GlobalScope` `is_same(a, b)` and `Variant::identity_compare()` 2023-01-25 10:46:21 -05:00
Jan Haller 83026126d4 Add tests to ensure bound methods and signals are valid identifiers 2023-01-23 21:19:57 +01:00
bruvzg daad4aed62
Cleanup and unify keyboard input.
- Unify keycode values (secondary label printed on a key), remove unused hardcoded Latin-1 codes.
- Unify IME behaviour, add inline composition string display on Windows and X11.
- Add key_label (localized label printed on a key) value to the key events, and allow mapping actions to the unshifted Unicode events.
- Add support for physical keyboard (Bluetooth or Sidecar) handling on iOS.
- Add support for media key handling on macOS.

Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-01-23 15:08:12 +02:00
Rémi Verschelde 5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
Rémi Verschelde 65883cc73b
Merge pull request #71598 from bruvzg/gdscript_bidi_override
Implement BiDi override mode for GDScript source.
2023-01-19 19:33:18 +01:00
Rémi Verschelde 8b92316368
Merge pull request #71565 from RedworkDE/doc-arraymesh-add-surface
Fix LOD sort order; checks in add_surface; and document all parameters of `ArrayMesh::add_surface_from_arrays`
2023-01-19 19:32:37 +01:00
bruvzg db7d8c2d87
[GDExtension] Expose some low level functions and String operators. 2023-01-19 12:50:49 +02:00
RedworkDE be4eb3bbdd Fix LOD sort order; checks in add_surface; and document all parameters of `ArrayMesh::add_surface_from_arrays`
Also clarify some related documentation and expose the misssing `ArrayFormat::ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY`
2023-01-19 10:30:25 +01:00
bruvzg 5361ec9f43
Implement BiDi override mode for GDScript source. 2023-01-18 19:22:20 +02:00
kobewi b427d3585c Allow unindent without selection 2023-01-18 17:05:15 +01:00
Rémi Verschelde 517b7fc468
Merge pull request #71308 from hcoura/test-curve-2d
Add unit tests for Curve2D
2023-01-16 09:25:15 +01:00
Raul Santos 7560340ef6
Rename `center` method to `get_center` in Plane. 2023-01-15 17:18:50 +01:00
Paulb23 1aac10d73d Fixed adding extra quote when completing strings 2023-01-14 15:28:22 +00:00
Marius Hanl d2f246806c Added more node tests
Testing the following functions:
- reparent
- duplicate
- replace_by (also with keeping groups)
2023-01-14 00:23:58 +01:00
Henrique Coura d9ceddd86b Add unit tests for Curve2D 2023-01-13 13:54:45 -03:00
Rémi Verschelde 6a86dfad29
Fix typos with codespell
Also includes #71080.

Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
2023-01-09 08:39:07 +01:00
Juan Linietsky 2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
bruvzg 2718a7b7d3
Add support for the custom initial screen for the main window, fix primary screen detection. 2023-01-07 11:14:35 +02:00
Rémi Verschelde 798582acf0
Merge pull request #65609 from dalexeev/animated-sprite
`AnimatedSprite{2D,3D}` improvements
2023-01-05 15:00:31 +01:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Danil Alexeev 0d25d8e7fc
`AnimatedSprite{2D,3D}` improvements
* Add support for individual frame duration to `SpriteFrames`.
* Various minor improvements.
2023-01-05 13:13:25 +03:00
Rémi Verschelde 565ae3b767
Merge pull request #67694 from aaronfranke/its-time
Remove duplicate Month and Weekday enums
2023-01-03 23:21:19 +01:00
Rémi Verschelde 5e78f0f782
Merge pull request #70840 from MewPurPur/get-point-count-instead-of-points
Rename `get_points_count()` to `get_point_count()` in Gradient
2023-01-03 15:46:18 +01:00
Rémi Verschelde 7fb6d70398
Merge pull request #70152 from Maran23/4-x-tests-for-node
Initial tests for node
2023-01-03 12:40:44 +01:00
Marius Hanl eec42f1aab Add initial tests for Node
- Test simple and complex cases for:
-> add, remove, move, get, find, count, is_inside_tree
-> name, nodepath
-> verify the scene tree
- Simple tests for the processing setup
2023-01-03 07:50:20 +01:00
VolTer 1af833be95 Rename get_points_count() to get_point_count() internally 2023-01-02 16:52:05 +02:00
Marius Hanl b9be3ce75e Add tests for signals
- Adding signals
- Emitting signals
2022-12-29 16:07:45 +01:00
Aaron Franke 8d7d1b0bb2
Remove duplicate Month and Weekday enums
Well, they were duplicately-exposed, but triplicately-defined.
2022-12-26 15:16:25 -06:00
Yuri Rubinsky b6e06038f8
Merge pull request #70396 from jainl28patel/VisualShader-unit-test 2022-12-26 15:13:56 +03:00
jainl28patel e4f4fb580e Add unit test for VisualShader 2022-12-26 16:52:07 +05:30
Marius Hanl 5aa243f9da Added the possibility to define a default value in ProjectSettings.get_setting(), which is used when no setting is set.
Also added tests for the project settings.

Co-authored-by: Yuri Sizov <11782833+YuriSizov@users.noreply.github.com>
2022-12-21 19:49:57 +01:00
Paulb23 29f7bea241 Fix autocomplete with autobrace completion not adding closing pair 2022-12-19 14:20:52 +00:00
Rémi Verschelde 03cc4c3f3b
Merge pull request #70168 from Haydoggo/autocomplete-placement-fix
Fix autocomplete box placement
2022-12-17 12:23:15 +01:00
Hayden Leete 530b1f3f7a Fix autocomplete box placement 2022-12-17 12:33:29 +13:00
Haoyu Qiu 207e52c161 Fix String::word_wrap() for long words
- Changes `TextServer.string_get_word_breaks()`
  - Returns pairs of boundary start and end offsets
  - Accepts `chars_per_line` to return line breaks
- Removes `String::word_wrap()`

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-12-16 13:18:57 +08:00
Hendrik Brucker 0b07da8ebc [Tests] Get rid of several error messages when running the test suite 2022-12-12 19:17:50 +01:00
Rémi Verschelde 907298d673
Merge pull request #68747 from rune-scape/rune-stringname-unification
GDScript: Unify StringName and String
2022-12-09 18:06:48 +01:00
Rémi Verschelde 83b426bca5
Merge pull request #67906 from groud/simpler_gdextension_config
Remove unnecessary checks when exporting gdextension binaries and allow using a prefix to auto-detect files
2022-12-06 11:01:09 +01:00
rune-scape e79be6ce07 Unify String and StringName 2022-12-05 21:46:47 -05:00
Yaohua Xiong 91e9ad92f5 Refactor baking code for Curve2D
The main change is to caculate tangent directly from bezier curve, without going
through discretized polyline, avoiding pitfalls of discretization. A similar refacor
had been applied to Curve3D.

The test cases for Curve2D is updated, comparing floating point with is_equal_approxmiate()
instead of `==`, in order to avoid float precision problem.
2022-12-05 21:22:05 +08:00
bruvzg ecec415988
Use system fonts as fallback and improve system font handling.
Add support for font weight and stretch selection when using system fonts.
Add function to get system fallback font from a font name, style, text, and language code.
Implement system font support for Android.
Use system fonts as a last resort fallback.
2022-12-04 18:44:20 +02:00
Gilles Roudière fa4143cdeb Allow specifying a prefix to automatically detect library files for gdextension exports 2022-12-01 18:20:40 +01:00
Rémi Verschelde 4a8b725bc9
Merge pull request #68386 from MewPurPur/snappedi-snappedf
Implement snappedi, snappedf, and Vector[2/3/4]i.snapped
2022-11-24 18:54:49 +01:00
Bastiaan Olij a479f5af22 Improve logic for detecting and tracking extensions 2022-11-24 21:48:16 +11:00
Adam Scott 0c64304ba5 Fix error while selecting last empty line 2022-11-23 09:21:41 -05:00
Micky e791f4fce2 Double precision of `String.split_floats` 2022-11-20 12:29:50 +01:00
VolTer e26f0906f2 Implement snappedi, snappedf, and Vector[2/3/4]i.snapped 2022-11-19 06:18:55 +01:00
Rémi Verschelde d93bec61c3
Merge pull request #68432 from Geometror/generic-math-func-tests
Generic math function tests: Test float and double variants
2022-11-18 16:21:39 +01:00
Ninni Pipping f0099b28b1 Fix polygon generation in BitMap 2022-11-17 10:31:14 +01:00
clayjohn 9ce57050a5 Add GPUParticles to the OpenGL3 renderer.
This includes collision (2D SDF, Box, Sphere, Heightmap),
attraction (Box, Sphere), and all sorting modes.

This does not include 3D SDF collisions, trails, or
manual emission.
2022-11-14 23:28:25 -08:00
Hendrik Brucker 1f36dbdf23 Generic math function tests: Test float and double variants 2022-11-09 01:51:55 +01:00
kobewi d9f066d5fa Remove duplicate project settings definitions 2022-11-08 01:29:39 +01:00
Rémi Verschelde f814e15c7f
Merge pull request #67976 from alfredbaudisch/select-next-occurrence-better-test
Improve TextEdit::add_selection_for_next_occurrence test case
2022-11-06 16:10:58 +01:00
Rémi Verschelde 44a0b86f93
Merge pull request #68275 from Geometror/doctest-approx
[Tests] Replace Math::is_equal_approx with == and doctest::Approx
2022-11-06 15:58:00 +01:00
Hendrik Brucker f906ff8f89 [Tests] Replace Math::is_equal_approx with == and doctest::Approx 2022-11-05 02:28:00 +01:00
kobewi 8a47a12207 Add support for empty delimiter in String.split 2022-11-04 15:09:12 +01:00
Hendrik Brucker e62955b45b Add a test suite for `Math::` namespace functions
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2022-11-04 03:08:08 +01:00
Aaron Franke 9e952c8386
Allow getting Quaternion rotation in different Euler orders 2022-11-02 19:20:10 -05:00
Rémi Verschelde 08d56ac2f1
Merge pull request #66747 from aaronfranke/move-euler-order
Move EulerOrder enum to math_defs.h and global scope
2022-11-02 22:37:12 +01:00
Rémi Verschelde 18380817f2
Merge pull request #67274 from jbcolli2/Primitive_Tests
Unit Tests for all Primitive Meshes.
2022-11-02 22:37:06 +01:00
Rémi Verschelde 9ec7aadc06
Merge pull request #66017 from Mickeon/rename-image-copy-rect
Rename Image's `get_rect` to `get_region`
2022-11-02 22:36:57 +01:00
Aaron Franke 8556fdd4bc
Move EulerOrder enum to math_defs.h and global scope 2022-11-02 13:44:13 -05:00
Rémi Verschelde f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Rémi Verschelde 1bff95ad49
Merge pull request #66927 from jbcolli2/Path2d-Tests
Unit tests for Path2D class
2022-11-02 18:53:15 +01:00
Micky ebf86c96e9 Rename Image's `get_rect` to `get_region`
Also renames its parameter to from "rect" to "region".
2022-11-01 23:35:48 +01:00
Aaron Franke 83634119d4
Replace Quaternion Euler constructor with `from_euler` method 2022-11-01 09:28:12 -05:00
Rémi Verschelde 1211f9d9b6
Merge pull request #67800 from jbcolli2/ArrayMesh-UnitTests
Unit Tests for ArrayMesh class for Issue #43440
2022-10-31 11:58:28 +01:00
Rémi Verschelde f0dcefe5f8
Merge pull request #66380 from aaronfranke/basis-euler-test
Simplify Euler order test code in test_basis.h
2022-10-31 10:55:37 +01:00
Rémi Verschelde 273410ba5a
Merge pull request #67139 from PucklaMotzer09/insert_caret_at_carets
Add Caret Insert Below and Above shortcuts to TextEdit
2022-10-31 10:32:07 +01:00
Max Hilbrunner 11d74d606a
Merge pull request #67980 from DeeJayLSP/webpcase
Change all WEBP strings and comments to WebP
2022-10-29 19:28:47 +02:00
Clay John 04ac91f786
Merge pull request #67790 from kdada/fix-flash-window
Make creating window do not flicker when specify custom position
2022-10-28 13:02:58 -07:00
DeeJayLSP dd64ceab47 Change all WEBP strings and comments to WebP 2022-10-28 15:17:49 -03:00
Alfred Reinold Baudisch e46e70f8ee Improved TextEdit::add_selection_for_next_occurrence test case
It covers additional selections of different words, as well manually adding a cursor in between and selecting the next occurrence. The previous test also was outdated in regards of not testing the implicit call to `select_word_under_caret` made by `add_selection_for_next_occurrence` in case there's no selection.
2022-10-28 15:35:43 +02:00
Clay John 0486810697
Merge pull request #67644 from alfredbaudisch/add-selection-next-occurrence
Add Selection and Caret for Next Occurrence of Selection
2022-10-27 17:21:49 -07:00
Aaron Franke fae4ed5a98
Simplify Euler order test code in test_basis.h 2022-10-27 12:10:57 -05:00
jbcolli2 24a3556bea ArrayMesh unit tests 2022-10-24 15:15:05 -04:00
Wei Guo d7e39e313b Make window creation with custom position do not flash 2022-10-24 13:50:25 +08:00
Aaron Franke 7f9a8c99c9
Clean up Basis from Euler code 2022-10-21 17:54:49 -05:00
Alfred Reinold Baudisch 7d15ecc3af Add Selection and Caret for Next Occurrence of Selection
Adds the bind `add_selection_for_next_occurrence` to TextEdit, with CTRL+D as the default shortcut.

When the bind is performed, ff a selection is currently active with the last caret in text fields, searches for the next occurrence of the selection, adds a caret and selects the next occurrence.

If no selection is currently active with the last caret in text fields, selects the word currently under the caret.

The action can be performed sequentially for all occurrences of the selection of the last caret and for all existing carets. The viewport is adjusted to the latest newly added caret.

The bind and the behaviour is similar to VS Code's "Add Selection to Next Find Match" and JetBrains' "Add Selection for Next Occurrence". It takes advantage of the multi-caret API.

The default shortcut for `select_word_under_caret` has been changed to ALT+G, in order to give priority to CTRL+D for `add_selection_for_next_occurrence` to better align with popular IDEs and editors.
2022-10-21 08:26:53 +02:00
PucklaMotzer09 e5354cacd0 Add Caret Insert Below and Above shortcuts to TextEdit 2022-10-18 10:38:53 +02:00
Rémi Verschelde fde8838316 Merge pull request #67463 from aaronfranke/num-real-negative
Fix big negative numbers printing incorrect decimals in `num_real`
2022-10-17 17:31:47 +02:00
Paulb23 4bfb1d953c Fix undo redo not adjusting TextEdit viewport to caret 2022-10-16 19:30:03 +01:00
Aaron Franke c60ac64e8f
Fix big negative numbers printing incorrect decimals in num_real 2022-10-15 17:57:54 -05:00
jbcolli2 ad16187a4a PrimitiveMesh unit tests. 2022-10-14 12:23:36 -04:00
kobewi 072f6feaba Make some Image methods static 2022-10-14 14:34:15 +02:00
Rémi Verschelde f12c4e8b9a Merge pull request #67251 from groud/simplify_path_solve_urls
Make String.simplify_path keep the protocol identifier for urls
2022-10-13 15:24:18 +02:00
Gilles Roudière bf1a40c168 Make String.simplify_path keep the protocol identifier for urls 2022-10-13 12:23:49 +02:00
jbcolli2 92a466c162 Unit tests for Path2D module.
Co-authored-by: Matthew-Tave <tavematthew@gmail.com>
2022-10-12 22:00:34 -04:00
Paulb23 f3eb543e67 Fix select word under caret using caret col instead of line 2022-10-11 20:32:06 +01:00
Rémi Verschelde 58eff50bf1 Merge pull request #64268 from timothyqiu/is-finite
Add `is_finite` method for checking built-in types
2022-10-11 09:25:46 +02:00
Rémi Verschelde 4be5660223 Merge pull request #67145 from Paulb23/tab_textedit
Fix inserting tabs in TextEdit
2022-10-10 13:52:42 +02:00
Haoyu Qiu eac9adf7a1 Don't allow removing TextEdit's main caret 2022-10-10 08:30:23 +08:00
Paulb23 7333aa68f4 Handle tab in TextEdit 2022-10-09 17:46:40 +01:00
Haoyu Qiu 5da515773d Add `is_finite` method for checking built-in types 2022-10-08 13:25:08 +08:00
Paulb23 4a9d4e3dad Add mutliple Caret support to TextEdit 2022-10-05 17:19:26 +01:00
Rémi Verschelde 54418ea659 Remove NO_THREADS fallback code, Godot 4 requires thread support
This also removes `OS::can_use_threads` from the public API since it's always
true.
2022-10-03 11:23:26 +02:00
Rémi Verschelde d9a3888cea Merge pull request #66133 from aaronfranke/set-all
Delete `set_all`, `set_axis`, and `get_axis` methods from Vector2/3/3i/4/4i
2022-10-03 09:23:46 +02:00
Rémi Verschelde cf6978f286 Merge pull request #64833 from MarcusElg/naninfprinting
Improve string formatting (%f and %v) for inf and nan
2022-10-03 09:23:12 +02:00
Rémi Verschelde 166df0896c Fix typos with codespell
Using codespell 2.3-dev from current git.

And fix typo in `methods.py` for `vsproj=yes` option (still won't work
though).
2022-09-30 14:23:36 +02:00
bruvzg 8f5d56e04a
[GDExtension] Use function names with underscore for TextServer extension, add macros to generate wrappers for module functions. 2022-09-28 10:04:11 +03:00