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

Allow plugin scene change signal to report null for empty scenes.
This commit is contained in:
Rémi Verschelde 2018-11-04 21:47:10 +01:00 committed by GitHub
commit 1107602154
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -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>

View file

@ -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);
}