diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-06 14:12:19 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-08 10:08:34 +0100 |
commit | 317cd0b19a284f9a7296fcb4e06d9b2362da8c85 (patch) | |
tree | bdc9052230c16a9c6dcab330e84f51c8b62658e7 /editor/plugins/script_editor_plugin.cpp | |
parent | 0154ce2c8d66528d617e10b139640fd4c4405c6b (diff) |
Refactor some object type checking code with `cast_to`
Less stringly typed logic, and less String allocations and comparisons.
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index b20f9650ac..fdda1556ff 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2265,7 +2265,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra if (use_external_editor && (EditorDebuggerNode::get_singleton()->get_dump_stack_script() != p_resource || EditorDebuggerNode::get_singleton()->get_debug_with_external_editor()) && p_resource->get_path().is_resource_file() && - p_resource->get_class_name() != StringName("VisualScript")) { + !Ref<VisualScript>(p_resource).is_valid()) { String path = EditorSettings::get_singleton()->get("text_editor/external/exec_path"); String flags = EditorSettings::get_singleton()->get("text_editor/external/exec_flags"); @@ -2364,7 +2364,7 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra se->set_edited_resource(p_resource); - if (p_resource->get_class_name() != StringName("VisualScript")) { + if (!Ref<VisualScript>(p_resource).is_valid()) { bool highlighter_set = false; for (int i = 0; i < syntax_highlighters.size(); i++) { Ref<EditorSyntaxHighlighter> highlighter = syntax_highlighters[i]->_create(); |