summaryrefslogtreecommitdiffstats
path: root/modules/visual_script/visual_script.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+41
| | | | | | | | | | | | | | | | | | | | | | | 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-205/+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.
* Add ability to bind typed arrays to script APIJuan Linietsky2020-04-211-0/+4
| | | | | | | Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells Note: Will do a mass replace on later PRs of whathever I can find, but probably need a tool to grep through doc. Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
* Update vsnodes on editing vs variablesSwarnim Arun2020-04-031-0/+20
|
* Replace NULL with nullptrlupoDharkael2020-04-021-19/+19
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-4/+4
| | | | | | | | | | 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`.
* Merge pull request #36723 from AndreaCatania/fix-rsetRémi Verschelde2020-03-131-2/+2
|\ | | | | Fixed rset method for gdscript and visual script
| * Fixed rset method for gdscript and visual scriptAndrea Catania2020-03-021-2/+2
| |
* | Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-15/+15
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | EngineDebugger is the new interface to access the debugger. It tries to be as agnostic as possible on the data that various subsystems can expose. It allows 2 types of interactions: - Profilers: A subsystem can register a profiler, assigning it a unique name. That name can be used to activate the profiler or add data to it. The registered profiler can be composed of up to 3 functions: - Toggle: called when the profiler is activated/deactivated. - Add: called whenever data is added to the debugger (via `EngineDebugger::profiler_add_frame_data`) - Tick: called every frame (during idle), receives frame times. - Captures: (Only relevant in remote debugger for now) A subsystem can register a capture, assigning it a unique name. When receiving a message, the remote debugger will check if it starts with `[prefix]:` and call the associated capture with name `prefix`. Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new profiler system. Port SceneDebugger and RemoteDebugger to the new capture system. The LocalDebugger also uses the new profiler system for scripts profiling.
* Signals: Manually port most of remaining connect_compat usesRémi Verschelde2020-02-281-2/+2
| | | | | | | | It's tedious work... Some can't be ported as they depend on private or protected methods of different classes, which is not supported by callable_mp (even if it's a class inherited by the current one).
* Signals: Port connect calls to use callable_mpRémi Verschelde2020-02-281-5/+3
| | | | | | | | | 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.)
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-18/+8
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-42/+42
| | | | objects and made them default.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-1/+1
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky2020-02-121-4/+4
| | | | 32 bits.
* Optmized data sent during RPC and RSet calls.Andrea Catania2020-02-121-16/+109
| | | | | | | | | | - Now is sent the method ID rather the full function name. - The passed IDs (Node and Method) are compressed so to use less possible space. - The variant (INT and BOOL) is now encoded and compressed so to use much less data. - Optimized RPCMode retrieval for GDScript functions. - Added checksum to assert the methods are the same across peers. This work has been kindly sponsored by IMVU.
* 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.
* Fix some crashes, overflows and using variables without valuesRafał Mikrut2019-11-011-0/+1
|
* Visualscript editor graph unification & refactoringSwarnim Arun2019-09-261-10/+59
| | | | 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
* Merge pull request #30852 from swarnimarun/vs_tools_scriptRémi Verschelde2019-09-221-2/+13
|\ | | | | Tool Mode for Visualscript
| * Tool Mode for VisualscriptSwarnim Arun2019-09-211-2/+13
| | | | | | | | Add the ability to VisualScript to function in Tool mode aka the Editor itself similar to GDScript or Mono
* | Adds skip-breakpoints featureiwek72019-09-031-2/+2
| |
* | Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in rest of 'modules/'Robin Hübner2019-08-121-22/+9
|/
* Changed some code showed in LGTM and Coverageqarmin2019-07-201-2/+0
|
* Fixes minor issues found by static analyzerqarmin2019-07-071-2/+2
|
* Fix always true/false valuesqarmin2019-06-201-1/+1
|
* Merge pull request #28606 from bojidar-bg/25889-indexed-set-defaultsRémi Verschelde2019-05-281-13/+2
|\ | | | | Fix default values not being read correctly in VS, take two
| * Fix default values not being read correctly in VS, take twoBojidar Marinov2019-05-021-13/+2
| | | | | | | | Fixes #25889.
* | Allow overriding how scripted objects are converted to stringsLeonard Meagher2019-05-031-0/+22
|/ | | | | | | | | | solves #26796 - ADD `String to_string()` method to Object which can be overriden by `String _to_string()` in scripts - ADD `String to_string(r_valid)` method to ScriptInstance to allow langauges to control how scripted objects are converted to strings - IMPLEMENT to_string for GDScriptInstance, VisualScriptInstance, and NativeScriptInstance - ADD Documentation about `Object.to_string` and `Object._to_string` - Changed `Variant::operator String` to use `obj->to_string()`
* Fix default values not being read correctly in VisualScriptBojidar Marinov2019-03-041-15/+6
| | | | Fixes #25889
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-2/+2
| | | | Fixes #25316.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Allow signal connecting even if script is invalid (only when compiled with ↵Juan Linietsky2018-11-271-0/+4
| | | | tools), fixes #17070
* Merge pull request #22779 from Superwaitsum/LimitSettingsRémi Verschelde2018-10-251-2/+2
|\ | | | | Limit several project settings
| * Add some limits on the Editor SettingsSuperwaitsum2018-10-241-2/+2
| |
* | Fixed the problem with vector3 constructorthe 8th mage2018-10-111-9/+11
|/ | | | | | | | Whenever there's a port change that may change the inputs, the default inputs will be recalculated. Moving the update port loop into its own function. Signed-off-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-2/+2
| | | | | | 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.
* Added system for GDScript warningsGeorge Marques2018-08-101-1/+1
| | | | | | | - Count and panel per script. - Ability to disable warnings per script using special comments. - Ability to disable warnings globally using Project Settings. - Option to treat enabled warnings as errors.
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Add editor highlight for type-safe linesGeorge Marques2018-07-201-1/+1
| | | | | The line number is hightlighted to indicate that the line contains only type-safe code.
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-291-5/+5
|
* Revert "RPCMode refactor, more sync modes"Max Hilbrunner2018-05-291-5/+5
|
* Merge pull request #19021 from Faless/rpc_sync_fixMax Hilbrunner2018-05-291-5/+5
|\ | | | | RPCMode refactor, more sync modes
| * Refactor RPCMode enum and checksFabio Alessandrelli2018-05-261-5/+5
| |
* | Merge pull request #18516 from PJB3005/18-04-30-visual-script-title-barsMax Hilbrunner2018-05-261-0/+4
|\ \ | |/ |/| Move things into the title bars of Visual Script nodes.
| * Move things into the title bars of Visual Script nodes.Pieter-Jan Briers2018-04-301-0/+4
| | | | | | | | | | | | This is an attempt to make VS slightly nicer to use. WiP.
* | Fix Coverity reports of uninitialized scalar variableRémi Verschelde2018-04-191-0/+1
|/ | | | | | | | | | | Fixes most current reports on Coverity Scan of uninitialized scalar variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html These happen most of the time (in our code) when instanciating structs without a constructor (or with an incomplete one), and later returning the instance. This is sometimes intended though, as some parameters are only used in some situations and should not be double-initialized for performance reasons (e.g. `constant` in ShaderLanguage::Token).
* Fix typos with codespellluz.paz2018-02-211-2/+2
| | | | | | | | | | | | | | 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-2/+2
| | | | | | | 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