You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Removed faulty function update after get_property_list.
The function tried to rearrange properties but that lead to problems with duplication or deleted properties. Implemented the logic that that function did inside the get_property_list both for tool scripts and non-tool scripts.
This commit is contained in:
@@ -101,6 +101,31 @@ Dictionary Script::_get_script_constant_map() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
PropertyInfo Script::get_class_category() const {
|
||||
String path = get_path();
|
||||
String name;
|
||||
|
||||
if (is_built_in()) {
|
||||
if (get_name().is_empty()) {
|
||||
name = TTR("Built-in script");
|
||||
} else {
|
||||
name = vformat("%s (%s)", get_name(), TTR("Built-in"));
|
||||
}
|
||||
} else {
|
||||
if (get_name().is_empty()) {
|
||||
name = path.get_file();
|
||||
} else {
|
||||
name = get_name();
|
||||
}
|
||||
}
|
||||
|
||||
return PropertyInfo(Variant::NIL, name, PROPERTY_HINT_NONE, path, PROPERTY_USAGE_CATEGORY);
|
||||
}
|
||||
|
||||
#endif // TOOLS_ENABLED
|
||||
|
||||
void Script::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("can_instantiate"), &Script::can_instantiate);
|
||||
//ClassDB::bind_method(D_METHOD("instance_create","base_object"),&Script::instance_create);
|
||||
|
||||
Reference in New Issue
Block a user