Skip to content

Commit 2f811f3

Browse files
committed
Merge pull request godotengine#103697 from KoBeWi/resource_edited_before_loaded
Don't edit objects when loading folding
2 parents ec5e096 + c6c1a49 commit 2f811f3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

core/object/object.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,8 +1654,11 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
16541654
}
16551655

16561656
#ifdef TOOLS_ENABLED
1657-
void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded) {
1658-
set_edited(true);
1657+
void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded, bool p_initializing) {
1658+
if (!p_initializing) {
1659+
set_edited(true);
1660+
}
1661+
16591662
if (p_unfolded) {
16601663
editor_section_folding.insert(p_section);
16611664
} else {

core/object/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ class Object {
974974

975975
#ifdef TOOLS_ENABLED
976976
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const;
977-
void editor_set_section_unfold(const String &p_section, bool p_unfolded);
977+
void editor_set_section_unfold(const String &p_section, bool p_unfolded, bool p_initializing = false);
978978
bool editor_is_section_unfolded(const String &p_section);
979979
const HashSet<String> &editor_get_section_folding() const { return editor_section_folding; }
980980
void editor_clear_section_folding() { editor_section_folding.clear(); }

editor/editor_folding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void EditorFolding::_set_unfolds(Object *p_object, const Vector<String> &p_unfol
6565
const String *r = p_unfolds.ptr();
6666
p_object->editor_clear_section_folding();
6767
for (int i = 0; i < uc; i++) {
68-
p_object->editor_set_section_unfold(r[i], true);
68+
p_object->editor_set_section_unfold(r[i], true, true);
6969
}
7070
}
7171

0 commit comments

Comments
 (0)