summaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.h
AgeCommit message (Collapse)Author
2019-04-26Mono: Lazily load scripts metadata fileIgnacio Etcheverry
- Only load the scripts metadata file when it's really needed. This way we avoid false errors, when there is no C# project, about missing scripts metadata file.
2019-04-12Fixes #17233 allowing C# to override _GetPropertyListNuno Cardoso
2019-03-07Mono: Partially implement some Godot debug api functionsIgnacio Etcheverry
Debug breaks sent with debug_break and debug_break_parse should display correctly in the Godot debugger now.
2019-03-07Mono: Fix crash when re-using script binding after domain reloadingIgnacio Etcheverry
2019-02-09Use script instance binding for objects constructed from C#Ignacio Etcheverry
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.
2019-02-03Mono: Lifetime fixes for CSharpInstance and instance binding dataIgnacio Etcheverry
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.
2019-02-03Mono: CleanupIgnacio Etcheverry
2019-01-22Mono: Fix hot reload build errors and cleanupIgnacio Etcheverry
2019-01-10Merge pull request #24877 from neikeq/issue-24280Rémi Verschelde
Fix properties being lost when reloading placeholder GDScript instance
2019-01-10Fix properties being lost when reloading placeholder GDScript instanceIgnacio Etcheverry
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).
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-16Merge pull request #19501 from Zylann/custom_loadersRémi Verschelde
Added basic support for custom resource savers and loaders
2018-12-15Added basic support for custom resource savers and loadersMarc Gilleron
2018-12-07Implement CSharpScript::get_script_method_list and related functionality.Ben Rog-Wilhelm
2018-12-01Fix crash due to ~CSharpInstance() being called on freed instanceIgnacio Etcheverry
This would be the case when calling SetScript on an object with a C# script.
2018-11-30Implement CSharpScript::is_valid()Ignacio Etcheverry
2018-11-30Merge pull request #24091 from neikeq/iiIgnacio Etcheverry
C#: Improve tool script support and fix reloading issues
2018-11-30C#: Improve tool script support and fix reloading issuesIgnacio Etcheverry
2018-11-27Allow signal connecting even if script is invalid (only when compiled with ↵Juan Linietsky
tools), fixes #17070
2018-10-25Parse C# script namespace and classIgnacio Etcheverry
- Added a very simple parser that can extract the namespace and class name of a C# script.
2018-10-25Fix msvc warnings in mono moduleIgnacio Etcheverry
- `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`
2018-09-12Mono: Fix build regression due to wrong return typeIgnacio Etcheverry
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
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.
2018-09-12Fix/workaround for issue #21667Ignacio Etcheverry
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).
2018-08-25Merge pull request #16927 from neikeq/rework-refcount-notifyJuan Linietsky
Notify instance binding data api of refcount increment/decrement
2018-08-23Notify instance binding data api of refcount increment/decrementIgnacio Etcheverry
2018-08-14Merge pull request #20583 from neikeq/issue-15371Rémi Verschelde
Fix case where exported properties value is lost
2018-08-10Added system for GDScript warningsGeorge Marques
- 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.
2018-07-29Fix case where exported properties value is lostIgnacio Etcheverry
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.
2018-07-20Add editor highlight for type-safe linesGeorge Marques
The line number is hightlighted to indicate that the line contains only type-safe code.
2018-07-03Mono: Fixes annotated signal loading in exported binaries=
2018-05-29Refactor RPCMode enum and checksFabio Alessandrelli
2018-05-29Revert "RPCMode refactor, more sync modes"Max Hilbrunner
2018-05-26Refactor RPCMode enum and checksFabio Alessandrelli
2018-03-15Mono: Avoid invalid class names.Andreas Haas
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
2018-02-22fix release builds with monoMichele Valente
"_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.
2018-02-17implement signal related methods in csharp_script so signals can be used ↵Paul Joannon
with emit
2018-02-17add a [Signal] attribute to CSharpScriptsPaul Joannon
2018-01-30Mono: Remove automatic script multilevel callsIgnacio Etcheverry
2018-01-27Mono: Fix build errors with tools=no and target=releaseIgnacio Etcheverry
2018-01-09Mono: Implement stack info for errors and exceptionsIgnacio Etcheverry
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
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.
2018-01-04Mono: Add properties support in scriptsIgnacio Etcheverry
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-01-01Mono: Script lifetime fixesIgnacio Etcheverry
- 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.
2017-10-31Mono: support custom script templates.Andreas Haas
Also fixes a bug that prevented methods like `duplicate()` from copying the source code. (Copied from GDScript implementation)
2017-10-25Removes Script::get_node_type()Jerome67000
used before GDScript, with squirrel apparently
2017-10-24Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialogIgnacio Etcheverry
- 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.
2017-10-16Re-write SignalAwaiter implementationIgnacio Etcheverry
Old implementation had issues where you could only await on the same signal of the same source once.
2017-10-03Added mono moduleIgnacio Etcheverry