Allow plugin scene change signal to report null for empty scenes.

This commit is contained in:
Jared 2018-09-17 12:14:10 +03:00
parent f84893f709
commit f115f00ec6
2 changed files with 3 additions and 4 deletions

View File

@ -453,7 +453,7 @@
<argument index="0" name="screen_name" type="String"> <argument index="0" name="screen_name" type="String">
</argument> </argument>
<description> <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> </description>
</signal> </signal>
<signal name="resource_saved"> <signal name="resource_saved">
@ -466,14 +466,14 @@
<argument index="0" name="scene_root" type="Node"> <argument index="0" name="scene_root" type="Node">
</argument> </argument>
<description> <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> </description>
</signal> </signal>
<signal name="scene_closed"> <signal name="scene_closed">
<argument index="0" name="filepath" type="String"> <argument index="0" name="filepath" type="String">
</argument> </argument>
<description> <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> </description>
</signal> </signal>
</signals> </signals>

View File

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