summaryrefslogtreecommitdiffstats
path: root/core/script_language.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove multilevel callsGeorge Marques2020-07-241-5/+0
| | | | | | In general they are more confusing to users because they expect inheritance to fully override parent methods. This behavior can be enabled by script writers using a simple super() call.
* Add warning checks in GDScript analyzerGeorge Marques2020-07-201-1/+2
| | | | Reenable checking those when validating code.
* Extract Syntax highlighting from TextEdit and add EditorSyntaxHighlighterPaulb232020-07-111-0/+1
| | | | | | | | - Extacted all syntax highlighting code from text edit - Removed enable syntax highlighting from text edit - Added line_edited_from signal to text_edit - Renamed get/set_syntax_highlighting to get/set_syntax_highlighter - Added EditorSyntaxHighligher
* Add core types to ScriptLanguagePaulb232020-07-111-0/+1
|
* Add override keywords.Marcel Admiraal2020-07-101-1/+1
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-1/+2
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-3/+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.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-4/+2
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Add ability to bind typed arrays to script APIJuan Linietsky2020-04-211-0/+2
| | | | | | | 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)
* Replace NULL with nullptrlupoDharkael2020-04-021-10/+10
|
* Style: Harmonize header guards to style guide [Core]Rémi Verschelde2020-03-251-1/+2
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-2/+2
| | | | | | | | | | 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`.
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-58/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-4/+4
| | | | 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>`.
* Optmized data sent during RPC and RSet calls.Andrea Catania2020-02-121-0/+45
| | | | | | | | | | - 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.
* Implement game camera overrideErik2019-10-231-27/+0
| | | | | | | | | | | | | | | | | | | | | | Implemented uniform API in Viewport class to override 2D and/or 3D camera. Added buttons in 2D and 3D editor viewport toolbars that override the running game camera transform with the editor viewport camera transform. Implemented via remote debugger protocol and camera override API. Removed LiveEditFuncs function pointers from ScriptDebugger class. Since the debugger got access to the SceneTree instance (if one exists), there is no need to store the function pointers. The live edit functions in SceneTree are used directly instead. Also removed the static version of live edit functions in SceneTree for the same reason. This reduced the SceneTree -> Debugger coupling too since the function pointers don't need to be set from SceneTree anymore. Moved script_debugger_remote.h/cpp from 'core/' to 'scene/debugger/'. This is because the remote debugger is now using SceneTree directly and 'core/' classes should not depend on 'scene/' classes.
* Merge pull request #31870 from JFonS/add_network_profilerFabio Alessandrelli2019-09-051-0/+1
|\ | | | | Add network profiler
| * Add network profilerjfons2019-09-051-0/+1
| |
* | Adds skip-breakpoints featureiwek72019-09-031-1/+1
| |
* | Merge pull request #31021 from willnationsdev/script-reflectionRémi Verschelde2019-09-031-0/+6
|\ \ | |/ |/| Expose Script reflection methods to scripting API.
| * Expose Script reflection methods to scripting API.willnationsdev2019-08-011-0/+6
| |
* | Remove redundant author doc commentsIAmActuallyCthulhu2019-08-121-4/+0
|/
* Show icons for code completion optionsGeequlim2019-07-051-0/+1
|
* Parse more informations for code completionGeequlim2019-07-041-1/+29
|
* Merge pull request #28099 from lupoDharkael/fix-completionRémi Verschelde2019-06-031-2/+2
|\ | | | | Fix code completion not working with class_name
| * Don't allow class_name in built-in scriptslupoDharkael2019-04-171-1/+1
| |
| * Fix code completion not working with class_namelupoDharkael2019-04-161-1/+1
| |
* | Allow overriding how scripted objects are converted to stringsLeonard Meagher2019-05-031-0/+5
|/ | | | | | | | | | 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 -Wnon-virtual-dtor warnings.marxin2019-04-021-0/+2
| | | | | Example of the warning: ./core/script_language.h:198:7: warning: 'class ScriptCodeCompletionCache' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]
* Revert accidental commitsPedro J. Estébanez2019-03-201-3/+0
| | | | | This reverts commit fb37284c027b494ed3ec21124001fcb729f42cc4. This reverts commit 4db0f51b9aa76cfc7649787fe1970af606ce8dab.
* Create live view dock [wip]Pedro J. Estébanez2019-03-201-0/+3
|
* Allow class_name scripts to have nested inheritanceGeorge Marques2019-03-091-0/+1
|
* Fix enums coming from other classes without preloadBojidar Marinov2019-03-051-0/+1
| | | | Fix #19704, fix #26001
* Use script instance binding for objects constructed from C#Ignacio Etcheverry2019-02-091-0/+3
| | | | | | | Only possible if the object class is a "native type". If the object class is a user class (that derives a "native type") then a script is needed. Since CSharpLanguage does cleanup of script instance bindings when finished, cases like #25621 will no longer cause problems. Fixed ~Object() trying to free script instance bindings after the language has already been removed, which would result in a NULL dereference.
* Merge pull request #24877 from neikeq/issue-24280Rémi Verschelde2019-01-101-7/+4
|\ | | | | Fix properties being lost when reloading placeholder GDScript instance
| * Fix properties being lost when reloading placeholder GDScript instanceIgnacio Etcheverry2019-01-101-7/+4
| | | | | | | | | | | | | | During reloading in `GDScriptLanguage::reload_all_scripts` a placeholder instance that must remain so is replaced with a new placeholder instance. The state is then restored by calling `ScriptInstance::set` for each property. This does not work if the script is missing the properties due to build/parse failing. The fix for such cases is to call `placeholder_set_fallback` instead of `set` on the script instance. I took this chance to move the `build_failed` flag from `PlaceHolderScriptInstance` to `Script`. That improves the code a lot. I also renamed it to `placeholder_fallback_enabled` which is a much better name (`build_failed` could lead to misunderstandings).
* | 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/+1
| | | | tools), fixes #17070
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-4/+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.
* Merge pull request #16927 from neikeq/rework-refcount-notifyJuan Linietsky2018-08-251-0/+2
|\ | | | | Notify instance binding data api of refcount increment/decrement
| * Notify instance binding data api of refcount increment/decrementIgnacio Etcheverry2018-08-231-0/+2
| |
* | Add custom icons to script classes.Will Nations2018-08-141-1/+1
| |
* | Merge pull request #20583 from neikeq/issue-15371Rémi Verschelde2018-08-141-0/+12
|\ \ | | | | | | Fix case where exported properties value is lost
| * | Fix case where exported properties value is lostIgnacio Etcheverry2018-07-291-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes exported property modified values lost when creating a placeholder script instance with a failed script compilation - Object set/get will call PlaceHolderScriptInstance's new fallback set/get methods as a last resort. This way, placeholder script instances can keep the values for storage or until the script is compiled successfuly. - Script::can_instance() will only return true if a real script instance can be created. Otherwise, in the case of placeholder script instances, it will return false. - Object::set_script(script) is now in charge of requesting the creation of placeholder script instances. It's no longer Script::instance_create(owner)'s duty. - PlaceHolderScriptInstance has a new method set_build_failed(bool) to determine whether it should call into its script methods or not. - Fixed a few problems during reloading of C# scripts.
* | | Added system for GDScript warningsGeorge Marques2018-08-101-1/+8
|/ / | | | | | | | | | | | | - 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.
* | 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.
* | Global class names (and GDScript support for it)Juan Linietsky2018-07-151-1/+22
| |
* | -Fixes to OBJ importer, option to disable optimizationJuan Linietsky2018-06-301-2/+2
| | | | | | | | -Fixes to script language, PlaceHolder can now get and check methods