summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript.cpp
AgeCommit message (Collapse)Author
2022-04-06GDScript: Add support for static method calls in native typesGeorge Marques
2022-03-31Fix some issues found by clang sanitizers.bruvzg
2022-03-23Restrict the condition when checking if a script is a templatefabriceci
2022-03-09Remove VARIANT_ARG* macrosreduz
* Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-02Fix debugger not opening built-in scriptskobewi
2022-02-07[Net] Implement GDScript custom RPC callable.Fabio Alessandrelli
2022-02-04Highlight "namespace" as a GDScript keyword in the syntax highlighterHugo Locurcio
Like "trait" and "yield", "namespace" is currently not implemented but is still reserved for future use.
2022-02-04String: Add contains().Anilforextra
2022-01-13Merge pull request #56268 from KoBeWi/🚗complete_settersRémi Verschelde
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2022-01-02Improve editor template workflowfabriceci
Co-Authored-By: jmb462 <jmb462@gmail.com>
2021-12-27Remove autocomplete_setters_and_getters settingkobewi
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-11Show built-in script names in the debuggerkobewi
2021-11-08Merge pull request #54118 from ↵Rémi Verschelde
Pineapple/dont-ignore-type-mismatch-in-setter-master
2021-11-03Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio
This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-10-28clang-format: Disable alignment of operands, too unreliableRémi Verschelde
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`.
2021-10-22Don't ignore the type mismatch in setter functionBartłomiej T. Listwon
2021-10-19Merge pull request #52940 from groud/toast_notificationRémi Verschelde
2021-10-17Fix name used instead of doc for GDScript signalsopl-
2021-10-14Implement toast notifications in the editorGilles Roudière
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-10Merge pull request #51456 from SaracenOne/super_init_fixGeorge Marques
Call _init on base class if one does not exist.
2021-09-07[Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli
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".
2021-08-29Rename String::is_rel_path to String::is_relative_pathWilson E. Alvarez
2021-08-17Remove underscore hacksMax Hilbrunner
Way less cruft. :) Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-10Automatically call the _init function on base class if one does not exist.SaracenOne
2021-07-26Use Ref<T> references as iterators where relevantRémi Verschelde
And const when possible.
2021-07-25Fix instantiate line classJulien Nguyen
2021-07-25Use const references where possible for List range iteratorsRémi Verschelde
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-21Use the standard C `INFINITY` and `NAN` constants directlyHugo Locurcio
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.
2021-07-20[Net] Single `rpc` annotation. "sync" no longer part of mode.Fabio Alessandrelli
- 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).
2021-07-12[Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer.Fabio Alessandrelli
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-13Fix slow load/save of scenes with many instances of the same scriptPedro J. Estébanez
2021-06-11Rename Reference to RefCountedPedro J. Estébanez
2021-06-11Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-ioRémi Verschelde
Core: Move DirAccess and FileAccess to `core/io`
2021-06-11Merge pull request #49279 from Calinou/rename-string-is-abs-path-methodRémi Verschelde
Rename `String.is_abs_path()` to `String.is_absolute_path()`
2021-06-11Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde
File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
2021-06-03Rename `String.is_abs_path()` to `String.is_absolute_path()`Hugo Locurcio
This is more consistent with `NodePath.is_absolute()`.
2021-06-01[Net] Refactor RPCs, remove RSETsFabio Alessandrelli
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.
2021-05-25Rename File::get_len() get_length()Marcel Admiraal
2021-05-20Fix typos with codespellRémi Verschelde
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 ```
2021-05-17Make all file access 64-bit (uint64_t)Pedro J. Estébanez
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>
2021-05-05Highlight control flow keywords with a different colorHugo Locurcio
This makes them easier to distinguish from other keywords.
2021-04-08Add runner for GDScript testingGeorge Marques
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>
2021-04-05Style: Apply clang-tidy's `modernize-use-nullptr`Rémi Verschelde
2021-04-01Merge pull request #46991 from madmiraal/rename-invert-reverseRémi Verschelde
Rename Array.invert() to Array.reverse()