summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.h
Commit message (Collapse)AuthorAgeFilesLines
* Use script instance binding for objects constructed from C#Ignacio Etcheverry2019-02-091-1/+4
| | | | | | | 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.
* Mono: Lifetime fixes for CSharpInstance and instance binding dataIgnacio Etcheverry2019-02-031-1/+18
| | | | | | | Avoid CSharpInstance from accessing its state after self destructing (by deleting the Reference owner). It's now safe to replace the script instance without leaking or crashing. Also fixed godot_icall_Object_weakref return reference being freed before returning.
* Mono: CleanupIgnacio Etcheverry2019-02-031-2/+2
|
* Mono: Fix hot reload build errors and cleanupIgnacio Etcheverry2019-01-221-7/+4
|
* Merge pull request #24877 from neikeq/issue-24280Rémi Verschelde2019-01-101-0/+5
|\ | | | | Fix properties being lost when reloading placeholder GDScript instance
| * Fix properties being lost when reloading placeholder GDScript instanceIgnacio Etcheverry2019-01-101-0/+5
| | | | | | | | | | | | | | 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!
* | Merge pull request #19501 from Zylann/custom_loadersRémi Verschelde2018-12-161-0/+2
|\ \ | | | | | | Added basic support for custom resource savers and loaders
| * | Added basic support for custom resource savers and loadersMarc Gilleron2018-12-151-0/+2
| |/
* / Implement CSharpScript::get_script_method_list and related functionality.Ben Rog-Wilhelm2018-12-071-2/+2
|/
* Fix crash due to ~CSharpInstance() being called on freed instanceIgnacio Etcheverry2018-12-011-0/+3
| | | | This would be the case when calling SetScript on an object with a C# script.
* Implement CSharpScript::is_valid()Ignacio Etcheverry2018-11-301-1/+1
|
* Merge pull request #24091 from neikeq/iiIgnacio Etcheverry2018-11-301-10/+21
|\ | | | | C#: Improve tool script support and fix reloading issues
| * C#: Improve tool script support and fix reloading issuesIgnacio Etcheverry2018-11-301-10/+21
| |
* | Allow signal connecting even if script is invalid (only when compiled with ↵Juan Linietsky2018-11-271-0/+2
|/ | | | tools), fixes #17070
* Parse C# script namespace and classIgnacio Etcheverry2018-10-251-0/+6
| | | | - Added a very simple parser that can extract the namespace and class name of a C# script.
* Fix msvc warnings in mono moduleIgnacio Etcheverry2018-10-251-1/+1
| | | | | | | - `modules\mono\csharp_script.cpp(576): warning C4099: 'CSharpScriptDepSort': type name first seen using 'class' now seen using 'struct'` - `modules\mono\signal_awaiter_utils.cpp(144): warning C4003: not enough actual parameters for macro 'ERR_FAIL_V'` - `modules\mono\editor\net_solution.cpp(101): warning C4129: '%': unrecognized character escape sequence` - (several) `modules\mono\glue\cs_compressed.gen.h(222): warning C4129: 'E': unrecognized character escape sequence`
* Mono: Fix build regression due to wrong return typeIgnacio Etcheverry2018-09-121-2/+2
|
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-4/+4
| | | | | | 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.
* Fix/workaround for issue #21667Ignacio Etcheverry2018-09-121-7/+25
| | | | When a Reference managed instance is garbage collected and its finalizer is called, it could happen that the native instance is referenced once again before the finalizer can unreference and memdelete it. The workaround is to create a new managed instance when this happens (at least for now).
* 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
| |
* | Merge pull request #20583 from neikeq/issue-15371Rémi Verschelde2018-08-141-0/+1
|\ \ | | | | | | Fix case where exported properties value is lost
| * | Fix case where exported properties value is lostIgnacio Etcheverry2018-07-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+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.
* | 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.
* | Mono: Fixes annotated signal loading in exported binaries=2018-07-031-2/+1
| |
* | Refactor RPCMode enum and checksFabio Alessandrelli2018-05-291-3/+3
| |
* | Revert "RPCMode refactor, more sync modes"Max Hilbrunner2018-05-291-3/+3
| |
* | Refactor RPCMode enum and checksFabio Alessandrelli2018-05-261-3/+3
| |
* | Mono: Avoid invalid class names.Andreas Haas2018-03-151-0/+1
| | | | | | | | | | | | | | Disallow reserved keywords as class names and prefix base class with the Godot namespace if it's the same as the class name. Fixes #12483
* | fix release builds with monoMichele Valente2018-02-221-3/+3
|/ | | | | | "_signals" and "signals_invalidated" were moved out of the "TOOLS_ENABLED" directive. Updated also the two "update_signals" and "_update_signals" methods so it makes sense.
* implement signal related methods in csharp_script so signals can be used ↵Paul Joannon2018-02-171-3/+9
| | | | with emit
* add a [Signal] attribute to CSharpScriptsPaul Joannon2018-02-171-0/+5
|
* Mono: Remove automatic script multilevel callsIgnacio Etcheverry2018-01-301-2/+0
|
* Mono: Fix build errors with tools=no and target=releaseIgnacio Etcheverry2018-01-271-0/+4
|
* Mono: Implement stack info for errors and exceptionsIgnacio Etcheverry2018-01-091-1/+3
|
* 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.
* Mono: Add properties support in scriptsIgnacio Etcheverry2018-01-041-0/+4
|
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Mono: Script lifetime fixesIgnacio Etcheverry2018-01-011-5/+10
| | | | | | - alloc_language_binding: Use strong GC handle as well for references. Fixes #15138 - Set the native instance field of Godot.Object to IntPtr.Zero when it's freed. - Create weak handles without tracking resurrection (that was causing trouble). This means we have to call notification predelete before queueing a native Object for deletion, and use the MonoObject* passed by the finalizer because the weak GC handle target will return NULL at this point.
* Mono: support custom script templates.Andreas Haas2017-10-311-2/+9
| | | | Also fixes a bug that prevented methods like `duplicate()` from copying the source code. (Copied from GDScript implementation)
* Removes Script::get_node_type()Jerome670002017-10-251-1/+0
| | | | used before GDScript, with squirrel apparently
* Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialogIgnacio Etcheverry2017-10-241-0/+1
| | | | | - Make ScriptCreateDialog disable the built-in script checked button if the language does not support it. - ScriptLanguage's get_template and make_template now receive the script path as class name if the the script language does not have named classes.
* Re-write SignalAwaiter implementationIgnacio Etcheverry2017-10-161-1/+3
| | | | Old implementation had issues where you could only await on the same signal of the same source once.
* Added mono moduleIgnacio Etcheverry2017-10-031-0/+338