Commit graph

1400 commits

Author SHA1 Message Date
reduz
221a2a1742 Refactored variant constructor logic 2020-11-09 08:54:43 -03:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
reduz
05de7ce6ca Refactored variant setters/getters
-Discern between named, indexed and keyed
-Get direct access to functions for typed GDScript and GDNative bindings
-Small changes to some classes in order to work with the new setget binder
2020-11-07 15:16:15 -03:00
Yuri Roubinsky
38fb26794b Exposed randi_range to global funcs + renamed rand_range to randf_range 2020-11-06 17:06:26 +03:00
Rémi Verschelde
c35517f07e
Merge pull request #42724 from theoway/error_message_fix_call_recursive
Fixes the misleading message when a non-existing function name is passed to TreeItem.call_recursive()
2020-11-05 00:46:28 +01:00
Rémi Verschelde
bd13e82080
Merge pull request #41516 from Lunatoid/allow-object-new
Fixed ParseError when calling Object.new()
2020-11-03 13:08:48 +01:00
Mateo de Mayo
531958b2f0 Fix crash due to unreachable code in properties 2020-10-30 22:21:50 -03:00
Hugo Locurcio
a1d9c67f43
Optimize SVG using svgcleaner --multipass
This decreases the editor binary size by about 8 KB.
2020-10-25 10:02:37 +01:00
Yuri Roubinsky
4c65dc975c Shows ColorRect in Color constants autocompletion 2020-10-23 19:03:50 +03:00
Rémi Verschelde
ef62e93677
Merge pull request #42943 from vnen/gdscript-local-scope-fix
Fix handling of scope for local GDScript variables
2020-10-20 21:00:57 +02:00
George Marques
96884ef41e
Merge pull request #41983 from ThakeeNathees/array-const-folding-bug-fix
Array/Dictionary Nodes no more reduced to array/dictionary variant
2020-10-20 15:43:07 -03:00
George Marques
11c05642fe
GDScript: Fix handling of scope for local variables 2020-10-20 14:57:31 -03:00
George Marques
48b91b900d
GDScript: Add initialization for the language before debug tests
This ensures that the tests will use a full environment with correct
settings so global classes and autoloads can be properly found.
2020-10-20 10:07:03 -03:00
George Marques
5ddfc657ab
Merge pull request #42067 from ThakeeNathees/for-loop-stack-overriden-fix
GDScript: for loop override stack variable bug fix
2020-10-19 20:21:14 -03:00
Umang Kalra
c37f633216 Fixes the misleading error message for call_recursive method for TreeItems 2020-10-17 12:30:36 +05:30
Hugo Locurcio
802c1e4df1
Link the Random number generation tutorial in the class reference 2020-10-14 18:03:29 +02:00
George Marques
fe6109101f
Merge pull request #41881 from ThakeeNathees/crash-on-builtin-constructor
GDScript crash on builtin type constructor fix
2020-10-08 19:35:35 -03:00
Rémi Verschelde
3556bc48a1
Merge pull request #42439 from Xrayez/doc-gdscript-load-and-resloader-xref
Cross-reference GDScript `load` and `ResourceLoader.load` in classref
2020-10-04 20:48:07 +02:00
Paulb23
ee4a1c99a7 Switch from recursion to iterative for backfilling colour regions 2020-10-03 14:58:55 +01:00
Serhat
9f2cdfea82 Fixed padding bug of sprintf function 2020-10-02 00:25:42 +03:00
Rémi Verschelde
39ea52f36f
Merge pull request #41829 from RandomShaper/fix_40353
Avoid warning about harmless unfulfilled yields
2020-10-01 14:17:34 +02:00
Andrii Doroshenko (Xrayez)
a8404cf56c Cross-reference GDScript load and ResourceLoader.load in classref
The GDScript `load` mention is moved from the class `ResourceLoader`
description to the `ResourceLoader.load` method description instead,
where it is more likely to be found.
2020-09-30 23:03:36 +03:00
Pedro J. Estébanez
de4e54dd91 Avoid infinite loop in GDScript at shutdown 2020-09-26 19:21:09 +02:00
Hugo Locurcio
50f3a8e312
Improve documentation related to printing error/warning messages 2020-09-24 14:23:53 +02:00
Rémi Verschelde
cff43e5326
Merge pull request #41930 from RandomShaper/fix_gdscript_leaks
Fix leaks in GDScript
2020-09-18 16:18:57 +02:00
Rémi Verschelde
3e78963bb9
Fix typos with codespell
Using codespell 1.17.1.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2020-09-18 13:44:25 +02:00
Thakee Nathees
119936d939 GDScript: for loop override stack variable bug fix
Fix: #42050
2020-09-18 01:22:22 +05:30
Danil Alexeev
a4c5790350 Several documentation improvements 2020-09-14 20:02:19 +03:00
Thakee Nathees
3886a2f9f6 Array/Dictinoary no more reduced to array/dictionary variant
Fix: #41377
Fix: #20436
Fix: #41953
2020-09-11 19:46:20 +05:30
Pedro J. Estébanez
e25f5e791e Ensure cyclic dependencies between scripts are broken at exit 2020-09-10 01:34:42 +02:00
Pedro J. Estébanez
95828161d4 Prevent cyclic reference between script and its members 2020-09-10 01:26:07 +02:00
Rémi Verschelde
1c881c973b
GDScript: Fix MutexLock usage, fixes Clang 6 compat
Fixes #41852.
2020-09-09 14:56:57 +02:00
Rémi Verschelde
2410016638
Merge pull request #41709 from ThakeeNathees/dictionary-indexing-bug-fix
Fixed parser error when indexing a dictionary.
2020-09-08 21:38:14 +02:00
Thakee Nathees
279a11bbda GDScript crash on builtin type constructor fix
Fix: #41848
2020-09-08 18:33:53 +05:30
Rémi Verschelde
3c42d5789f
Merge pull request #38308 from bruvzg/sad_security_circus
Adds PCK encryption support (using script encryption key for export).
2020-09-07 17:12:01 +02:00
Pedro J. Estébanez
f76a13dea0 Avoid warning about harmless unfulfilled yields 2020-09-06 22:30:46 +02:00
Rémi Verschelde
859322343c
Merge pull request #41803 from ThakeeNathees/parameter-type-infer-bug-fix
GDScript: parameter infer type bug fix
2020-09-06 15:22:44 +02:00
Thakee Nathees
89489a3cac GDScript: parameter infer type bug fix
Fix: #41772
2020-09-06 13:26:52 +05:30
bruvzg
f043eabdd8
Adds PCK encryption support (using script encryption key for export).
Change default encryption mode from ECB to CFB.
2020-09-05 14:53:39 +03:00
Rémi Verschelde
605d7b7e82
Merge pull request #41760 from ThakeeNathees/null-dereference-on-gdscript-function-fix
null pointer dereference at GDScriptFunction::call crash fix
2020-09-04 14:45:31 +02:00
Thakee Nathees
75d4511cb5 null pointer dereference at GDScriptFunction::call fix 2020-09-04 15:24:09 +05:30
bruvzg
80b8eff6aa
[Complex Test Layouts] Change String to use UTF-32 encoding on all platforms. 2020-09-03 19:56:24 +03:00
Thakee Nathees
4fc14e8e11 fixed parser error when indexing a dictionary.
Fix: #41707
2020-09-03 18:04:54 +05:30
Rémi Verschelde
d84954a281
Merge pull request #41459 from Paulb23/nested_color_regions
Fix colour region end key seach and start key order
2020-09-03 11:32:04 +02:00
bruvzg
d73609c774
Fix GDScript codegen leak. 2020-09-02 22:42:49 +03:00
Andrii Doroshenko (Xrayez)
0cc05c5a31 Register GDScript test tools as test commands to run via command-line 2020-09-02 01:43:26 +03:00
Lunatoid
07053d0c6a Fixed ParseError when calling Object.new()
Fixes #41462 where calling Object.new() in GDScript gave an error.
I fixed it by adding exclusion when checking if the name is a builtin
type to exclude objects with a comment detailing why.
2020-09-02 00:11:58 +02:00
Andrii Doroshenko (Xrayez)
6b7e50ab34 Move GDScript tests to respective folder under modules 2020-09-02 01:09:32 +03:00
George Marques
635c6a0a18
Add GDScript disassembler 2020-09-01 14:36:30 -03:00
George Marques
745ca3059d
Change GDScript compiler to use codegen abstraction 2020-09-01 14:36:22 -03:00
George Marques
82273ebc01
Add GDScript code generation interface
Implement the abstraction by targeting the current VM.
2020-09-01 14:27:19 -03:00
George Marques
a889084864
GDScript: Don't mark function parameters as constant
They can be reassigned as if it were a local variable.
2020-09-01 09:26:28 -03:00
George Marques
c8e10aa20b
GDScript: Properly set class inheritance for global classes 2020-09-01 09:26:28 -03:00
George Marques
164cc8705b
GDScript: Check for missing exponent when parsing numbers
Also forbid multiple underscores in a row as numeric separator.
2020-09-01 09:26:28 -03:00
George Marques
f8fa5e4738
GDScript: Fix analysis of singleton dependencies
Sometimes a singleton might depend on another before they are fully
compiled so we can't rely on globals in this case.
2020-09-01 09:26:28 -03:00
George Marques
edb4caf24e
GDScript: Allow "extends" to be used inside inner class 2020-09-01 09:26:27 -03:00
George Marques
34dc689ad4
GDScript: Allow "self" to be used in class level 2020-09-01 09:26:27 -03:00
George Marques
1ddb9b1a52
GDScript: Don't try to parse constant scripts that aren't valid
Since it's likely that they won't parse correctly.
2020-09-01 09:26:27 -03:00
Hugo Locurcio
c4903a603b
Add link titles for all links in the class reference
This makes them display in a nicer way in the editor help.
(The title will display instead of the full URL.)
2020-08-31 14:22:07 +02:00
Hugo Locurcio
20d0f5bbd7
Cross-reference GDScript built-in rounding methods to ease discovery
This closes #19315.
2020-08-28 17:04:22 +02:00
Rémi Verschelde
46809332dd
Merge pull request #41547 from vnen/gdscript-2-fixes
Some more GDScript fixes
2020-08-28 10:36:09 +02:00
George Marques
5033d5c71c
GDScript: Fix crash when parsing properties 2020-08-26 16:08:19 -03:00
George Marques
b2b45987d0
GDScript: Show error when there's an inheritance cycle 2020-08-26 16:01:08 -03:00
George Marques
4a3fca47e5
GDScript: Add recursion depth limit for completion
To avoid crashes when there's a dependency loop.
2020-08-26 15:38:23 -03:00
George Marques
ff16ba1eaa
GDScript: Fix crash when completing code with signals 2020-08-26 15:13:42 -03:00
George Marques
8ccf88a206
GDScript: Fix issues when deriving from other scripts 2020-08-26 14:50:27 -03:00
Rémi Verschelde
9d8f3496e8
Merge pull request #40443 from SkyLucilfer/PluralsSupport
Added plurals and context support to Translation
2020-08-25 12:11:56 +02:00
George Marques
722be9aaef
GDScript: Don't fail to load constants if they're not a literal
It's still okay as long as it's a constant value. This should already
been validated by the analyzer.
2020-08-24 09:15:33 -03:00
George Marques
ca90c9c9a9
GDScript: Properly resolve external inner classes from preload
This gets the correct parser and class node when resolving from a full
GDScript reference.
2020-08-23 12:55:27 -03:00
George Marques
d36d7e2a1c
GDScript: Use pointer instead of references in cache
They are not supposed to be kept alive and this is cleaner and less
error-prone than unreferencing the elements.
2020-08-23 12:55:27 -03:00
George Marques
58f5c2bab6
Merge pull request #41238 from MarianoGnu/gdscript-export-resource
Fix GdScript Analyzier not detecting Resource subclass correctly
2020-08-23 11:04:52 -03:00
Paulb23
6cdcdbc242 Fix color region end key seach and start key order 2020-08-22 19:55:44 +01:00
George Marques
a880f590e4
GDScript: Make subscript access be properly type checked 2020-08-19 14:35:26 -03:00
George Marques
846856728b
GDScript: Show error when function return type is missing 2020-08-19 14:09:45 -03:00
George Marques
15b16ec0ce
GDScript: Fix signal parameters not respecting commas 2020-08-19 11:32:48 -03:00
George Marques
cd3f51c67c
GDScript: Check duplicate keys in dictionaries and enums 2020-08-19 11:14:16 -03:00
George Marques
f9ad0b30fa
GDScript: Allow preload() to be used with constant expressions 2020-08-19 10:45:00 -03:00
George Marques
a52e457ada
GDScript: Allow keywords to be used in $ notation 2020-08-19 10:19:05 -03:00
SkyJJ
ce3461dc88 Update GDScriptTranslationParserPlugin to use GDSriptParser instead of RegEx. 2020-08-19 03:10:51 +02:00
SkyJJ
396f2eee82 Update POT generation to handle context and plurals 2020-08-19 03:01:52 +02:00
George Marques
35176247af
GDScript: Allow enum values to be set to constant expressions
Also allow them to access previous values wihout referencing the enum.
2020-08-18 17:44:20 -03:00
George Marques
99d4ea8c79
GDScript: Allow supertype objects to be assigned to a subtype variable
It allows `get_node()` to be used with typed variables

