summaryrefslogtreecommitdiffstats
path: root/core/object/script_language_extension.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/object/script_language_extension.h')
-rw-r--r--core/object/script_language_extension.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h
index bf5ad3c107..f4a638f63e 100644
--- a/core/object/script_language_extension.h
+++ b/core/object/script_language_extension.h
@@ -110,6 +110,12 @@ public:
EXBIND0RC(bool, is_tool)
EXBIND0RC(bool, is_valid)
+ virtual bool is_abstract() const override {
+ bool abst;
+ return GDVIRTUAL_CALL(_is_abstract, abst) && abst;
+ }
+ GDVIRTUAL0RC(bool, _is_abstract)
+
EXBIND0RC(ScriptLanguage *, get_language)
EXBIND1RC(bool, has_script_signal, const StringName &)
@@ -344,7 +350,9 @@ public:
GDVIRTUAL_REQUIRED_CALL(_create_script, ret);
return Object::cast_to<Script>(ret);
}
+#ifndef DISABLE_DEPRECATED
EXBIND0RC(bool, has_named_classes)
+#endif
EXBIND0RC(bool, supports_builtin_mode)
EXBIND0RC(bool, supports_documentation)
EXBIND0RC(bool, can_inherit_from_file)
@@ -688,7 +696,26 @@ public:
return Variant::NIL;
}
virtual void validate_property(PropertyInfo &p_property) const override {
- // TODO
+ if (native_info->validate_property_func) {
+ // GDExtension uses a StringName rather than a String for property name.
+ StringName prop_name = p_property.name;
+ GDExtensionPropertyInfo gdext_prop = {
+ (GDExtensionVariantType)p_property.type,
+ &prop_name,
+ &p_property.class_name,
+ (uint32_t)p_property.hint,
+ &p_property.hint_string,
+ p_property.usage,
+ };
+ if (native_info->validate_property_func(instance, &gdext_prop)) {
+ p_property.type = (Variant::Type)gdext_prop.type;
+ p_property.name = *reinterpret_cast<StringName *>(gdext_prop.name);
+ p_property.class_name = *reinterpret_cast<StringName *>(gdext_prop.class_name);
+ p_property.hint = (PropertyHint)gdext_prop.hint;
+ p_property.hint_string = *reinterpret_cast<String *>(gdext_prop.hint_string);
+ p_property.usage = gdext_prop.usage;
+ }
+ }
}
virtual bool property_can_revert(const StringName &p_name) const override {