summaryrefslogtreecommitdiff
path: root/editor/property_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/property_editor.cpp')
-rw-r--r--editor/property_editor.cpp66
1 files changed, 27 insertions, 39 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 0c1d7b9d9c..14e3b7cfb7 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -430,24 +430,19 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
} else if (hint == PROPERTY_HINT_LAYERS_2D_PHYSICS || hint == PROPERTY_HINT_LAYERS_2D_RENDER || hint == PROPERTY_HINT_LAYERS_3D_PHYSICS || hint == PROPERTY_HINT_LAYERS_3D_RENDER) {
- String title;
String basename;
switch (hint) {
case PROPERTY_HINT_LAYERS_2D_RENDER:
basename = "layer_names/2d_render";
- title = "2D Render Layers";
break;
case PROPERTY_HINT_LAYERS_2D_PHYSICS:
basename = "layer_names/2d_physics";
- title = "2D Physics Layers";
break;
case PROPERTY_HINT_LAYERS_3D_RENDER:
basename = "layer_names/3d_render";
- title = "3D Render Layers";
break;
case PROPERTY_HINT_LAYERS_3D_PHYSICS:
basename = "layer_names/3d_physics";
- title = "3D Physics Layers";
break;
}
@@ -469,11 +464,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
show();
- value_label[0]->set_text(title);
- value_label[0]->show();
- value_label[0]->set_position(Vector2(4, 4) * EDSCALE);
-
- checks20gc->set_position(Vector2(4, 4) * EDSCALE + Vector2(0, value_label[0]->get_size().height + 4 * EDSCALE));
+ checks20gc->set_position(Vector2(4, 4) * EDSCALE);
checks20gc->set_size(checks20gc->get_minimum_size());
set_size(Vector2(4, 4) * EDSCALE + checks20gc->get_position() + checks20gc->get_size());
@@ -656,7 +647,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
}
}
- if (type)
+ if (type != Variant::NIL)
property_select->select_property_from_basic_type(type, v);
updating = false;
@@ -2811,13 +2802,12 @@ void PropertyEditor::update_tree() {
TreeItem *sep = tree->create_item(root);
current_category = sep;
String type = p.name;
- //*
+
if (has_icon(type, "EditorIcons"))
sep->set_icon(0, get_icon(type, "EditorIcons"));
else
sep->set_icon(0, get_icon("Object", "EditorIcons"));
- //*/
sep->set_text(0, type);
sep->set_expand_right(0, true);
sep->set_selectable(0, false);
@@ -2943,38 +2933,36 @@ void PropertyEditor::update_tree() {
}
if (use_doc_hints) {
- StringName setter;
- StringName type;
- if (ClassDB::get_setter_and_type_for_property(obj->get_class_name(), p.name, type, setter)) {
- String descr;
- bool found = false;
- Map<StringName, Map<StringName, String> >::Element *E = descr_cache.find(type);
- if (E) {
+ StringName classname = obj->get_class_name();
+ StringName propname = p.name;
+ String descr;
+ bool found = false;
- Map<StringName, String>::Element *F = E->get().find(setter);
- if (F) {
- found = true;
- descr = F->get();
- }
+ Map<StringName, Map<StringName, String> >::Element *E = descr_cache.find(classname);
+ if (E) {
+ Map<StringName, String>::Element *F = E->get().find(propname);
+ if (F) {
+ found = true;
+ descr = F->get();
}
- if (!found) {
+ }
- DocData *dd = EditorHelp::get_doc_data();
- Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(type);
- if (E) {
- for (int i = 0; i < E->get().methods.size(); i++) {
- if (E->get().methods[i].name == setter.operator String()) {
- descr = E->get().methods[i].description.strip_edges().word_wrap(80);
- }
+ if (!found) {
+ DocData *dd = EditorHelp::get_doc_data();
+ Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(classname);
+ if (E) {
+ for (int i = 0; i < E->get().properties.size(); i++) {
+ if (E->get().properties[i].name == propname.operator String()) {
+ descr = E->get().properties[i].description.strip_edges().word_wrap(80);
}
}
-
- descr_cache[type][setter] = descr;
}
- item->set_tooltip(0, TTR("Property:") + " " + p.name + "\n\n" + descr);
+ descr_cache[classname][propname] = descr;
}
+
+ item->set_tooltip(0, TTR("Property:") + " " + p.name + "\n\n" + descr);
}
Dictionary d;
@@ -3740,8 +3728,8 @@ void PropertyEditor::_item_edited() {
_edit_set(name, item->get_text(1), refresh_all);
}
} break;
- // math types
+ // math types
case Variant::VECTOR3: {
} break;
@@ -4374,7 +4362,7 @@ class SectionedPropertyEditorFilter : public Object {
PropertyInfo pi = E->get();
int sp = pi.name.find("/");
- if (pi.name == "resource_path" || pi.name == "resource_name" || pi.name.begins_with("script/")) //skip resource stuff
+ if (pi.name == "resource_path" || pi.name == "resource_name" || pi.name == "resource_local_to_scene" || pi.name.begins_with("script/")) //skip resource stuff
continue;
if (sp == -1) {
@@ -4524,7 +4512,7 @@ void SectionedPropertyEditor::update_category_list() {
else if (!(pi.usage & PROPERTY_USAGE_EDITOR))
continue;
- if (pi.name.find(":") != -1 || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path")
+ if (pi.name.find(":") != -1 || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene")
continue;
if (search_box && search_box->get_text() != String() && pi.name.findn(search_box->get_text()) == -1)