diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-11 13:27:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-11 13:27:51 +0100 |
commit | 6b1628f9fcc50dc16af08c2b87f27108ff6e15c5 (patch) | |
tree | 5bb1ef20e714dc1d9a8421ee2419036534d2f230 /editor/plugins | |
parent | 5c038acdc159708113fdc911c44abf1d6dcdbdf7 (diff) | |
parent | 83069a3c0f01507acd24672c90b24c9eba868aba (diff) |
Merge pull request #33517 from madmiraal/fix-_MSG-macros
Send *_MSG macros' explanations directly to the _err_print_error().
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/version_control_editor_plugin.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 66b16b82a0..783797ada4 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -106,29 +106,20 @@ void VersionControlEditorPlugin::_initialize_vcs() { register_editor(); - if (EditorVCSInterface::get_singleton()) { - - ERR_EXPLAIN(EditorVCSInterface::get_singleton()->get_vcs_name() + " is already active"); - return; - } + ERR_FAIL_COND_MSG(EditorVCSInterface::get_singleton(), EditorVCSInterface::get_singleton()->get_vcs_name() + " is already active"); const int id = set_up_choice->get_selected_id(); String selected_addon = set_up_choice->get_item_text(id); String path = ScriptServer::get_global_class_path(selected_addon); Ref<Script> script = ResourceLoader::load(path); - if (!script.is_valid()) { - ERR_EXPLAIN("VCS Addon path is invalid"); - } + ERR_FAIL_COND_MSG(!script.is_valid(), "VCS Addon path is invalid"); EditorVCSInterface *vcs_interface = memnew(EditorVCSInterface); ScriptInstance *addon_script_instance = script->instance_create(vcs_interface); - if (!addon_script_instance) { - ERR_FAIL_NULL(addon_script_instance); - return; - } + ERR_FAIL_COND_MSG(!addon_script_instance, "Failed to create addon script instance."); // The addon is attached as a script to the VCS interface as a proxy end-point vcs_interface->set_script_and_instance(script.get_ref_ptr(), addon_script_instance); @@ -137,10 +128,8 @@ void VersionControlEditorPlugin::_initialize_vcs() { EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_refresh_stage_area"); String res_dir = OS::get_singleton()->get_resource_dir(); - if (!EditorVCSInterface::get_singleton()->initialize(res_dir)) { - ERR_EXPLAIN("VCS was not initialized"); - } + ERR_FAIL_COND_MSG(!EditorVCSInterface::get_singleton()->initialize(res_dir), "VCS was not initialized"); _refresh_stage_area(); } |