Fix ScriptTextEditor encapsulation

This commit is contained in:
Yuri Roubinsky 2019-12-18 22:32:25 +03:00
parent 9cda7f7333
commit c89df816c1
5 changed files with 15 additions and 13 deletions

View file

@ -987,11 +987,8 @@ Array ScriptEditor::_get_open_scripts() const {
return ret;
}
bool ScriptEditor::toggle_scripts_panel(CodeTextEditor *p_editor) {
bool ScriptEditor::toggle_scripts_panel() {
list_split->set_visible(!list_split->is_visible());
if (p_editor) {
p_editor->update_toggle_scripts_button();
}
return list_split->is_visible();
}
@ -1141,14 +1138,13 @@ void ScriptEditor::_menu_option(int p_option) {
} break;
case TOGGLE_SCRIPTS_PANEL: {
if (current) {
CodeTextEditor *code_editor = NULL;
ScriptTextEditor *editor = dynamic_cast<ScriptTextEditor *>(current);
ScriptTextEditor *editor = Object::cast_to<ScriptTextEditor>(current);
toggle_scripts_panel();
if (editor) {
code_editor = editor->code_editor;
editor->update_toggle_scripts_button();
}
toggle_scripts_panel(code_editor);
} else {
toggle_scripts_panel(NULL);
toggle_scripts_panel();
}
}
}