Commit Graph

5334 Commits

Author SHA1 Message Date
ddbb4878f2 Fix array variant reuse in constructor 2022-01-26 07:24:37 +08:00
051ef479c9 Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object.
This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary.
A few small changes also had to be made to other files, due to the changes cascading down all the includes.
2022-01-25 09:03:36 -07:00
9456454109 Fix translation with multiple sources for the same language.
Remove unnecessary locale length checks.
Add "C" -> "en" locale remap.
2022-01-24 18:58:16 +02:00
cba8280515 [Windows] Add support for handling network share paths. 2022-01-24 16:22:59 +02:00
dc1c4cfbfa Fix action exact match 2022-01-24 05:55:37 -06:00
57a057f7ff Merge pull request #56754 from madmiraal/fix-45592 2022-01-24 10:05:42 +01:00
ce42ab238a Merge pull request #56931 from lyuma/etcpak_po2
Enforce mult-of-4 requirements on etcpak input.
2022-01-23 09:31:35 +01:00
b1b20f5f91 Pad etcpak input to 4x4 blocks. Fixes #49981 2022-01-22 17:20:17 -08:00
01e5e98312 [Net] Fix get_response_body_length for large files.
Parsing was fixed, but not the return value for the exposed getter.
2022-01-23 01:30:35 +01:00
668d6a1c5c Merge pull request #56337 from cdemirer/fix-array-dictionary-id 2022-01-23 00:46:53 +01:00
f056cb8ebc Don't sort printed Dictionary 2022-01-22 13:45:02 +01:00
73d00131c6 Merge pull request #35012 from Xrayez/press-any-key 2022-01-20 22:51:01 +01:00
cfb986c631 Merge pull request #51452 from omar-polo/fix-macros 2022-01-20 22:50:39 +01:00
0e659b4230 Fix false reporting unclaimed StringName at exit due to static refs 2022-01-20 22:09:03 +01:00
d681d99e12 Merge pull request #52134 from RandomShaper/fix_naming 2022-01-20 22:01:37 +01:00
bd448e5535 Rename or refactor macros to avoid leading underscores
These are not used consistently and some can conflict with
system-specific defines.  While here, also delete some unused macros.
2022-01-20 20:29:15 +01:00
5d17fe7d0f Add Input.is_anything_pressed method 2022-01-20 20:55:14 +02:00
7b0ed2aa5e Rename Variant::is_ref() to is_ref_counted() 2022-01-20 18:46:25 +01:00
9e0973ca23 Merge pull request #56972 from lawnjelly/warn_unused 2022-01-20 15:34:41 +01:00
b411a731fe Add nodiscard to core math classes to catch c++ errors.
A common source of errors is to call functions (such as round()) expecting them to work in place, but them actually being designed only to return the processed value. Not using the return value in this case in indicative of a bug, and can be flagged as a warning by using the [[nodiscard]] attribute.
2022-01-20 13:07:49 +00:00
88eb9f7aef Delete orphaned property default for exit_code which is not exposed any more. 2022-01-19 23:25:54 -05:00
de48d5101b Fix locale always selecting translation instead of "en", when no match found. 2022-01-19 16:46:48 +02:00
a6f34ea2d0 Make add_importer and add_post_importer_plugin override existing importers. 2022-01-19 04:53:28 -08:00
ce2b5bdfa8 Merge pull request #52969 from bruvzg/locale_detection 2022-01-18 15:43:04 +01:00
28cd81c581 Merge pull request #56896 from akien-mga/dictionary-improve-VariantWriter-and-docs 2022-01-18 15:33:00 +01:00
fd5fb7d64a Merge pull request #56899 from touilleMan/fix-editor_node-set_exit_code 2022-01-18 14:48:55 +01:00
40c56ed410 Improve locale detection.
Use separate language, script and country lists.
Add locale selection dialog and property hint.
2022-01-18 14:30:00 +02:00
9912492e93 Merge pull request #56668 from akien-mga/array-slice-nicer-bound-checks 2022-01-18 13:22:35 +01:00
2ec7c6a6bc Replace use of OS::set_exit_code() by SceneTree::quit() in EditorNode 2022-01-18 13:09:30 +01:00
8898d6dadc Dictionary: Serialize empty dict as {} instead of {\n}
Also make sure to always convert multiline dictionaries to a single line for
its EditorHelp representation, as multiline values break formatting.
2022-01-18 11:31:21 +01:00
ff19feb8b8 Merge pull request #55939 from cdemirer/validated-array-add-fix
Fix validated version of array addition
2022-01-17 21:08:48 +01:00
fbe903909d Fix validated version of array addition 2022-01-18 03:00:39 +08:00
24f8a5979c Merge pull request #56809 from aaronfranke/replace-num-real 2022-01-17 16:55:34 +01:00
d9a4ff7583 Merge pull request #55020 from bruvzg/vlk_device_surface_check 2022-01-17 13:34:23 +01:00
8bdef23f7f Merge pull request #56012 from bruvzg/wt🤎4 2022-01-17 13:26:15 +01:00
13939734e0 Replace String::num_real code with a wrapper around String::num 2022-01-15 00:21:49 -06:00
40be15920f Remove support for PVRTC texture encoding and decoding
On the only platform where PVRTC is supported (iOS),
ETC2 generally supersedes PVRTC in every possible way. The increased
memory usage is not really a problem thanks to modern iOS' devices
processing power being higher than its Android counterparts.
2022-01-14 21:08:22 +01:00
d5fb68bbae Merge pull request #56779 from aaronfranke/rect2-grow 2022-01-14 20:56:03 +01:00
f41c72c538 Fix Actions mapped to triggers not using the full range 2022-01-14 15:36:20 +00:00
252c803d94 Remove zero size checks from Rect2 grow methods 2022-01-14 00:45:05 -06:00
5c3600b29f Fix mouse velocity not changing fast enough
- Uses all accumulated movements when calculating velocity
- Discards old accumulated movements
- Sets last mouse velocity to zero when there is no movement
2022-01-13 18:51:34 +00:00
5250cdd150 Use mouse event relative motion to calculate mouse velocity 2022-01-13 15:23:21 +00:00
dbab0a9487 Merge pull request #56740 from AnilBK/camera-pre-allocate 2022-01-13 11:13:31 +01:00
8a9c9a67ef CameraMatrix: Pre-allocate Vector in get_projection_planes(). 2022-01-13 10:14:59 +05:45
585231a172 Merge pull request #56492 from akien-mga/remove-author-docstrings 2022-01-12 15:24:17 +01:00
189662e5bd Merge pull request #56696 from AnilBK/use-init-lists 2022-01-12 10:04:45 +01:00
6c3a0460a8 Use List Initializations for Vectors. 2022-01-12 10:15:12 +05:45
a074ceefcd Merge pull request #56130 from Faless/mbedtls/2.28.0 2022-01-11 15:03:28 +01:00
46624388d4 Merge pull request #56322 from madmiraal/fix-42450 2022-01-11 11:33:59 +01:00
c6cefb1b79 Array: Relax slice bound checks to properly handle negative indices
The same is done for `Vector` (and thus `Packed*Array`).

`begin` and `end` can now take any value and will be clamped to
`[-size(), size()]`. Negative values are a shorthand for indexing the array
from the last element upward.

`end` is given a default `INT_MAX` value (which will be clamped to `size()`)
so that the `end` parameter can be omitted to go from `begin` to the max size
of the array.

This makes `slice` works similarly to numpy's and JavaScript's.
2022-01-10 22:42:03 +01:00