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
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
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;