Adds 'exposed' field to ClassInfo
This field represents if the class is exposed to the scripting API.
The value is 'true' if the class was registered manually ('ClassDB::register_*class()'), otherwise it's false (registered on '_post_initialize').
- Added missing registration of classes that are meant to be exposed.
This commit is contained in:
@ -205,6 +205,7 @@ ClassDB::ClassInfo::ClassInfo() {
|
||||
creation_func = NULL;
|
||||
inherits_ptr = NULL;
|
||||
disabled = false;
|
||||
exposed = false;
|
||||
}
|
||||
ClassDB::ClassInfo::~ClassInfo() {
|
||||
}
|
||||
@ -1284,6 +1285,15 @@ bool ClassDB::is_class_enabled(StringName p_class) {
|
||||
return !ti->disabled;
|
||||
}
|
||||
|
||||
bool ClassDB::is_class_exposed(StringName p_class) {
|
||||
|
||||
OBJTYPE_RLOCK;
|
||||
|
||||
ClassInfo *ti = classes.getptr(p_class);
|
||||
ERR_FAIL_COND_V(!ti, false);
|
||||
return ti->exposed;
|
||||
}
|
||||
|
||||
StringName ClassDB::get_category(const StringName &p_node) {
|
||||
|
||||
ERR_FAIL_COND_V(!classes.has(p_node), StringName());
|
||||
|
||||
Reference in New Issue
Block a user