summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #54118 from ↵Rémi Verschelde2021-11-081-0/+2
|\ | | | | | | Pineapple/dont-ignore-type-mismatch-in-setter-master
| * Don't ignore the type mismatch in setter functionBartłomiej T. Listwon2021-10-221-0/+2
| |
* | Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio2021-11-031-1/+1
| | | | | | | | | | This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
* | clang-format: Disable alignment of operands, too unreliableRémi Verschelde2021-10-281-9/+9
|/ | | | | | | | | Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
* Merge pull request #52940 from groud/toast_notificationRémi Verschelde2021-10-191-4/+4
|\
| * Implement toast notifications in the editorGilles Roudière2021-10-141-4/+4
| |
* | Fix name used instead of doc for GDScript signalsopl-2021-10-171-1/+1
|/
* Use range iterators for `Map`Lightning_A2021-09-301-74/+74
|
* Merge pull request #51456 from SaracenOne/super_init_fixGeorge Marques2021-09-101-0/+15
|\ | | | | Call _init on base class if one does not exist.
| * Automatically call the _init function on base class if one does not exist.SaracenOne2021-08-101-0/+15
| |
* | [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".
* | Rename String::is_rel_path to String::is_relative_pathWilson E. Alvarez2021-08-291-4/+4
| |
* | Remove underscore hacksMax Hilbrunner2021-08-171-7/+2
|/ | | | | | Way less cruft. :) Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
* Use Ref<T> references as iterators where relevantRémi Verschelde2021-07-261-14/+14
| | | | And const when possible.
* Fix instantiate line classJulien Nguyen2021-07-251-4/+4
|
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-6/+5
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-31/+30
|
* Use the standard C `INFINITY` and `NAN` constants directlyHugo Locurcio2021-07-211-2/+2
| | | | | | | The `Math_INF` and `Math_NAN` defines were just aliases for those constants, so we might as well use them directly. Some portions of the code were already using `INFINITY` directly.
* [Net] Single `rpc` annotation. "sync" no longer part of mode.Fabio Alessandrelli2021-07-201-9/+5
| | | | | | | | | | | | | | | | - Move the "sync" property for RPCs to RPCConfig. - Unify GDScript annotations into a single one: - `@rpc(master)` # default - `@rpc(puppet)` - `@rpc(any)` # former `@remote` - Implement three additional `@rpc` options: - The second parameter is the "sync" option (which also calls the function locally when RPCing). One of "sync", "nosync". - The third parameter is the transfer mode (reliable, unreliable, ordered). - The third parameter is the channel (unused for now).
* [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer.Fabio Alessandrelli2021-07-121-1/+1
|
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-8/+8
|
* Fix slow load/save of scenes with many instances of the same scriptPedro J. Estébanez2021-06-131-5/+9
|
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-10/+10
|
* Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-ioRémi Verschelde2021-06-111-1/+1
|\ | | | | Core: Move DirAccess and FileAccess to `core/io`
| * Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-111-1/+1
| | | | | | | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* | Merge pull request #49279 from Calinou/rename-string-is-abs-path-methodRémi Verschelde2021-06-111-1/+1
|\ \ | |/ |/| Rename `String.is_abs_path()` to `String.is_absolute_path()`
| * Rename `String.is_abs_path()` to `String.is_absolute_path()`Hugo Locurcio2021-06-031-1/+1
| | | | | | | | This is more consistent with `NodePath.is_absolute()`.
* | [Net] Refactor RPCs, remove RSETsFabio Alessandrelli2021-06-011-113/+8
|/ | | | | | | | | | In this PR: - Removed rset - rpc_config can now optionally configure transfer mode (reliable/unreliable/ordered) and channel (channels are not actually implemented yet.) - Refactor how the RPC id is computed to minimize the logic in Node and scripts that now only needs a single `get_rpc_methods` function.
* Rename File::get_len() get_length()Marcel Admiraal2021-05-251-1/+1
|
* Fix typos with codespellRémi Verschelde2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 2.0.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn GIRD 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 ```
* Make all file access 64-bit (uint64_t)Pedro J. Estébanez2021-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the types of a big number of variables. General rules: - Using `uint64_t` in general. We also considered `int64_t` but eventually settled on keeping it unsigned, which is also closer to what one would expect with `size_t`/`off_t`. - We only keep `int64_t` for `seek_end` (takes a negative offset from the end) and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means we only need to guard against passing negative values in `core_bind.cpp`. - Using `uint32_t` integers for concepts not needing such a huge range, like pages, blocks, etc. In addition: - Improve usage of integer types in some related places; namely, `DirAccess`, core binds. Note: - On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for big files on 32-bit Windows builds made with that toolchain. We might add a workaround. Fixes #44363. Fixes godotengine/godot-proposals#400. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Highlight control flow keywords with a different colorHugo Locurcio2021-05-051-0/+13
| | | | This makes them easier to distinguish from other keywords.
* Add runner for GDScript testingGeorge Marques2021-04-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is meant for testing the GDScript implementation, not for testing user scripts nor testing the engine using scripts. Tests consists in a GDScript file and a .out file with the expected output. The .out file format is: expected status (based on the enum GDScriptTest::TestStatus) on the first line, followed by either an error message or the resulting output. Warnings are added after the first line, before the output (or compiler errors) if the parser pass without any error. The test script must have a function called `test()` which takes no argument. Such function will be called by the test runner. The test should not have any dependency unless it's part of the test too. Global classes (using `class_name`) are registered before the runner starts, so those should work if needed. Use the command `godot --gdscript-generate-tests godot-source/modules/gdscript/tests/scripts` to update the .out files with the current output (make sure the output are the expected values before committing). The tests themselves are part of the doctest suite so those can be executed with `godot --test`. Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
* Style: Apply clang-tidy's `modernize-use-nullptr`Rémi Verschelde2021-04-051-1/+1
|
* Merge pull request #46991 from madmiraal/rename-invert-reverseRémi Verschelde2021-04-011-2/+2
|\ | | | | Rename Array.invert() to Array.reverse()
| * Rename Array.invert() to Array.reverse()Marcel Admiraal2021-03-211-2/+2
| | | | | | | | | | Does the same internally for List and Vector<>, which includes all PackedArray types.
* | Add typed arrays to GDScriptGeorge Marques2021-03-291-13/+21
|/ | | | | | | | - Use `Array[type]` for type-hints. e.g.: `var array: Array[int] = [1, 2, 3]` - Array literals are typed if their storage is typed (variable asssignment of as argument in function all). Otherwise they are untyped.
* Improve resource load cachereduz2021-02-111-1/+1
| | | | | | -Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
* Initialize class/struct variables with default values in modules/Rafał Mikrut2021-02-081-12/+1
|
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-10/+10
|
* Merge pull request #43890 from vnen/gdscript-builtin-functions-refactorRémi Verschelde2020-12-151-2/+5
|\ | | | | GDScript: Refactor builtin functions
| * GDScript: Refactor builtin functionsGeorge Marques2020-11-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | They are now called "utility functions" to avoid confusion with methods of builtin types, and be consistent with the naming in Variant. Core utility functions are now available in GDScript. The ones missing in core are added specifically to GDScript as helpers for convenience. Some functions were remove when there are better ways to do, reducing redundancy and cleaning up the global scope.
* | Merge pull request #41095 from ThakeeNathees/GDScript-DocumentationRémi Verschelde2020-12-021-9/+238
|\ \ | | | | | | GDScript(2.0) Documentation generation system
| * | Refactor DocData into core and editor (DocTools) partsThakee Nathees2020-12-021-16/+4
| | |
| * | Documentation generation for GDScriptThakee Nathees2020-11-291-9/+250
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - ClassDoc added to GDScript and property reflection data were extracted from parse tree - GDScript comments are collected from tokenizer for documentation and applied to the ClassDoc by the GDScript compiler - private docs were excluded (name with underscore prefix and doesn't have any doc comments) - default values (of non exported vars), arguments are extraced from the parser - Integrated with GDScript 2.0 and new enums were added. - merge conflicts fixed
* / Implement proper error print, Fixes a crash when no error messages are ↵AndreaCatania2020-11-281-2/+6
|/ | | | generated by the analyser.
* Refactored variant constructor logicreduz2020-11-091-1/+2
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-5/+5
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Merge pull request #41829 from RandomShaper/fix_40353Rémi Verschelde2020-10-011-2/+6
|\ | | | | Avoid warning about harmless unfulfilled yields