1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Add a keyword for abstract classes in GDScript

Co-authored-by: Danil Alexeev <danil@alexeev.xyz>
This commit is contained in:
Aaron Franke
2023-10-08 16:22:25 -05:00
parent 730adf4801
commit 067704f1cd
17 changed files with 137 additions and 42 deletions

View File

@@ -219,6 +219,10 @@ bool CreateDialog::_should_hide_type(const StringName &p_type) const {
i = script_path.find_char('/', i + 1);
}
}
// Abstract scripts cannot be instantiated.
String path = ScriptServer::get_global_class_path(p_type);
Ref<Script> scr = ResourceLoader::load(path, "Script");
return scr.is_null() || scr->is_abstract();
}
return false;