903 Commits

Author SHA1 Message Date
Fabio Alessandrelli
fba070567d Merge pull request #51481 from Faless/mp/4.x_no_pup
[Net] Rename RPC "puppet" to "auth", drop "master".
2021-08-30 03:25:32 +02:00
Fabio Alessandrelli
03be31cf8d [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".
This commit completely removes the RPC_MODE_MASTER ("master" keyword),
and renames the RPC_MODE_PUPPET to RPC_MODE_AUTHORITY ("auth" keyword).

This commit also renames the "Node.[get|set]_network_master" methods to
"Node.[get|set]_network_authority".

This commit also renames the RPC_MODE_REMOTE constant to RPC_MODE_ANY.

RPC_MODE_MASTER in Godot 3.x meant that a given RPC would be callable by
any puppet peer on the master, while RPC_MODE_PUPPET meant that it would
be callable by the master on any puppet.

Beside proving to be very confusing to the user (referring to where it
could be called instead of who can call it) the RPC_MODE_MASTER is quite
useless. It is almost the same as RPC_MODE_REMOTE (anyone can call) with
the exception that the network master cannot. While this could be useful
to check in some case, in such a function you would anyway need to check
in code who is the caller via get_rpc_sender_id(), so adding the check
there for those rare cases does not warrants a dedicated mode.
2021-08-30 00:54:38 +02:00
David Cambré
6bde04d579 Fix VisualScriptPropertySet value hint 2021-08-29 15:47:51 +02:00
Haoyu Qiu
369377210d Fix misspelled "overriden"
In recent GDVIRTUAL PR and SkeletonModification3DJiggle doc.
2021-08-26 01:44:01 +08:00
Max Hilbrunner
4ca6691997 Fix Visual Script editor 2021-08-24 19:33:40 +02:00
Juan Linietsky
ac897715bb Merge pull request #51983 from reduz/remove-bind-vmethod
Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
2021-08-23 09:46:19 -03:00
reduz
399f322fbf Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
Juan Linietsky
bcf12edc68 Merge pull request #51970 from reduz/implement-gdvirtuals-everywhere
Replace BIND_VMETHOD by new GDVIRTUAL syntax
2021-08-22 09:31:44 -03:00
reduz
7a88123b88 Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Max Hilbrunner
30e5d6225e Fix VisualScriptEditor after namespaces 2021-08-20 13:11:29 +02:00
Max Hilbrunner
644c77571e Namespaces instead of underscore prefix for binds
Thanks to neikeq for the initial work.

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:09 +02:00
Anilforextra
cb30078171 Fix duplicate conditions. 2021-08-13 12:22:38 +05:45
Rémi Verschelde
a1ab6f186b Resource: Remove unused _use_builtin_script() virtual method
And another piece of dead code found while searching for "use_builtin".
2021-08-12 12:16:17 +02:00
Aaron Franke
029a6d8953 Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
K. S. Ernest (iFire) Lee
9b0b39a0ab Merge pull request #49343 from theoway/node_auto_arrangement_graph_edit
Node Auto Arrangement in GraphEdit/VisualScript/VisualShader
2021-08-10 15:42:04 -04:00
Umang Kalra
20b7a8da4c Automatic arrangement of nodes in VisualScript/VisualShaders editors
This PR and commit adds the functionality to arrange nodes in VisualScript/VisualShader editor. The layout generated by this 
feature is compact, with minimum crossings between connections
& uniform horizontal & vertical gaps between the nodes. 

This work has been sponsored by GSoC '21.

Full list of additions/changes:
• Added arrange_nodes() method in GraphEdit module.
    • This method computes new positions for all the selected
      nodes by forming blocks and compressing them.
      The nodes are moved to these new positions. 
    • Adding this method to GraphEdit makes it available for 
      use in VisualScript/VisualShaders editors and its other
      subclasses. 
• Button with an icon has been added to call arrange_nodes() in GraphEdit. 
    • This button is inherited by VisualScript/VisualShaders editors
       to invoke the method.
• Undo/redo is functional with this method.
    • By using signals in arrange_nodes(), position changes are registered 
       in undo/redo stack of the subclass that is using the method. 
• Metadata of the method has been updated in ClassDB
• Method description has been added to class reference of GraphEdit
2021-08-11 00:44:28 +05:30
Rémi Verschelde
58a50d9758 Merge pull request #51294 from aaronfranke/double-time 2021-08-09 23:02:43 +02:00
Aaron Franke
e55d64f187 Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Rémi Verschelde
b67b5adc05 Merge pull request #51190 from timothyqiu/vs-node
Validates VisualScript.add_node input node
2021-08-02 18:18:19 +02:00
Haoyu Qiu
61295c2a31 Validates VisualScript.add_node input node 2021-08-02 23:36:13 +08:00
Haoyu Qiu
85b310f28b Make action names translatable 2021-07-31 22:19:51 +08:00
Aaron Franke
b7131d531e Remove obsolete "dectime" method
Replaced by "move_toward"
2021-07-30 16:41:28 -05:00
Rémi Verschelde
6846557be1 doc: Use self-closing tags for return and argument
For the time being we don't support writing a description for those, preferring
having all details in the method's description.

Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
2021-07-30 15:29:52 +02:00
Rémi Verschelde
5fe634065c Merge pull request #50840 from Gallilus/VisualScript-drop-preload-nodes-change-action-name
Change "Add Preload Node" action to "Add Node(s)"
2021-07-26 08:29:31 +02:00
Gallilus
0bb9c1b0d9 Change "Add Preload Node" action to "Add Node(s)"
The action might also drop Custom Nodes
2021-07-25 13:47:57 +02:00
Rémi Verschelde
62be51da64 Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke
9e78ea9ebf Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
David Cambré
d87dd60102 Revert unnecessary changes to VisualScriptEmitSignal
Revert unnecessary changes to VisualScriptEmitSignal, commit 2032b56005b2f6add6b105a00f04c05f9b292eec
2021-07-23 19:34:27 +02:00
Rémi Verschelde
0f3463f3d4 Merge pull request #48972 from DavidCambre/Expose_VisualScriptCustomNode_TypeHints_m 2021-07-21 12:02:17 +02:00
Rémi Verschelde
1852ae4f67 Merge pull request #50686 from Calinou/use-standard-inf-nan-constants
Use the standard C `INFINITY` and `NAN` constants directly
2021-07-21 11:50:26 +02:00
Rémi Verschelde
5e9394fbe8 Merge pull request #49749 from DavidCambre/VisualScriptFunction_Call_Set_Get_Improvement-2
VisualScriptFunctionNodes Improvements
2021-07-21 11:22:59 +02:00
David Cambré
2e6b8bafd1 expose type hints for VisualScriptCustomNode
Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
2021-07-21 10:52:45 +02:00
Hugo Locurcio
6fd929116e 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
David Cambré
f0428a5c94 Improve and streamline VisualScriptFuncNodes Call Set Get
This PR improves and streamlines the workflow for VisualScriptFunctionNodes Call Set Get
Uniform design.
Drag in set-get from tree is now working.
Removes redundant method_select popup.
2021-07-21 10:15:36 +02:00
Nick Huelin
35565d39b4 Fix visual script icons
This pull request fixes an issue where the visual script icons weren't representative of their data.
2021-07-20 17:23:42 -04:00
Rémi Verschelde
ce29cc2228 Merge pull request #50581 from DavidCambre/VisualScript-Drop-Custom-Nodes
Allow dropping custom node scripts in VisualScript editor
2021-07-20 12:46:50 +02:00
Rémi Verschelde
bc059e63e6 Merge pull request #50566 from reduz/optimize-stringname-usage
Optimize StringName usage
2021-07-19 15:20:25 +02:00
reduz
c5931d7c14 Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Yuri Roubinsky
0834e15f6c Prevents some warnings from appearing in visual scripts 2021-07-18 19:41:51 +03:00
David Cambré
df5a4b0a14 VisualScript-Drop-Custom-Nodes
Allows to drop custom node scripts directly in VisualScript
2021-07-18 15:48:35 +02:00
Tomasz Chabora
7f3186137e Document remaining Visual Script classes 2021-07-13 23:43:46 +02:00
reduz
41e6f189fc Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
Rémi Verschelde
e14ce52b7e Merge pull request #50398 from Faless/mp/4.x_networked_rename
[Net] NetworkedMultiplayerPeer(s) renames
2021-07-12 19:22:12 +02:00
Fabio Alessandrelli
9a35f88f15 [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +02:00
Rémi Verschelde
13fc12b731 Merge pull request #50342 from Chaosus/vs_fix_function
Fix creating a new function in visual scripts
2021-07-10 15:13:33 +02:00
Yuri Roubinsky
41255a164a Fix creating a new function in visual scripts 2021-07-10 14:45:53 +03:00
Rémi Verschelde
72da5b725d Merge pull request #50041 from aaronfranke/prop-usage-flags
Use `PROPERTY_USAGE_NONE` instead of `0` for no property usage
2021-07-01 21:29:32 +02:00
Aaron Franke
09c8270756 Use PROPERTY_USAGE_NONE instead of 0 for no property usage
Also use const more often.
2021-07-01 14:13:27 -04:00
Dipal M Zambare
47d8d98121 Fixes Visual script nodes operator mismatch issue #49943 2021-06-29 15:01:34 +05:30
kleonc
34ab1c994c VisualScriptEditor Fix in graph position calculation (do not skip zoom) 2021-06-23 22:01:15 +02:00