Commit graph

230 commits

Author SHA1 Message Date
rune-scape
847c9bd248 GDScript: Avoid using get_global_class_native_base 2022-11-27 03:55:53 -05:00
Rémi Verschelde
c7ceb94e37
Merge pull request #69079 from adamscott/fix-singleton-scene-cyclic-load
Fix singleton scene cyclic loading
2022-11-25 19:29:57 +01:00
Adam Scott
69bb7e5b11 Fix singleton scene cyclic loading 2022-11-25 12:43:55 -05:00
clayjohn
075cea1077 Ensure class name is printed in STATIC_CALLED_ON_INSTANCE warning 2022-11-24 12:06:11 -08:00
Adam Scott
2918689ff1 [godot#68977] Fix constants parameters 2022-11-23 08:15:54 -05:00
Rémi Verschelde
0b2dc0f017
Merge pull request #68970 from Chaosus/gds_fix_lambda_signal
Fix using signals in lambda functions
2022-11-22 10:00:05 +01:00
Yuri Rubinsky
f6c8c140f0 Fix using signals in lambda functions 2022-11-22 11:22:41 +03:00
Adam Scott
eb62d241c0 [godot#61386] Fix autoload scenes implicit types 2022-11-21 23:39:31 -05:00
Adam Scott
6d7c8533d5 Remove fix leftover that caused cyclic load issues 2022-11-18 23:37:00 -05:00
Rémi Verschelde
80b3813b15
Merge pull request #67714 from adamscott/fix-preload-cyclic-references-part2
Fix cyclic references in GDScript 2.0
2022-11-18 23:08:01 +01:00
Adam Scott
5704055d30 Fix cyclic references in GDScript 2.0 2022-11-18 16:41:31 -05:00
ocean (they/them)
13be0ab733 Fix ability to overload "script" variable 2022-11-17 17:21:12 -05:00
Rune
bce6f1792e GDScript compiler subclass bugfixes 2022-11-13 02:29:21 -08:00
Rémi Verschelde
7eb44fa47d
Merge pull request #68125 from kleonc/range-fix-single-arg-optimized-type-mismatch
[GDScript] Fix type mismatch in optimized single arg `range`
2022-11-02 14:18:24 +01:00
Rémi Verschelde
7c0e46f1c1
Merge pull request #68040 from adamscott/fix-property-getter-return-type
Fix property getter with custom return type
2022-11-02 14:16:37 +01:00
kleonc
c268e3a235 GDScript Fix type mismatch in optimized single arg range 2022-11-02 13:20:47 +01:00
Rémi Verschelde
213ba46672
Merge pull request #68065 from zCubed3/fix_min_max_crash
`GDScriptAnalyzer` Fix math utilities crashing when invalid args are passed
2022-10-31 10:59:27 +01:00
Rémi Verschelde
b43cc96535
Merge pull request #62695 from Spartan322/relax-constant-asserts
Allow non-constant string message for assert
2022-10-31 10:44:56 +01:00
zCubed3
b7f0ab13a4
Fix math utility functions crashing when invalid args passed 2022-10-30 15:18:03 -07:00
Adam Scott
26f0afdce2 [godot#68001] Fix property getter with custom return type 2022-10-29 20:38:26 -04:00
João Martins
a0c4002520 Clarified reason why a resource cannot be loaded. 2022-10-16 17:27:00 -04:00
clayjohn
0a51bb4ca5 Add STATIC_CALLED_ON_INSTANCE warning to highlight
when static functions are called directly from objects
2022-10-14 10:43:42 -07:00
clayjohn
be1e9acb7c Implement RETURN_VALUE_DISCARDED warning in GDscript 2022-10-13 11:56:45 -07:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
willnationsdev
339aba1656 Add GDScript resource export. 2022-09-17 17:10:30 -05:00
Abdelhafidh Belalia
4dca9975e7 Fix GDScript preload fails in standalone build unless files are present in directory
Fixes #56343.
2022-09-15 13:52:37 +02:00
Rémi Verschelde
6843a484ff
Merge pull request #65065 from Atlinx/fix/65010_enum-doesnt-show-up 2022-08-31 16:51:53 +02:00
Atlinx
6b5640c88c Fix inferred GDScript enum values not appearing in inspector
"enum_values" originally wasn't being forwarded to the new type inside "reduce_identifier_from_base", which caused hint strings derived from the new type to be blank, which ultimately caused an empty enum dropdown menu.
2022-08-30 17:40:38 -04:00
Aaron Franke
10a56981dc
Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
Antonio Dell'Annunziata
f81a166ab8
fix(gdscript): Infer type from preload const
When resolving the type of the attribute from the variant, the result_type.kind was overritten for no reason.
It is assumed that this only needs to be done, if the variant value is not valid to have any kind here.

Solves #63715
2022-08-07 16:09:24 +02:00
reduz
455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
George L. Albany
8035f1e36f
Allow non-constant string message for assert 2022-07-18 00:53:31 -04:00
Rémi Verschelde
4873886830
Merge pull request #62760 from cdemirer/fix-annotation-initializer-conflict
Fix priority of annotated type vs initializer type
2022-07-06 15:47:56 +02:00
cdemirer
f280975bf1 Fix priority of annotated type vs initializer type 2022-07-06 04:25:44 +03:00
Yuri Sizov
f85bafaa11 Add grouping annotations for class properties in GDScript 2022-07-05 22:01:40 +03:00
K. S. Ernest (iFire) Lee
9ddebc0c22 Add a const call mode to Object, Variant and Script.
For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script).

This mode ensures only const functions can be called, making it safe to use from the editor.

Co-Authored-By: reduz <reduzio@gmail.com>
2022-06-27 13:33:06 -07:00
bruvzg
860e24683f
Make enum/constant binds 64-bit. 2022-06-17 16:36:26 +03:00
Nathan Franke
3d61246bc4
use correct error for unused bind match, suppress with underscore 2022-06-03 13:28:33 -05:00
Rémi Verschelde
6369e495fd
Merge pull request #61279 from Trioct/fix-typed-array-assignment 2022-05-25 17:28:22 +02:00
Trioct
bcbfa641ec Fix const typed array assignment 2022-05-25 09:02:11 -05:00
George Marques
24bcbe971a
GDScript: Don't show redundant await warning on unknown types
Also avoid it when the type is known to be a signal.
2022-05-24 14:37:50 -03:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
reduz
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
Rémi Verschelde
f626e8ef91
Merge pull request #60396 from vnen/gdscript-self-lambda 2022-04-27 13:11:24 +02:00
George Marques
01d13ab2c1
GDScript: Allow using self in lambdas 2022-04-24 21:49:02 -03:00
PastMoments
b3704e664d Fixes GDScript define nested dictionary and array as constants #50285 2022-04-19 08:57:23 -04:00
George Marques
4710e2b278
GDScript: Add support for static method calls in native types 2022-04-06 14:14:38 -03:00
Rémi Verschelde
a647fb3e62 Fix typos with codespell
Using codespell 2.2-dev from current git.

Fix a couple incorrect uses of gendered pronouns.
2022-03-31 14:07:29 +02:00
George Marques
be718285f7
GDScript: Fix issues with completion and super calls
- Make call errors use the call node instead of the calle, which will be
  empty on super calls.
- Don't allow `super()` to be used within lambdas.
2022-03-30 11:58:29 -03:00