summaryrefslogtreecommitdiff
path: root/modules/gdscript
AgeCommit message (Collapse)Author
2022-05-24GDScript: Don't show redundant await warning on unknown typesGeorge Marques
Also avoid it when the type is known to be a signal.
2022-05-23GDScript: Fix lambda captures in default argument valuesGeorge Marques
2022-05-23GDScript: Fix `if` after lambda being seen as ternaryGeorge Marques
2022-05-23GDScript: Do not allow standalone lambdasGeorge Marques
They cannot be accessed in this case, so an error is shown to avoid misleading the uses, especially in case of named lambdas.
2022-05-20Add a new HashSet templatereduz
* Intended to replace RBSet in most cases. * Optimized for iteration speed
2022-05-19Use range iterators for RBSet in most casesAaron Record
2022-05-18Merge pull request #61025 from Chaosus/gds_fix_extend_crashRémi Verschelde
2022-05-18Merge pull request #55201 from Scony/fix-unreachable-code-false-positiveRémi Verschelde
2022-05-18Fix crash when extending inner class in GDScriptYuri Rubinsky
2022-05-17Merge pull request #55134 from KoBeWi/script_pillow_or_somethingRémi Verschelde
Always soft-reload scripts
2022-05-16Merge pull request #61003 from vnen/gdscript-await-stack-fixRémi Verschelde
2022-05-16Replace most uses of Map by HashMapreduz
* 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-13GDScript: Fix stack manipulation for `await`George Marques
The stack now contains three special addresses that should no be copied to the state, since it contains references that creates cycles. They can be recreated when the function is resumed. This commit also removes the clearing of stack from the GDScriptFunctionState destructor, since it should be cleared when the function exits. The state stack should only be cleared manually if the instance is freed before the state resumes (which is already being done). Otherwise this would destruct the stack twice, causing crashes.
2022-05-12Fix first value updateJoJoX
2022-05-12Fix signal completion in GDScript editorYuri Rubinsky
2022-05-12Add a new HashMap implementationreduz
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-12Fix incorrect precedence of pow operator in GDScript Yuri Rubinsky
2022-05-11Implement exponential operator (**) to GDScript/ExpressionsYuri Roubinsky
2022-05-11Merge pull request #59863 from cdemirer/fix-match-multiple-bind-single-patternRémi Verschelde
Fix issues with multiple bind patterns in match statement
2022-05-11Merge pull request #60229 from Dorodri/improve-gdscript-range-descriptionRémi Verschelde
2022-05-11Merge pull request #60732 from CalebJohn/matching_signature_regression_testRémi Verschelde
2022-05-06Merge pull request #60609 from nathanfranke/string-quotesRémi Verschelde
2022-05-04Merge pull request #60723 from reduz/refactor-module-initializationRémi Verschelde
2022-05-04Refactor module initializationreduz
* Changed to use the same stages as extensions. * Makes the initialization more coherent, helping solve problems due to lack of stages. * Makes it easier to port between module and extension. * removed the DRIVER initialization level (no longer needed).
2022-05-03Add regression test for gdscript valid function signatureCalebJohn
Previously, there was an issue where the gdscript analyzer incorrectly riased a validation error for code that had a default Dictionary, Array, or custom type.
2022-05-03quote strings inside arrays and dictionariesNathan Franke
2022-05-03Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio
These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
2022-05-02Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde
Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
2022-04-30Improve description for GDScript built-in rangeEduardo Rodrigues
Rewrites the definition of how the function works. Reworks the style of the examples and adds a negative range example. Changes the while loop to a range loop in the array backwards example.
2022-04-28Fix cppcheck const parametersMarkus Sauermann
Convert method signature parameters to const where it is possible # Conflicts: # drivers/gles3/rasterizer_canvas_gles3.cpp # drivers/gles3/rasterizer_canvas_gles3.h # editor/plugins/animation_state_machine_editor.cpp # editor/plugins/animation_state_machine_editor.h
2022-04-27Merge pull request #60396 from vnen/gdscript-self-lambdaRémi Verschelde
2022-04-27Merge pull request #59613 from PastMoments/dict-arr-const-fixRémi Verschelde
2022-04-26Merge pull request #60418 from ShimmyShaman/masterRémi Verschelde
2022-04-25Merge pull request #60445 from nathanfranke/minor-changesRémi Verschelde
small changes: improve OS.get_name classref, misc/scripts fixes, remove trailing quote
2022-04-24GDScript: Allow using self in lambdasGeorge Marques
2022-04-22improve OS.get_name classref, misc/scripts fixes, remove trailing quoteNathan Franke
2022-04-22improved error msg for gdscript load_source_codeShimmyShaman
2022-04-20Fix typo in `GDScript::range` docYuri Roubinsky
2022-04-19Fixes GDScript define nested dictionary and array as constants #50285PastMoments
2022-04-15Merge pull request #60007 from aaronfranke/gds-op-adj-tr3dRémi Verschelde
GDScript: Rename OPCODE_TYPE_ADJUST_TRANSFORM to have a 3D suffix
2022-04-12Narrow FileAccess scope to prevent deadlocks.bruvzg
2022-04-11Make FileAccess and DirAccess classes reference counted.bruvzg
2022-04-08GDScript: Fix method call on singletonsGeorge Marques
2022-04-07GDScript: Rename OPCODE_TYPE_ADJUST_TRANSFORM to have a 3D suffixAaron Franke
2022-04-07Add built-in Variant types to autocompletion listDavid Maziarka
Co-authored-by: Gustav <gusan092@student.liu.se>
2022-04-06Merge pull request #59947 from vnen/gdscript-static-methods-classdbRémi Verschelde
2022-04-06GDScript: Add support for static method calls in native typesGeorge Marques
2022-04-06Fix some issues found by cppcheck.bruvzg
2022-04-04Merge pull request #59885 from Jayman2000/autoload-inheritance-messageRémi Verschelde
2022-04-04Improve autoload inheritance error messageJason Yundt
Autoloaded scripts should always inherit from Node. When you run a project that tries to autoload a script which doesn’t inherit from Node, then Godot gives an error. Before this change, the error said “Script does not inherit a Node”. That error message is a little bit misleading. If a class inherits a Node, then one of its superclasses has a Node. If a class inherits _from_ Node, then one of its superclasses is Node. This change corrects that mistake. Fixes #59884.