Skip to content

Commit

Permalink
Merge pull request #41697 from EricEzaM/bug/editor-inspector-refresh-fix
Browse files Browse the repository at this point in the history
Fix editor inspector refresh not working
  • Loading branch information
akien-mga authored Sep 2, 2020
2 parents d70a17d + 5612770 commit 6e89d37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ void EditorInspector::refresh() {
if (refresh_countdown > 0 || changing) {
return;
}
refresh_countdown = EditorSettings::get_singleton()->get("docks/property_editor/auto_refresh_interval");
refresh_countdown = refresh_interval_cache;
}

Object *EditorInspector::get_edited_object() {
Expand Down Expand Up @@ -2332,6 +2332,8 @@ void EditorInspector::_node_removed(Node *p_node) {
void EditorInspector::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) {
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &EditorInspector::_feature_profile_changed));
refresh_interval_cache = EDITOR_GET("docks/property_editor/auto_refresh_interval");
refresh_countdown = refresh_interval_cache;
}

if (p_what == NOTIFICATION_ENTER_TREE) {
Expand Down Expand Up @@ -2367,6 +2369,9 @@ void EditorInspector::_notification(int p_what) {
}
}
}
} else {
// Restart countdown if <= 0
refresh_countdown = refresh_interval_cache;
}

changing++;
Expand Down Expand Up @@ -2399,6 +2404,9 @@ void EditorInspector::_notification(int p_what) {
add_theme_style_override("bg", get_theme_stylebox("bg", "Tree"));
}

refresh_interval_cache = EDITOR_GET("docks/property_editor/auto_refresh_interval");
refresh_countdown = refresh_interval_cache;

update_tree();
}
}
Expand Down Expand Up @@ -2562,6 +2570,7 @@ EditorInspector::EditorInspector() {
update_all_pending = false;
update_tree_pending = false;
refresh_countdown = 0;
refresh_interval_cache = 0;
read_only = false;
search_box = nullptr;
keying = false;
Expand Down
1 change: 1 addition & 0 deletions editor/editor_inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class EditorInspector : public ScrollContainer {
bool deletable_properties;

float refresh_countdown;
float refresh_interval_cache;
bool update_tree_pending;
StringName _prop_edited;
StringName property_selected;
Expand Down

0 comments on commit 6e89d37

Please sign in to comment.