diff options
author | Braden Bodily <thebodily@gmail.com> | 2019-08-14 20:57:49 -0600 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-08-17 12:33:15 +0200 |
commit | 71d71d55b5c0d6da4d1555823ac432bf0b33389a (patch) | |
tree | 20b2e819d599d6d1bd459bb51880c31e97cfe825 /editor/editor_settings.cpp | |
parent | 40640a01dc90be00e55e4eef3c7800401ef63b18 (diff) | |
download | redot-engine-71d71d55b5c0d6da4d1555823ac432bf0b33389a.tar.gz |
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'
Condensed some if and ERR statements. Added dots to end of error messages
Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?),
core/os/memory.cpp,
drivers/png/png_driver_common.cpp,
drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r-- | editor/editor_settings.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index c4166c97fd..cb3bfa3a49 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1451,10 +1451,7 @@ void EditorSettings::add_shortcut(const String &p_name, Ref<ShortCut> &p_shortcu bool EditorSettings::is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const { const Map<String, Ref<ShortCut> >::Element *E = shortcuts.find(p_name); - if (!E) { - ERR_EXPLAIN("Unknown Shortcut: " + p_name); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(!E, false, "Unknown Shortcut: " + p_name + "."); return E->get()->is_shortcut(p_event); } @@ -1483,10 +1480,8 @@ Ref<ShortCut> ED_GET_SHORTCUT(const String &p_path) { } Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(p_path); - if (!sc.is_valid()) { - ERR_EXPLAIN("Used ED_GET_SHORTCUT with invalid shortcut: " + p_path); - ERR_FAIL_COND_V(!sc.is_valid(), sc); - } + + ERR_FAIL_COND_V_MSG(!sc.is_valid(), sc, "Used ED_GET_SHORTCUT with invalid shortcut: " + p_path + "."); return sc; } |