diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-14 16:40:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 16:40:40 +0100 |
commit | f810f76890f23843f3895262fe2f88a7d5d3c3f3 (patch) | |
tree | cc47e48e0e378357dc4d82822a0d8c415990df1e /editor/plugins/shader_file_editor_plugin.cpp | |
parent | cd6301ae255f7d4fc6f0c885ea1531b4574512e9 (diff) | |
parent | 05b56f316ddc94c2bb55b62477ec3914fe81a220 (diff) |
Merge pull request #57306 from trollodel/remove_editornode_param
Diffstat (limited to 'editor/plugins/shader_file_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/shader_file_editor_plugin.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index 8250164885..6d761729b0 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -245,7 +245,7 @@ void ShaderFileEditor::_shader_changed() { ShaderFileEditor *ShaderFileEditor::singleton = nullptr; -ShaderFileEditor::ShaderFileEditor(EditorNode *p_node) { +ShaderFileEditor::ShaderFileEditor() { singleton = this; HSplitContainer *main_hs = memnew(HSplitContainer); @@ -301,22 +301,21 @@ bool ShaderFileEditorPlugin::handles(Object *p_object) const { void ShaderFileEditorPlugin::make_visible(bool p_visible) { if (p_visible) { button->show(); - editor->make_bottom_panel_item_visible(shader_editor); + EditorNode::get_singleton()->make_bottom_panel_item_visible(shader_editor); } else { button->hide(); if (shader_editor->is_visible_in_tree()) { - editor->hide_bottom_panel(); + EditorNode::get_singleton()->hide_bottom_panel(); } } } -ShaderFileEditorPlugin::ShaderFileEditorPlugin(EditorNode *p_node) { - editor = p_node; - shader_editor = memnew(ShaderFileEditor(p_node)); +ShaderFileEditorPlugin::ShaderFileEditorPlugin() { + shader_editor = memnew(ShaderFileEditor); shader_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE); - button = editor->add_bottom_panel_item(TTR("ShaderFile"), shader_editor); + button = EditorNode::get_singleton()->add_bottom_panel_item(TTR("ShaderFile"), shader_editor); button->hide(); } |