|
|
|
|
@ -2816,18 +2816,17 @@ void EditorInspector::update_tree() {
|
|
|
|
|
|
|
|
|
|
// `hint_script` should contain a native class name or a script path.
|
|
|
|
|
// Otherwise the category was probably added via `@export_category` or `_get_property_list()`.
|
|
|
|
|
// Do not add an icon, do not change the current class (`doc_name`) for custom categories.
|
|
|
|
|
if (p.hint_string.is_empty()) {
|
|
|
|
|
category->label = p.name;
|
|
|
|
|
category->set_tooltip_text(p.name);
|
|
|
|
|
continue; // Do not add an icon, do not change the current class (`doc_name`).
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
String type = p.name;
|
|
|
|
|
String label = p.name;
|
|
|
|
|
doc_name = p.name;
|
|
|
|
|
|
|
|
|
|
// Use category's owner script to update some of its information.
|
|
|
|
|
if (!EditorNode::get_editor_data().is_type_recognized(type) && p.hint_string.length() && ResourceLoader::exists(p.hint_string)) {
|
|
|
|
|
if (!EditorNode::get_editor_data().is_type_recognized(type) && ResourceLoader::exists(p.hint_string)) {
|
|
|
|
|
Ref<Script> scr = ResourceLoader::load(p.hint_string, "Script");
|
|
|
|
|
if (scr.is_valid()) {
|
|
|
|
|
StringName script_name = EditorNode::get_editor_data().script_class_get_name(scr->get_path());
|
|
|
|
|
@ -2864,6 +2863,7 @@ void EditorInspector::update_tree() {
|
|
|
|
|
// `|` separator used in `EditorHelpTooltip` for formatting.
|
|
|
|
|
category->set_tooltip_text("class|" + doc_name + "||");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Add editors at the start of a category.
|
|
|
|
|
for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
|
|
|
|
|
|