summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Roldán Etcheverry <neikeq@users.noreply.github.com>2022-12-02 03:19:49 +0100
committerGitHub <noreply@github.com>2022-12-02 03:19:49 +0100
commitbcc061edaeb8676b82dba0d857cfbf66638071b5 (patch)
tree48b2f57e691e992db087a959026d77fae8576f6f
parentbf9cf7d0346968ca482465ffb1fc2bf94f2ae877 (diff)
parent86f6662a8cb3ef640d9e21e037f35659a5049afc (diff)
Merge pull request #67023 from raulsntos/dotnet/fix-signal-callback-generation
C#: Fix signature of generated signal callbacks
-rw-r--r--modules/mono/csharp_script.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index cfb9a0fbfb..137fd61a25 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -391,10 +391,10 @@ bool CSharpLanguage::supports_builtin_mode() const {
#ifdef TOOLS_ENABLED
static String variant_type_to_managed_name(const String &p_var_type_name) {
if (p_var_type_name.is_empty()) {
- return "object";
+ return "Variant";
}
- if (!ClassDB::class_exists(p_var_type_name)) {
+ if (ClassDB::class_exists(p_var_type_name)) {
return p_var_type_name;
}
@@ -402,12 +402,12 @@ static String variant_type_to_managed_name(const String &p_var_type_name) {
return "Godot.Object";
}
+ if (p_var_type_name == Variant::get_type_name(Variant::INT)) {
+ return "long";
+ }
+
if (p_var_type_name == Variant::get_type_name(Variant::FLOAT)) {
-#ifdef REAL_T_IS_DOUBLE
return "double";
-#else
- return "float";
-#endif
}
if (p_var_type_name == Variant::get_type_name(Variant::STRING)) {
@@ -485,7 +485,7 @@ static String variant_type_to_managed_name(const String &p_var_type_name) {
}
}
- return "object";
+ return "Variant";
}
String CSharpLanguage::make_function(const String &, const String &p_name, const PackedStringArray &p_args) const {