aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/property_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/property_editor.cpp')
-rw-r--r--tools/editor/property_editor.cpp44
1 files changed, 28 insertions, 16 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 246785932..54d197f10 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -389,7 +389,6 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
List<String> names;
names.push_back("value:");
config_value_editors(1,1,50,names);
- Vector3 vec=v;
value_editor[0]->set_text( String::num(v) );
}
@@ -436,7 +435,6 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
List<String> names;
names.push_back("string:");
config_value_editors(1,1,50,names);
- Vector3 vec=v;
value_editor[0]->set_text( v );
}
@@ -612,6 +610,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
color_picker->set_edit_alpha(hint!=PROPERTY_HINT_COLOR_NO_ALPHA);
color_picker->set_color(v);
set_size( Size2(300*EDSCALE, color_picker->get_combined_minimum_size().height+10*EDSCALE));
+ color_picker->set_focus_on_line_edit();
/*
int ofs=80;
int m=10;
@@ -2980,10 +2979,8 @@ void PropertyEditor::update_tree() {
else
item->set_cell_mode( 1, TreeItem::CELL_MODE_RANGE_EXPRESSION );
- if (p.hint==PROPERTY_HINT_SPRITE_FRAME) {
- item->set_range_config(1,0,99999,1);
- } else if (p.hint==PROPERTY_HINT_RANGE || p.hint==PROPERTY_HINT_EXP_RANGE) {
+ if (p.hint==PROPERTY_HINT_SPRITE_FRAME || p.hint==PROPERTY_HINT_RANGE || p.hint==PROPERTY_HINT_EXP_RANGE) {
int c = p.hint_string.get_slice_count(",");
float min=0,max=100,step=1;
@@ -3346,7 +3343,6 @@ void PropertyEditor::update_tree() {
String type;
if (p.hint==PROPERTY_HINT_RESOURCE_TYPE)
type=p.hint_string;
- bool notnil=false;
if (obj->get( p.name ).get_type() == Variant::NIL || obj->get( p.name ).operator RefPtr().is_null()) {
item->set_text(1,"<null>");
@@ -3369,8 +3365,7 @@ void PropertyEditor::update_tree() {
} else {
item->set_text(1,"<"+res->get_type()+">");
- };
- notnil=true;
+ }
if (has_icon(res->get_type(),"EditorIcons")) {
type=res->get_type();
@@ -4192,6 +4187,8 @@ public:
void SectionedPropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected);
+
+ ObjectTypeDB::bind_method("update_category_list", &SectionedPropertyEditor::update_category_list);
}
void SectionedPropertyEditor::_section_selected(int p_which) {
@@ -4235,19 +4232,32 @@ String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
void SectionedPropertyEditor::edit(Object* p_object) {
- if (p_object) {
- obj=p_object->get_instance_ID();
- update_category_list();
- } else {
+ if (!p_object) {
+ obj = -1;
sections->clear();
+
+ filter->set_edited(NULL);
+ editor->edit(NULL);
+
+ return;
}
- filter->set_edited(p_object);
- editor->edit(filter);
+ ObjectID id = p_object->get_instance_ID();
- sections->select(0);
- _section_selected(0);
+ if (obj != id) {
+
+ obj = id;
+ update_category_list();
+ filter->set_edited(p_object);
+ editor->edit(filter);
+
+ sections->select(0);
+ _section_selected(0);
+ } else {
+
+ update_category_list();
+ }
}
void SectionedPropertyEditor::update_category_list() {
@@ -4303,6 +4313,8 @@ PropertyEditor *SectionedPropertyEditor::get_property_editor() {
SectionedPropertyEditor::SectionedPropertyEditor() {
+ obj = -1;
+
VBoxContainer *left_vb = memnew( VBoxContainer);
left_vb->set_custom_minimum_size(Size2(160,0)*EDSCALE);
add_child(left_vb);