فهرست منبع

Merge pull request #22178 from avencherus/scene-change-signal

Allow plugin scene change signal to report null for empty scenes.
Rémi Verschelde 6 سال پیش
والد
کامیت
1107602154
2فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 3 3
      doc/classes/EditorPlugin.xml
  2. 0 1
      editor/editor_plugin.cpp

+ 3 - 3
doc/classes/EditorPlugin.xml

@@ -453,7 +453,7 @@
 			<argument index="0" name="screen_name" type="String">
 			</argument>
 			<description>
-				Emitted when user change the workspace (2D, 3D, Script, AssetLib). Also works with custom screens defined by plugins.
+				Emitted when user changes the workspace (2D, 3D, Script, AssetLib). Also works with custom screens defined by plugins.
 			</description>
 		</signal>
 		<signal name="resource_saved">
@@ -466,14 +466,14 @@
 			<argument index="0" name="scene_root" type="Node">
 			</argument>
 			<description>
-				Emitted when user change scene. The argument is a root node of freshly opened scene.
+				Emitted when the scene is changed in the editor. The argument will return the root node of the scene that has just become active. If this scene is new and empty, the argument will be null.
 			</description>
 		</signal>
 		<signal name="scene_closed">
 			<argument index="0" name="filepath" type="String">
 			</argument>
 			<description>
-				Emitted when user close scene. The argument is file path to a closed scene.
+				Emitted when user closes a scene. The argument is file path to a closed scene.
 			</description>
 		</signal>
 	</signals>

+ 0 - 1
editor/editor_plugin.cpp

@@ -475,7 +475,6 @@ void EditorPlugin::set_force_draw_over_forwarding_enabled() {
 }
 
 void EditorPlugin::notify_scene_changed(const Node *scn_root) {
-	if (scn_root == NULL) return;
 	emit_signal("scene_changed", scn_root);
 }