summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/gd_native_library_editor.cpp4
-rw-r--r--modules/gdscript/gd_function.cpp2
-rw-r--r--modules/gridmap/grid_map.cpp15
-rw-r--r--modules/gridmap/grid_map.h2
-rw-r--r--modules/mobile_vr/config.py8
-rw-r--r--modules/mobile_vr/doc_classes/MobileVRInterface.xml134
-rw-r--r--modules/mobile_vr/mobile_interface.cpp29
-rw-r--r--modules/mobile_vr/mobile_interface.h5
-rw-r--r--modules/mono/csharp_script.cpp59
-rw-r--r--modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs10
-rw-r--r--modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs5
-rw-r--r--modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs4
-rw-r--r--modules/mono/editor/godotsharp_builds.cpp58
-rw-r--r--modules/mono/editor/godotsharp_editor.cpp4
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp7
-rw-r--r--modules/visual_script/visual_script_nodes.cpp2
16 files changed, 289 insertions, 59 deletions
diff --git a/modules/gdnative/gd_native_library_editor.cpp b/modules/gdnative/gd_native_library_editor.cpp
index cc2c2b69a6..c37b7f473d 100644
--- a/modules/gdnative/gd_native_library_editor.cpp
+++ b/modules/gdnative/gd_native_library_editor.cpp
@@ -72,7 +72,7 @@ void GDNativeLibraryEditor::_update_libraries() {
libraries->create_item(); //rppt
Vector<String> enabled_paths;
- if (ProjectSettings::get_singleton()->has("gdnative/singletons")) {
+ if (ProjectSettings::get_singleton()->has_setting("gdnative/singletons")) {
enabled_paths = ProjectSettings::get_singleton()->get("gdnative/singletons");
}
Set<String> enabled_list;
@@ -100,7 +100,7 @@ void GDNativeLibraryEditor::_item_edited() {
String path = item->get_metadata(0);
Vector<String> enabled_paths;
- if (ProjectSettings::get_singleton()->has("gdnative/singletons")) {
+ if (ProjectSettings::get_singleton()->has_setting("gdnative/singletons")) {
enabled_paths = ProjectSettings::get_singleton()->get("gdnative/singletons");
}
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 9df2823c35..ce503b62f2 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -1578,7 +1578,7 @@ void GDFunctionState::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_valid", "extended_check"), &GDFunctionState::is_valid, DEFVAL(false));
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "_signal_callback", &GDFunctionState::_signal_callback, MethodInfo("_signal_callback"));
- ADD_SIGNAL(MethodInfo("completed", PropertyInfo(Variant::NIL, "result")));
+ ADD_SIGNAL(MethodInfo("completed", PropertyInfo(Variant::NIL, "result", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT)));
}
GDFunctionState::GDFunctionState() {
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 4f7545a11d..4e8b67e4e8 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -769,6 +769,8 @@ void GridMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear"), &GridMap::clear);
+ ClassDB::bind_method(D_METHOD("get_used_cells"), &GridMap::get_used_cells);
+
ClassDB::bind_method(D_METHOD("get_meshes"), &GridMap::get_meshes);
BIND_CONSTANT(INVALID_CELL_ITEM);
@@ -807,6 +809,19 @@ float GridMap::get_cell_scale() const {
return cell_scale;
}
+Array GridMap::get_used_cells() const {
+
+ Array a;
+ a.resize(cell_map.size());
+ int i = 0;
+ for (Map<IndexKey, Cell>::Element *E = cell_map.front(); E; E = E->next()) {
+ Vector3 p(E->key().x, E->key().y, E->key().z);
+ a[i++] = p;
+ }
+
+ return a;
+}
+
Array GridMap::get_meshes() {
if (theme.is_null())
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index eb1b215696..296956ff5d 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -223,6 +223,8 @@ public:
void set_cell_scale(float p_scale);
float get_cell_scale() const;
+ Array get_used_cells() const;
+
Array get_meshes();
void clear();
diff --git a/modules/mobile_vr/config.py b/modules/mobile_vr/config.py
index d0156b1b77..cf96c66125 100644
--- a/modules/mobile_vr/config.py
+++ b/modules/mobile_vr/config.py
@@ -3,4 +3,10 @@ def can_build(platform):
return True
def configure(env):
- pass \ No newline at end of file
+ pass
+
+def get_doc_classes():
+ return ["MobileVRInterface"]
+
+def get_doc_path():
+ return "doc_classes"
diff --git a/modules/mobile_vr/doc_classes/MobileVRInterface.xml b/modules/mobile_vr/doc_classes/MobileVRInterface.xml
new file mode 100644
index 0000000000..c945a99a9a
--- /dev/null
+++ b/modules/mobile_vr/doc_classes/MobileVRInterface.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="MobileVRInterface" inherits="ARVRInterface" category="Core" version="3.0.alpha.custom_build">
+ <brief_description>
+ Generic mobile VR implementation
+ </brief_description>
+ <description>
+ This is a generic mobile VR implementation where you need to provide details about the phone and HMD used. It does not rely on any existing framework. This is the most basic interface we have. For the best effect you do need a mobile phone with a gyroscope and accelerometer.
+ Note that even though there is no positional tracking the camera will assume the headset is at a height of 1.85 meters.
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="get_display_to_lens" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the distance between the display and the lens.
+ </description>
+ </method>
+ <method name="get_display_width" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Return the width of the LCD screen of the device.
+ </description>
+ </method>
+ <method name="get_iod" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the interocular distance.
+ </description>
+ </method>
+ <method name="get_k1" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the k1 lens constant.
+ </description>
+ </method>
+ <method name="get_k2" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Retuns the k2 lens constant
+ </description>
+ </method>
+ <method name="get_oversample" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ Returns the oversampling setting.
+ </description>
+ </method>
+ <method name="set_display_to_lens">
+ <return type="void">
+ </return>
+ <argument index="0" name="display_to_lens" type="float">
+ </argument>
+ <description>
+ Sets the distance between display and the lens.
+ </description>
+ </method>
+ <method name="set_display_width">
+ <return type="void">
+ </return>
+ <argument index="0" name="display_width" type="float">
+ </argument>
+ <description>
+ Sets the width of the LCD screen of the device.
+ </description>
+ </method>
+ <method name="set_iod">
+ <return type="void">
+ </return>
+ <argument index="0" name="iod" type="float">
+ </argument>
+ <description>
+ Sets the interocular distance.
+ </description>
+ </method>
+ <method name="set_k1">
+ <return type="void">
+ </return>
+ <argument index="0" name="k" type="float">
+ </argument>
+ <description>
+ Sets the k1 lens constant.
+ </description>
+ </method>
+ <method name="set_k2">
+ <return type="void">
+ </return>
+ <argument index="0" name="k" type="float">
+ </argument>
+ <description>
+ Sets the k2 lens constant.
+ </description>
+ </method>
+ <method name="set_oversample">
+ <return type="void">
+ </return>
+ <argument index="0" name="oversample" type="float">
+ </argument>
+ <description>
+ Sets the oversampling setting.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="display_to_lens" type="float" setter="set_display_to_lens" getter="get_display_to_lens">
+ The distance between the display and the lenses inside of the device in centimeters.
+ </member>
+ <member name="display_width" type="float" setter="set_display_width" getter="get_display_width">
+ The width of the display in centimeters.
+ </member>
+ <member name="iod" type="float" setter="set_iod" getter="get_iod">
+ The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye.
+ </member>
+ <member name="k1" type="float" setter="set_k1" getter="get_k1">
+ The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect.
+ </member>
+ <member name="k2" type="float" setter="set_k2" getter="get_k2">
+ The k2 lens factor, see k1.
+ </member>
+ <member name="oversample" type="float" setter="set_oversample" getter="get_oversample">
+ The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/mobile_vr/mobile_interface.cpp b/modules/mobile_vr/mobile_interface.cpp
index f5c9bccaba..eb87bb2cf0 100644
--- a/modules/mobile_vr/mobile_interface.cpp
+++ b/modules/mobile_vr/mobile_interface.cpp
@@ -37,6 +37,10 @@ StringName MobileVRInterface::get_name() const {
return "Native mobile";
};
+int MobileVRInterface::get_capabilities() const {
+ return ARVRInterface::ARVR_STEREO;
+};
+
Vector3 MobileVRInterface::scale_magneto(const Vector3 &p_magnetometer) {
// Our magnetometer doesn't give us nice clean data.
// Well it may on Mac OS X because we're getting a calibrated value in the current implementation but Android we're getting raw data.
@@ -166,6 +170,8 @@ void MobileVRInterface::set_position_from_sensors() {
rotate.rotate(orientation.get_axis(1), gyro.y * delta_time);
rotate.rotate(orientation.get_axis(2), gyro.z * delta_time);
orientation = rotate * orientation;
+
+ tracking_state = ARVRInterface::ARVR_NORMAL_TRACKING;
};
///@TODO improve this, the magnetometer is very fidgity sometimes flipping the axis for no apparent reason (probably a bug on my part)
@@ -176,6 +182,8 @@ void MobileVRInterface::set_position_from_sensors() {
Quat acc_mag_quat(combine_acc_mag(grav, magneto));
transform_quat = transform_quat.slerp(acc_mag_quat, 0.1);
orientation = Basis(transform_quat);
+
+ tracking_state = ARVRInterface::ARVR_NORMAL_TRACKING;
} else if (has_grav) {
// use gravity vector to make sure down is down...
// transform gravity into our world space
@@ -273,21 +281,6 @@ real_t MobileVRInterface::get_k2() const {
return k2;
};
-bool MobileVRInterface::is_installed() {
- // we don't have any middle ware here, if we have our interface, we can use it
- return true;
-};
-
-bool MobileVRInterface::hmd_is_present() {
- // our device is our HMD
- return true;
-};
-
-bool MobileVRInterface::supports_hmd() {
- // our device is our HMD
- return true;
-};
-
bool MobileVRInterface::is_stereo() {
// needs stereo...
return true;
@@ -461,11 +454,11 @@ MobileVRInterface::MobileVRInterface() {
// Just set some defaults for these. At some point we need to look at adding a lookup table for common device + headset combos and/or support reading cardboard QR codes
eye_height = 1.85;
intraocular_dist = 6.0;
- display_width = 13.0;
+ display_width = 14.5;
display_to_lens = 4.0;
oversample = 1.5;
- k1 = 0.22;
- k2 = 0.23;
+ k1 = 0.215;
+ k2 = 0.215;
last_ticks = 0;
// create our shader stuff
diff --git a/modules/mobile_vr/mobile_interface.h b/modules/mobile_vr/mobile_interface.h
index dfe3cd200e..6a5e01c163 100644
--- a/modules/mobile_vr/mobile_interface.h
+++ b/modules/mobile_vr/mobile_interface.h
@@ -131,10 +131,7 @@ public:
real_t get_k2() const;
virtual StringName get_name() const;
-
- virtual bool is_installed();
- virtual bool hmd_is_present();
- virtual bool supports_hmd();
+ virtual int get_capabilities() const;
virtual bool is_initialized();
virtual bool initialize();
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 67b4e67e2b..5301ea72b4 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -50,6 +50,21 @@
#define CACHED_STRING_NAME(m_var) (CSharpLanguage::get_singleton()->string_names.m_var)
+static bool _create_project_solution_if_needed() {
+
+ String sln_path = GodotSharpDirs::get_project_sln_path();
+ String csproj_path = GodotSharpDirs::get_project_csproj_path();
+
+ if (!FileAccess::exists(sln_path) || !FileAccess::exists(csproj_path)) {
+ // A solution does not yet exist, create a new one
+
+ CRASH_COND(GodotSharpEditor::get_singleton() == NULL);
+ return GodotSharpEditor::get_singleton()->call("_create_project_solution");
+ }
+
+ return true;
+}
+
CSharpLanguage *CSharpLanguage::singleton = NULL;
String CSharpLanguage::get_name() const {
@@ -1359,7 +1374,18 @@ Ref<CSharpScript> CSharpScript::create_for_managed_type(GDMonoClass *p_class) {
bool CSharpScript::can_instance() const {
- // TODO does the second condition even make sense?
+#ifdef TOOLS_ENABLED
+ if (Engine::get_singleton()->is_editor_hint()) {
+ if (_create_project_solution_if_needed()) {
+ CSharpProject::add_item(GodotSharpDirs::get_project_csproj_path(),
+ "Compile",
+ ProjectSettings::get_singleton()->globalize_path(get_path()));
+ } else {
+ ERR_PRINTS("Cannot add " + get_path() + " to the C# project because it could not be created.");
+ }
+ }
+#endif
+
return valid || (!tool && !ScriptServer::is_scripting_enabled());
}
@@ -1545,6 +1571,18 @@ Error CSharpScript::reload(bool p_keep_state) {
if (project_assembly) {
script_class = project_assembly->get_object_derived_class(name);
+
+ if (!script_class) {
+ ERR_PRINTS("Cannot find class " + name + " for script " + get_path());
+ }
+#ifdef DEBUG_ENABLED
+ else if (OS::get_singleton()->is_stdout_verbose()) {
+ OS::get_singleton()->print(String("Found class " + script_class->get_namespace() + "." +
+ script_class->get_name() + " for script " + get_path() + "\n")
+ .utf8());
+ }
+#endif
+
valid = script_class != NULL;
if (script_class) {
@@ -1791,21 +1829,12 @@ Error ResourceFormatSaverCSharpScript::save(const String &p_path, const RES &p_r
if (!FileAccess::exists(p_path)) {
// The file does not yet exists, let's assume the user just created this script
- String sln_path = GodotSharpDirs::get_project_sln_path();
- String csproj_path = GodotSharpDirs::get_project_csproj_path();
-
- if (!FileAccess::exists(sln_path) || !FileAccess::exists(csproj_path)) {
- // A solution does not yet exist, create a new one
-
- CRASH_COND(GodotSharpEditor::get_singleton() == NULL);
- GodotSharpEditor::get_singleton()->call("_create_project_solution");
- }
-
- // Add the file to the C# project
- if (FileAccess::exists(csproj_path)) {
- CSharpProject::add_item(csproj_path, "Compile", ProjectSettings::get_singleton()->globalize_path(p_path));
+ if (_create_project_solution_if_needed()) {
+ CSharpProject::add_item(GodotSharpDirs::get_project_csproj_path(),
+ "Compile",
+ ProjectSettings::get_singleton()->globalize_path(p_path));
} else {
- ERR_PRINT("C# project not found!");
+ ERR_PRINTS("Cannot add " + p_path + " to the C# project because it could not be created.");
}
}
#endif
diff --git a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
index 256e64ddde..329b6d2008 100644
--- a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
+++ b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
@@ -19,7 +19,15 @@ namespace GodotSharpTools.Build
private static string MSBuildPath
{
- get { return godot_icall_BuildInstance_get_MSBuildPath(); }
+ get
+ {
+ string ret = godot_icall_BuildInstance_get_MSBuildPath();
+
+ if (ret == null)
+ throw new FileNotFoundException("Cannot find the MSBuild executable.");
+
+ return ret;
+ }
}
private string solution;
diff --git a/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs b/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
index 6a97731539..f00ec5a2ad 100644
--- a/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
+++ b/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
@@ -27,12 +27,15 @@ namespace GodotSharpTools.Project
return false;
}
- public static void AddItemChecked(this ProjectRootElement root, string itemType, string include)
+ public static bool AddItemChecked(this ProjectRootElement root, string itemType, string include)
{
if (!root.HasItem(itemType, include))
{
root.AddItem(itemType, include);
+ return true;
}
+
+ return false;
}
public static Guid GetGuid(this ProjectRootElement root)
diff --git a/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs b/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs
index a50b4fb064..6889ea715f 100644
--- a/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs
+++ b/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs
@@ -10,8 +10,8 @@ namespace GodotSharpTools.Project
{
var dir = Directory.GetParent(projectPath).FullName;
var root = ProjectRootElement.Open(projectPath);
- root.AddItemChecked(itemType, include.RelativeToPath(dir).Replace("/", "\\"));
- root.Save();
+ if (root.AddItemChecked(itemType, include.RelativeToPath(dir).Replace("/", "\\")))
+ root.Save();
}
}
}
diff --git a/modules/mono/editor/godotsharp_builds.cpp b/modules/mono/editor/godotsharp_builds.cpp
index e7d9c83421..b7e3fb0a32 100644
--- a/modules/mono/editor/godotsharp_builds.cpp
+++ b/modules/mono/editor/godotsharp_builds.cpp
@@ -29,13 +29,14 @@
/*************************************************************************/
#include "godotsharp_builds.h"
+#include "main/main.h"
+
#include "../godotsharp_dirs.h"
#include "../mono_gd/gd_mono_class.h"
#include "../mono_gd/gd_mono_marshal.h"
#include "../utils/path_utils.h"
#include "bindings_generator.h"
#include "godotsharp_editor.h"
-#include "main/main.h"
void godot_icall_BuildInstance_ExitCallback(MonoString *p_solution, MonoString *p_config, int p_exit_code) {
@@ -44,11 +45,37 @@ void godot_icall_BuildInstance_ExitCallback(MonoString *p_solution, MonoString *
GodotSharpBuilds::get_singleton()->build_exit_callback(MonoBuildInfo(solution, config), p_exit_code);
}
+#ifdef UNIX_ENABLED
+String _find_build_engine_on_unix(const String &p_name) {
+ String ret = path_which(p_name);
+
+ if (ret.length())
+ return ret;
+
+ const char *locations[] = {
+#ifdef OSX_ENABLED
+ "/Library/Frameworks/Mono.framework/Versions/Current/bin/",
+#endif
+ "/opt/novell/mono/bin/"
+ };
+
+ for (int i = 0; i < sizeof(locations) / sizeof(char); i++) {
+ String location = locations[i];
+
+ if (FileAccess::exists(location + p_name)) {
+ return location;
+ }
+ }
+
+ return String();
+}
+#endif
+
MonoString *godot_icall_BuildInstance_get_MSBuildPath() {
GodotSharpBuilds::BuildTool build_tool = GodotSharpBuilds::BuildTool(int(EditorSettings::get_singleton()->get("mono/builds/build_tool")));
-#ifdef WINDOWS_ENABLED
+#if defined(WINDOWS_ENABLED)
switch (build_tool) {
case GodotSharpBuilds::MSBUILD: {
static String msbuild_tools_path = MonoRegUtils::find_msbuild_tools_path();
@@ -84,14 +111,25 @@ MonoString *godot_icall_BuildInstance_get_MSBuildPath() {
ERR_EXPLAIN("You don't deserve to live");
CRASH_NOW();
}
-#else
- static bool msbuild_found = path_which("msbuild").length();
-
- if (build_tool != GodotSharpBuilds::XBUILD && !msbuild_found) {
- WARN_PRINT("Cannot find msbuild ('mono/builds/build_tool').");
+#elif defined(UNIX_ENABLED)
+ static String msbuild_path = _find_build_engine_on_unix("msbuild");
+ static String xbuild_path = _find_build_engine_on_unix("xbuild");
+
+ if (build_tool != GodotSharpBuilds::XBUILD) {
+ if (msbuild_path.empty()) {
+ WARN_PRINT("Cannot find msbuild ('mono/builds/build_tool').");
+ return NULL;
+ }
+ } else {
+ if (xbuild_path.empty()) {
+ WARN_PRINT("Cannot find xbuild ('mono/builds/build_tool').");
+ return NULL;
+ }
}
- return GDMonoMarshal::mono_string_from_godot(build_tool != GodotSharpBuilds::XBUILD ? "msbuild" : "xbuild");
+ return GDMonoMarshal::mono_string_from_godot(build_tool != GodotSharpBuilds::XBUILD ? msbuild_path : xbuild_path);
+#else
+ return NULL;
#endif
}
@@ -314,8 +352,8 @@ GodotSharpBuilds::GodotSharpBuilds() {
// Build tool settings
EditorSettings *ed_settings = EditorSettings::get_singleton();
- if (!ed_settings->has("mono/builds/build_tool")) {
- ed_settings->set("mono/builds/build_tool", MSBUILD);
+ if (!ed_settings->has_setting("mono/builds/build_tool")) {
+ ed_settings->set_setting("mono/builds/build_tool", MSBUILD);
}
ed_settings->add_property_hint(PropertyInfo(Variant::INT, "mono/builds/build_tool", PROPERTY_HINT_ENUM, "MSBuild (System),MSBuild (Mono),xbuild"));
}
diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp
index 5aaf029495..30e7653256 100644
--- a/modules/mono/editor/godotsharp_editor.cpp
+++ b/modules/mono/editor/godotsharp_editor.cpp
@@ -237,8 +237,8 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) {
// External editor settings
EditorSettings *ed_settings = EditorSettings::get_singleton();
- if (!ed_settings->has("mono/editor/external_editor")) {
- ed_settings->set("mono/editor/external_editor", EDITOR_NONE);
+ if (!ed_settings->has_setting("mono/editor/external_editor")) {
+ ed_settings->set_setting("mono/editor/external_editor", EDITOR_NONE);
}
ed_settings->add_property_hint(PropertyInfo(Variant::INT, "mono/editor/external_editor", PROPERTY_HINT_ENUM, "None,MonoDevelop,Visual Studio,Visual Studio Code"));
}
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index 77f01842bb..d0b5b12d4b 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -31,6 +31,7 @@
#include <mono/metadata/mono-config.h>
#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-gc.h>
#include "os/dir_access.h"
#include "os/file_access.h"
@@ -272,7 +273,7 @@ bool GDMono::_load_assembly(const String &p_name, GDMonoAssembly **r_assembly) {
if (OS::get_singleton()->is_stdout_verbose())
OS::get_singleton()->print((String() + "Mono: Loading assembly " + p_name + "...\n").utf8());
- MonoImageOpenStatus status;
+ MonoImageOpenStatus status = MONO_IMAGE_OK;
MonoAssemblyName *aname = mono_assembly_name_new(p_name.utf8());
MonoAssembly *assembly = mono_assembly_load_full(aname, NULL, &status, false);
mono_assembly_name_free(aname);
@@ -438,10 +439,14 @@ Error GDMono::_unload_scripts_domain() {
if (mono_domain_get() != root_domain)
mono_domain_set(root_domain, true);
+ mono_gc_collect(mono_gc_max_generation());
+
finalizing_scripts_domain = true;
mono_domain_finalize(scripts_domain, 2000);
finalizing_scripts_domain = false;
+ mono_gc_collect(mono_gc_max_generation());
+
_domain_assemblies_cleanup(mono_domain_get_id(scripts_domain));
api_assembly = NULL;
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index d96dfebe6c..5a34fc3cd9 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -1109,7 +1109,7 @@ void VisualScriptConstant::_bind_methods() {
}
ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_constant_type", "get_constant_type");
- ADD_PROPERTY(PropertyInfo(Variant::NIL, "value"), "set_constant_value", "get_constant_value");
+ ADD_PROPERTY(PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "set_constant_value", "get_constant_value");
}
class VisualScriptNodeInstanceConstant : public VisualScriptNodeInstance {