Commit graph

197 commits

Author SHA1 Message Date
Yuri Rubinsky c9ad370f20 Add a null checking to GDScript::_super_implicit_constructor 2022-06-15 17:28:40 +03:00
George Marques 68b86220c8
Merge pull request #57513 from trollodel/gdscript_get_propertyinfo_classname
Allow setting the PropertyInfo class_name from GDScript custom properties
2022-06-15 10:48:01 -03:00
Rémi Verschelde f2a7bb6b51
Merge pull request #59943 from jordigcs/gdscript_warning_enums
Add enum values (Ignore, Warn, Error) to GDScript warnings
2022-05-26 00:52:01 +02: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
Aaron Record 900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
Rémi Verschelde 5b02415fd0
Merge pull request #55134 from KoBeWi/script_pillow_or_something
Always soft-reload scripts
2022-05-17 15:09:09 +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
Hugo Locurcio 180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
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-03 01:43:50 +02:00
ShimmyShaman b3922a42e9 improved error msg for gdscript load_source_code 2022-04-22 16:10:48 +12:00
bruvzg 4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
bruvzg 9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
George Marques 4710e2b278
GDScript: Add support for static method calls in native types 2022-04-06 14:14:38 -03:00
jordi 14bad75206 Add enum values (Ignore, Warn, Error) to GDScript warnings 2022-04-06 10:57:33 -05:00
bruvzg 947d7c8329
Fix some issues found by clang sanitizers. 2022-03-31 18:35:56 +03:00
fabriceci dae97909bd Restrict the condition when checking if a script is a template 2022-03-23 11:03:44 +01:00
reduz 21637dfc25 Remove VARIANT_ARG* macros
* 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-09 18:39:13 +01:00
kobewi 98dd04c38c Fix debugger not opening built-in scripts 2022-03-02 17:57:56 +01:00
Fabio Alessandrelli 994638da4f [Net] Implement GDScript custom RPC callable. 2022-02-07 13:39:10 +01:00
Hugo Locurcio de45534fed
Highlight "namespace" as a GDScript keyword in the syntax highlighter
Like "trait" and "yield", "namespace" is currently not implemented
but is still reserved for future use.
2022-02-04 17:46:13 +01:00
Anilforextra adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
trollodel 1d6ac42b2a Allow setting the PropertyInfo class_name from GDScript 2022-02-01 11:57:14 +01:00
Rémi Verschelde f0382530a7
Merge pull request #56268 from KoBeWi/🚗complete_setters 2022-01-13 12:40:48 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
fabriceci 9d5b807059 Improve editor template workflow
Co-Authored-By: jmb462 <jmb462@gmail.com>
2022-01-02 21:52:09 +01:00
kobewi c055c912fb Remove autocomplete_setters_and_getters setting 2021-12-27 00:48:32 +01:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Lightning_A e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
kobewi ca4c63d654 Always soft-reload scripts 2021-11-19 17:45:16 +01:00
kobewi 3b320cd9fe Show built-in script names in the debugger 2021-11-11 20:47:09 +01:00
Rémi Verschelde 78ed2c05a2
Merge pull request #54118 from Pineapple/dont-ignore-type-mismatch-in-setter-master 2021-11-08 19:26:27 +01:00
Hugo Locurcio c012fbc8b2
Rename PROPERTY_USAGE_NOEDITOR to PROPERTY_USAGE_NO_EDITOR
This is consistent with other constants that include `NO`,
such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-11-03 23:06:17 +01:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
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-28 15:19:35 +02:00
Bartłomiej T. Listwon 42cce2891f Don't ignore the type mismatch in setter function 2021-10-22 12:44:33 +02:00
Rémi Verschelde 4387f9645b
Merge pull request #52940 from groud/toast_notification 2021-10-19 09:57:13 +02:00
opl- ad14b80e2a Fix name used instead of doc for GDScript signals 2021-10-17 05:54:27 +02:00
Gilles Roudière 0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Lightning_A c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
George Marques 0b484c5f5f
Merge pull request #51456 from SaracenOne/super_init_fix
Call _init on base class if one does not exist.
2021-09-10 10:40:32 -03:00
Fabio Alessandrelli bf9aae09ba [Net] Move multiplayer to core subdir, split RPCManager.
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-09-07 11:14:30 +02:00
Wilson E. Alvarez d11c1afc04
Rename String::is_rel_path to String::is_relative_path 2021-08-29 20:41:29 -04:00
Max Hilbrunner 5161c97c9c Remove underscore hacks
Way less cruft. :)

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:28 +02:00
SaracenOne 861bb3a488 Automatically call the _init function on base class if one does not exist. 2021-08-10 02:41:44 +01:00
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
Julien Nguyen 6938dd72f2 Fix instantiate line class 2021-07-25 14:20:31 +02:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Hugo Locurcio 4bd5e4fd9b
Use the standard C INFINITY and NAN constants directly
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-21 10:41:08 +02:00
Fabio Alessandrelli ddb68f76ff [Net] Single rpc annotation. "sync" no longer part of mode.
- 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-20 11:17:59 +02:00
Fabio Alessandrelli 88d68346ee [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +02:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00