diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_properties.cpp | 16 | ||||
-rw-r--r-- | editor/editor_properties.h | 1 | ||||
-rw-r--r-- | editor/editor_properties_array_dict.cpp | 12 | ||||
-rw-r--r-- | editor/editor_properties_array_dict.h | 4 |
4 files changed, 20 insertions, 13 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 0cbd5f0bff..1c1d72e7d1 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -61,7 +61,7 @@ void EditorPropertyText::_text_changed(const String &p_string) { if (updating) return; - emit_signal("property_changed", get_edited_property(), p_string); + emit_signal("property_changed", get_edited_property(), p_string, true); } void EditorPropertyText::update_property() { @@ -92,12 +92,11 @@ EditorPropertyText::EditorPropertyText() { void EditorPropertyMultilineText::_big_text_changed() { text->set_text(big_text->get_text()); - emit_signal("property_changed", get_edited_property(), big_text->get_text()); + emit_signal("property_changed", get_edited_property(), big_text->get_text(), true); } void EditorPropertyMultilineText::_text_changed() { - - emit_signal("property_changed", get_edited_property(), text->get_text()); + emit_signal("property_changed", get_edited_property(), text->get_text(), true); } void EditorPropertyMultilineText::_open_big_text() { @@ -1735,12 +1734,18 @@ EditorPropertyTransform::EditorPropertyTransform() { void EditorPropertyColor::_color_changed(const Color &p_color) { - emit_signal("property_changed", get_edited_property(), p_color); + emit_signal("property_changed", get_edited_property(), p_color, true); +} + +void EditorPropertyColor::_popup_closed() { + + emit_signal("property_changed", get_edited_property(), picker->get_pick_color(), false); } void EditorPropertyColor::_bind_methods() { ClassDB::bind_method(D_METHOD("_color_changed"), &EditorPropertyColor::_color_changed); + ClassDB::bind_method(D_METHOD("_popup_closed"), &EditorPropertyColor::_popup_closed); } void EditorPropertyColor::update_property() { @@ -1758,6 +1763,7 @@ EditorPropertyColor::EditorPropertyColor() { add_child(picker); picker->set_flat(true); picker->connect("color_changed", this, "_color_changed"); + picker->connect("popup_closed", this, "_popup_closed"); } ////////////// NODE PATH ////////////////////// diff --git a/editor/editor_properties.h b/editor/editor_properties.h index d5fac9c1a0..ea107d76b0 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -476,6 +476,7 @@ class EditorPropertyColor : public EditorProperty { GDCLASS(EditorPropertyColor, EditorProperty) ColorPickerButton *picker; void _color_changed(const Color &p_color); + void _popup_closed(); protected: static void _bind_methods(); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 8203c85c6a..23dbb026dd 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -125,13 +125,13 @@ EditorPropertyDictionaryObject::EditorPropertyDictionaryObject() { ///////////////////// ARRAY /////////////////////////// -void EditorPropertyArray::_property_changed(const String &p_prop, Variant p_value) { +void EditorPropertyArray::_property_changed(const String &p_prop, Variant p_value, bool changing) { if (p_prop.begins_with("indices")) { int idx = p_prop.get_slice("/", 1).to_int(); Variant array = object->get_array(); array.set(idx, p_value); - emit_signal("property_changed", get_edited_property(), array); + emit_signal("property_changed", get_edited_property(), array, true); if (array.get_type() == Variant::ARRAY) { array = array.call("duplicate"); //dupe, so undo/redo works better @@ -544,7 +544,7 @@ void EditorPropertyArray::_bind_methods() { ClassDB::bind_method("_edit_pressed", &EditorPropertyArray::_edit_pressed); ClassDB::bind_method("_page_changed", &EditorPropertyArray::_page_changed); ClassDB::bind_method("_length_changed", &EditorPropertyArray::_length_changed); - ClassDB::bind_method("_property_changed", &EditorPropertyArray::_property_changed); + ClassDB::bind_method("_property_changed", &EditorPropertyArray::_property_changed, DEFVAL(false)); ClassDB::bind_method("_change_type", &EditorPropertyArray::_change_type); ClassDB::bind_method("_change_type_menu", &EditorPropertyArray::_change_type_menu); } @@ -579,7 +579,7 @@ EditorPropertyArray::EditorPropertyArray() { ///////////////////// DICTIONARY /////////////////////////// -void EditorPropertyDictionary::_property_changed(const String &p_prop, Variant p_value) { +void EditorPropertyDictionary::_property_changed(const String &p_prop, Variant p_value, bool changing) { if (p_prop == "new_item_key") { @@ -593,7 +593,7 @@ void EditorPropertyDictionary::_property_changed(const String &p_prop, Variant p Variant key = dict.get_key_at_index(idx); dict[key] = p_value; - emit_signal("property_changed", get_edited_property(), dict); + emit_signal("property_changed", get_edited_property(), dict, true); dict = dict.duplicate(); //dupe, so undo/redo works better object->set_dict(dict); @@ -1006,7 +1006,7 @@ void EditorPropertyDictionary::_page_changed(double p_page) { void EditorPropertyDictionary::_bind_methods() { ClassDB::bind_method("_edit_pressed", &EditorPropertyDictionary::_edit_pressed); ClassDB::bind_method("_page_changed", &EditorPropertyDictionary::_page_changed); - ClassDB::bind_method("_property_changed", &EditorPropertyDictionary::_property_changed); + ClassDB::bind_method("_property_changed", &EditorPropertyDictionary::_property_changed, DEFVAL(false)); ClassDB::bind_method("_change_type", &EditorPropertyDictionary::_change_type); ClassDB::bind_method("_change_type_menu", &EditorPropertyDictionary::_change_type_menu); ClassDB::bind_method("_add_key_value", &EditorPropertyDictionary::_add_key_value); diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h index 75c67d280d..a8ddb02e9d 100644 --- a/editor/editor_properties_array_dict.h +++ b/editor/editor_properties_array_dict.h @@ -67,7 +67,7 @@ class EditorPropertyArray : public EditorProperty { void _page_changed(double p_page); void _length_changed(double p_page); void _edit_pressed(); - void _property_changed(const String &p_prop, Variant p_value); + void _property_changed(const String &p_prop, Variant p_value, bool changing = false); void _change_type(Object *p_button, int p_index); void _change_type_menu(int p_index); @@ -99,7 +99,7 @@ class EditorPropertyDictionary : public EditorProperty { void _page_changed(double p_page); void _edit_pressed(); - void _property_changed(const String &p_prop, Variant p_value); + void _property_changed(const String &p_prop, Variant p_value, bool changing = false); void _change_type(Object *p_button, int p_index); void _change_type_menu(int p_index); |