This is marked as unsafe to warn the user.
2020-08-18 15:12:51 -03:00
George Marques
8bc9b3a2ae
GDScript: Allow implicit type conversion when constructing variants
Incidentally fix error message when no valid constructor is found which
was missing an end parenthesis.
2020-08-18 13:12:18 -03:00
George Marques
8088e9e6ac
GDScript: Add script to cache on reload
This ensures that scripts created without a resource loader are properly
included in the cache (such as builtin scripts) and are not tried to be
loaded from the disk.
2020-08-18 11:21:09 -03:00
George Marques
0f9923e67f
GDScript: Allow empty files to be valid scripts 2020-08-17 21:32:49 -03:00
George Marques
3abb3c0d6e
GDScript: Fix crash when superclass file is non-existent
Incidentally, allow EOF to be an end of statement.
2020-08-17 21:30:39 -03:00
George Marques
fda6f3b600
GDScript: Fix LSP getting wrong union value on unnamed enums 2020-08-17 21:10:30 -03:00
George Marques
d06ce2f11e
GDScript: Fix editor crash when writing @tool annotation 2020-08-17 21:02:49 -03:00
George Marques
f374021d52
GDSript: Prevent crash when completing unary operators 2020-08-17 20:49:04 -03:00
George Marques
9ecd042e78
GDScript: Allow "match" to be used as an identifier
This is needed to call the String.match() function.
2020-08-17 20:14:46 -03:00
George Marques
d45e1befe3
GDScript: Fix wrong argument check for formatting operator 2020-08-17 19:49:54 -03:00
Mariano Suligoy
a8c01df647 Fix GdScript Analyzier not detecting Resource subclass correctly 2020-08-13 19:46:57 -03:00
George Marques
adc1f95d97
Merge pull request #41224 from ThakeeNathees/fix-ctrl+click-not-working
Fix: ctrl + click not working on script member
2020-08-13 10:25:46 -03:00
Thakee Nathees
c6dc73f9be Fix: ctrl + click not working 2020-08-13 17:35:17 +05:30
George Marques
9413446b2d
Merge pull request #41104 from vnen/gdscript-assignment-tidy
Tidy up assignment operator check
2020-08-12 08:54:48 -03:00
Rémi Verschelde
cf05486d8e
Merge pull request #41055 from snichols/null-callee-fix
Fix crash with null callee
2020-08-11 15:15:43 +02:00
Paulb23
5cf2cf8646 Fix colour region continuation over blank lines, issue 41120 2020-08-08 15:36:46 +01:00
George Marques
69c81309cc
Merge pull request #40673 from ThakeeNathees/gdscript-op-eval-validation
GDScript operator evaluation validation bug fix
2020-08-08 10:52:40 -03:00
George Marques
1f14068727
Merge pull request #40951 from bruvzg/gds_cleanup
[GDScript] Add static HashMap cleanup.
2020-08-08 10:44:57 -03:00
George Marques
3aef60591b
GDScript: Tidy up assignment operator check
The operator is already gathered by the parser, no need to do it again
in the analyzer.
2020-08-08 10:37:51 -03:00