diff options
author | trollodel <33117082+trollodel@users.noreply.github.com> | 2022-01-27 10:36:51 +0100 |
---|---|---|
committer | trollodel <33117082+trollodel@users.noreply.github.com> | 2022-02-14 14:16:24 +0100 |
commit | 05b56f316ddc94c2bb55b62477ec3914fe81a220 (patch) | |
tree | 928404930fc4f99dfb45d64a6b510e66e2bcc357 /modules/gltf | |
parent | f5a27ee4fe45925cebfda11ea7d53ca8f39e0a13 (diff) |
Remove most EditorNode constructor parameters and fields
Diffstat (limited to 'modules/gltf')
-rw-r--r-- | modules/gltf/editor_scene_exporter_gltf_plugin.cpp | 13 | ||||
-rw-r--r-- | modules/gltf/editor_scene_exporter_gltf_plugin.h | 3 |
2 files changed, 7 insertions, 9 deletions
diff --git a/modules/gltf/editor_scene_exporter_gltf_plugin.cpp b/modules/gltf/editor_scene_exporter_gltf_plugin.cpp index 9cae1cd87a..f9bfde5597 100644 --- a/modules/gltf/editor_scene_exporter_gltf_plugin.cpp +++ b/modules/gltf/editor_scene_exporter_gltf_plugin.cpp @@ -53,10 +53,9 @@ bool SceneExporterGLTFPlugin::has_main_screen() const { return false; } -SceneExporterGLTFPlugin::SceneExporterGLTFPlugin(EditorNode *p_node) { - editor = p_node; +SceneExporterGLTFPlugin::SceneExporterGLTFPlugin(EditorNode *_p_node) { file_export_lib = memnew(EditorFileDialog); - editor->get_gui_base()->add_child(file_export_lib); + EditorNode::get_singleton()->get_gui_base()->add_child(file_export_lib); file_export_lib->connect("file_selected", callable_mp(this, &SceneExporterGLTFPlugin::_gltf2_dialog_action)); file_export_lib->set_title(TTR("Export Library")); file_export_lib->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); @@ -70,9 +69,9 @@ SceneExporterGLTFPlugin::SceneExporterGLTFPlugin(EditorNode *p_node) { } void SceneExporterGLTFPlugin::_gltf2_dialog_action(String p_file) { - Node *root = editor->get_tree()->get_edited_scene_root(); + Node *root = EditorNode::get_singleton()->get_tree()->get_edited_scene_root(); if (!root) { - editor->show_accept(TTR("This operation can't be done without a scene."), TTR("OK")); + EditorNode::get_singleton()->show_accept(TTR("This operation can't be done without a scene."), TTR("OK")); return; } List<String> deps; @@ -93,9 +92,9 @@ void SceneExporterGLTFPlugin::_gltf2_dialog_action(String p_file) { } void SceneExporterGLTFPlugin::convert_scene_to_gltf2() { - Node *root = editor->get_tree()->get_edited_scene_root(); + Node *root = EditorNode::get_singleton()->get_tree()->get_edited_scene_root(); if (!root) { - editor->show_accept(TTR("This operation can't be done without a scene."), TTR("OK")); + EditorNode::get_singleton()->show_accept(TTR("This operation can't be done without a scene."), TTR("OK")); return; } String filename = String(root->get_scene_file_path().get_file().get_basename()); diff --git a/modules/gltf/editor_scene_exporter_gltf_plugin.h b/modules/gltf/editor_scene_exporter_gltf_plugin.h index 99d8911f46..50febd45c9 100644 --- a/modules/gltf/editor_scene_exporter_gltf_plugin.h +++ b/modules/gltf/editor_scene_exporter_gltf_plugin.h @@ -38,7 +38,6 @@ class SceneExporterGLTFPlugin : public EditorPlugin { GDCLASS(SceneExporterGLTFPlugin, EditorPlugin); - EditorNode *editor = nullptr; EditorFileDialog *file_export_lib = nullptr; void _gltf2_dialog_action(String p_file); void convert_scene_to_gltf2(); @@ -46,7 +45,7 @@ class SceneExporterGLTFPlugin : public EditorPlugin { public: virtual String get_name() const override; bool has_main_screen() const override; - SceneExporterGLTFPlugin(class EditorNode *p_node); + SceneExporterGLTFPlugin(EditorNode *_p_node); }; #endif // TOOLS_ENABLED #endif // EDITOR_SCENE_EXPORTER_GLTF_PLUGIN_H |