Pārlūkot izejas kodu

Don't edit objects when loading folding

kobewi 5 mēneši atpakaļ
vecāks
revīzija
c6c1a49bea
3 mainītis faili ar 7 papildinājumiem un 4 dzēšanām
  1. 5 2
      core/object/object.cpp
  2. 1 1
      core/object/object.h
  3. 1 1
      editor/editor_folding.cpp

+ 5 - 2
core/object/object.cpp

@@ -1654,8 +1654,11 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
 }
 
 #ifdef TOOLS_ENABLED
-void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded) {
-	set_edited(true);
+void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded, bool p_initializing) {
+	if (!p_initializing) {
+		set_edited(true);
+	}
+
 	if (p_unfolded) {
 		editor_section_folding.insert(p_section);
 	} else {

+ 1 - 1
core/object/object.h

@@ -974,7 +974,7 @@ public:
 
 #ifdef TOOLS_ENABLED
 	virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
-	void editor_set_section_unfold(const String &p_section, bool p_unfolded);
+	void editor_set_section_unfold(const String &p_section, bool p_unfolded, bool p_initializing = false);
 	bool editor_is_section_unfolded(const String &p_section);
 	const HashSet<String> &editor_get_section_folding() const { return editor_section_folding; }
 	void editor_clear_section_folding() { editor_section_folding.clear(); }

+ 1 - 1
editor/editor_folding.cpp

@@ -65,7 +65,7 @@ void EditorFolding::_set_unfolds(Object *p_object, const Vector<String> &p_unfol
 	const String *r = p_unfolds.ptr();
 	p_object->editor_clear_section_folding();
 	for (int i = 0; i < uc; i++) {
-		p_object->editor_set_section_unfold(r[i], true);
+		p_object->editor_set_section_unfold(r[i], true, true);
 	}
 }