Bladeren bron

History dock singleton, set default editor layout, ready notification

- add the history dock to the default editor layout, so when a user does Editor -> Editor Layout -> Default the history dock will no longer disappear
- change the enter tree notification to a ready notification to prevent the history dock from trying to connect 'on_history_changed' signal everytime the dock is moved in the editor layout
souplamp 2 jaren geleden
bovenliggende
commit
51cf968e56
2 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 1 1
      editor/editor_node.cpp
  2. 1 1
      editor/history_dock.cpp

+ 1 - 1
editor/editor_node.cpp

@@ -7035,7 +7035,7 @@ EditorNode::EditorNode() {
 	// Dock numbers are based on DockSlot enum value + 1.
 	default_layout->set_value(docks_section, "dock_3", "Scene,Import");
 	default_layout->set_value(docks_section, "dock_4", "FileSystem");
-	default_layout->set_value(docks_section, "dock_5", "Inspector,Node");
+	default_layout->set_value(docks_section, "dock_5", "Inspector,Node,History");
 
 	for (int i = 0; i < vsplits.size(); i++) {
 		default_layout->set_value(docks_section, "dock_split_" + itos(i + 1), 0);

+ 1 - 1
editor/history_dock.cpp

@@ -206,7 +206,7 @@ void HistoryDock::seek_history(int p_index) {
 
 void HistoryDock::_notification(int p_notification) {
 	switch (p_notification) {
-		case NOTIFICATION_ENTER_TREE: {
+		case NOTIFICATION_READY: {
 			EditorNode::get_singleton()->connect("scene_changed", callable_mp(this, &HistoryDock::on_history_changed));
 		} break;