Merge pull request #28598 from Chaosus/fix_vs_switching

Fix input entries when switching to new visual shader
This commit is contained in:
Yuri Roubinsky 2019-05-02 10:15:21 +03:00 committed by GitHub
commit d42f11b259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -58,11 +58,9 @@ void VisualShaderNodePlugin::_bind_methods() {
void VisualShaderEditor::edit(VisualShader *p_visual_shader) { void VisualShaderEditor::edit(VisualShader *p_visual_shader) {
bool was_null = false; bool first_init = false;
if (p_visual_shader) { if (p_visual_shader) {
if (visual_shader.is_null()) { first_init = true;
was_null = true;
}
visual_shader = Ref<VisualShader>(p_visual_shader); visual_shader = Ref<VisualShader>(p_visual_shader);
} else { } else {
visual_shader.unref(); visual_shader.unref();
@ -71,7 +69,7 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) {
if (visual_shader.is_null()) { if (visual_shader.is_null()) {
hide(); hide();
} else { } else {
if (was_null) { // to avoid tree collapse if (first_init) { // to avoid tree collapse
_update_options_menu(); _update_options_menu();
} }
_update_graph(); _update_graph();