summaryrefslogtreecommitdiffstats
path: root/modules/visual_script/visual_script_nodes.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-70/+134
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+67
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-422/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Rename InputFilter back to InputRémi Verschelde2020-04-281-5/+5
| | | | | | | | | | | | | | | | It changed name as part of the DisplayServer and input refactoring in #37317, with the rationale that input no longer goes through the main loop, so the previous Input singleton now only does filtering. But the gains in consistency are quite limited in the renaming, and it breaks compatibility for all scripts and tutorials that access the Input singleton via the scripting language. A temporary option was suggested to keep the scripting singleton named `Input` even if its type is `InputFilter`, but that adds inconsistency and breaks C#. Fixes godotengine/godot-proposals#639. Fixes #37319. Fixes #37690.
* Deconstruct VSNodes for new Variant typesSwarnim Arun2020-04-021-0/+3
|
* Replace NULL with nullptrlupoDharkael2020-04-021-4/+4
|
* Refactored input, goes all via windows now.Juan Linietsky2020-03-261-5/+5
| | | | Also renamed Input to InputFilter because all it does is filter events.
* Refactored Input, create DisplayServer and DisplayServerX11Juan Linietsky2020-03-261-1/+1
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Signals: Port connect calls to use callable_mpRémi Verschelde2020-02-281-3/+1
| | | | | | | | | Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-49/+49
| | | | objects and made them default.
* Fix VisualScriptClassConstant to be updated properlyYuri Roubinsky2020-02-101-2/+21
|
* Fix GlobalConstant/BasicTypeConstant return type in visual scriptsYuri Roubinsky2020-01-301-4/+24
|
* Fix ClassDB API portability with some android and editor classesIgnacio Etcheverry2020-01-191-5/+11
| | | | | | | | | | | | | | | | | | - `EditorNavigationMeshGenerator` was being registered as part of the Core API, even after d3f48f88bb84d22b7805ce971ac86cf1953a29fd. We must make sure to set Editor as the current ClassDB API type before creating an instance. - The `VisualScriptEngineSingleton.constant` property has a property hint string that's different between tools and non-tools builds. This commit makes the hint string to no longer be set in `_bind_methods`, and to instead set it in `_validate_property`. This way it's ignored when calculating the API hash. - `JavaClassWrapper` is now registered in ClassDB on all platforms, using a dummy implementation on platforms other than Android. This fixes API portability between Android and other platforms. - Updated `--class-db-json` command to ignore non-virtual methods that start with an underscore (see: 4be87c6016a5893cbde897924e540df4c988cee5).
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Removed unused variables, add some constants numbersRafał Mikrut2019-12-101-1/+1
|
* Use the Unicode "multiply" sign for the "A x B" visual script nodeHugo Locurcio2019-11-151-1/+1
|
* Deconstruct node for VisualscriptSwarnim Arun2019-09-291-1/+18
| | | | Adds deconstruct nodes for the built-in types and adds default text to function rename_input_box for the visualscript.
* doc: Sync classref with current sourceRémi Verschelde2019-09-271-9/+9
| | | | And various fixes to bindings, hyperlinks and an uninitialized variable.
* Visualscript editor graph unification & refactoringSwarnim Arun2019-09-261-0/+436
| | | | Removes the need to have separate graphs per function for the VisualScript Nodes, and refactoring UI and other improvements such as fuzzy search, right click search boxes and in-graph editable nodes
* Plugin support for visual shadersYuri Roubinski2019-08-141-1/+1
|
* Changed some code showed in LGTM and Coverageqarmin2019-07-201-2/+1
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make visualscript search better.K. S. Ernest (iFire) Lee2018-10-111-7/+7
| | | | | | | | | * There were spaces unequally inside the function definitions. * camelcase_to_underscore() should also work for numbers inside of the camel case. * Removed the builtin concept * Capitalize descriptions from methods too. * Match the visual script functions by removing the empty arguments "( )" * Add some test cases
* Remove redundant "== false" codeAaron Franke2018-10-061-2/+2
| | | | | | Some of this code has been re-organized. f
* Clearly deprecate sync too in favor of remotesync.Fabio Alessandrelli2018-09-151-1/+1
| | | | | NOTE: This changes the RPC_MODE_* enum values. Games should be re-exported. GDNative rebuilt.
* Rename slave keyword to puppetFabio Alessandrelli2018-09-151-1/+1
| | | | | The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-5/+5
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Allow some non-integer built-in constants in gdscriptBernhard Liebl2018-07-311-3/+3
|
* Carry property hint and hint string through to Visualscript virtual functions.K. S. Ernest (iFire) Lee2018-07-271-1/+5
|
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-9/+9
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Improve VisualScript UXK. S. Ernest (iFire) Lee2018-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prototype faster function call ux. * Work on general search ux. * Able to create nodes from search. * Show class for variables but not methods. * Get actions search working. * Descriptions now show for both methods and properties. * Enable zooming on mouse wheel up and down. * Make the drag trigger on right mouse button. * Search now shows for action visual script nodes. * Able to search visual node names. * Search works better. * Change zooming scale to hide artifacts better. * Remove zoom changes * Select from base should check properties too like the other functions. * Seq_connect flag is needed to set sequence lines correctly. * Remove comment * Code cleanup with function names and arguments. * Use brief description for search descriptions. * Clean and fix bug with input nodes connecting with sequence lines. * Add a warning and fix some edge conditions with sequence into data lines and vice versa. * Don't search functions when pulling from a sequence node. * Don't show actions when pulling from a data line. * Set set and get properties. * Convert visual script operators to the correct type * Create a function preset finds only functions. * Singletons can now find functions. * Add shift-a for generic search. * Add brief descriptions for Visual Script nodes. * Search boxes can now filter names. * Add bigger hit zones to node connect. * For the drop zones, make all the rect2 areas the same size. * Function names in visual script node should be lower case so that search works better. * Use the convention of capitalize() for set, set, visual script nodes and methods. * Make search more general. Ignore "_" and make case-insensitive. Also made the search window smaller and remove extra info from search * Make type_cast use the connecting node's type and remove use of found variable. * Fix case where you call an instance's call function where it becomes an invalid call. * Make get_visual_node_names use a set of filters, move action creations and fix bug with sequence node connections. * Make the window bigger. * Make connect_data and connect_seq more robust. * Add icons to search items. * Add vs constructors in shift-a menu. * Operators, builtins and constructors show type name. Fix several problems with port connections. * In shift-a mode search everything. * Code cleanup * Work on autocompleting the type. * Use type guess in action creation. * Check if type hint string exists in object variables when generating the visual script search. * Add the hint to SceneTree. * Add original type detection. * Make type casting great again. This puts the type casted base type as the data output type string hint. * Pass the type in a VisualScriptFunctionCall too. * Set the base type correctly in VisualScriptFunctionGet and VisualScriptFunctionSet using hint string. * Make sure the instance is passed in VisualScriptPropertySet. * Restore search on the node's type. * Remove dependencies from graph_edit. * Remove dependencies from property_selector and name the class visual_script_property_selector. * Extract hot zones into a function. * Move hot_zones constants into default theme. * Bigger capture zones. * Clean messy port_grab_distance variables. * Remove RMB functionality. * Remove memory leak on showing visual script descriptions. * Read the port_grab_distance constants on enter tree and theme changed.
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-291-4/+4
|
* Revert "RPCMode refactor, more sync modes"Max Hilbrunner2018-05-291-4/+4
|
* Merge pull request #19021 from Faless/rpc_sync_fixMax Hilbrunner2018-05-291-4/+4
|\ | | | | RPCMode refactor, more sync modes
| * Refactor RPCMode enum and checksFabio Alessandrelli2018-05-261-4/+4
| |
* | More stuff!Pieter-Jan Briers2018-05-011-129/+56
| |
* | Move things into the title bars of Visual Script nodes.Pieter-Jan Briers2018-04-301-24/+4
|/ | | | | | This is an attempt to make VS slightly nicer to use. WiP.
* Fix typos with codespellluz.paz2018-02-211-3/+3
| | | | | | | | | | | | | | Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt` Whitelist consists of: ``` ang doubleclick lod nd que te unselect ```
* Bind many more properties to scriptsBojidar Marinov2018-01-121-3/+3
| | | | | | | Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fixed typo: substract to subtractIndah Sylvia2017-12-051-4/+4
|
* Fix constant node value editMarcin Zawiejski2017-11-251-2/+2
|
* Move singleton management from ProjectSettings to EngineLeon Krause2017-11-141-5/+6
|
* Add support for the TAU constant. Fixes #12094.Goutte2017-11-121-3/+3
|
* Gave a tooltip to the "In" logic nodeCédric Fuchs2017-10-141-0/+1
|
* Add NIL_IS_VARIANT usage to few definitionsRuslan Mustakov2017-10-051-1/+1
| | | | | The missing usage flag led to GDNative API descriptions containting arguments with "void" type.
* Merge pull request #11653 from bojidar-bg/doc-vscript-1Nathan Lovato2017-10-031-3/+3
|\ | | | | [DOCS] Document some of the VisualScript classes