summaryrefslogtreecommitdiff
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2019-08-08 22:11:48 +0200
committerTomasz Chabora <kobewi4e@gmail.com>2019-08-09 13:54:52 +0200
commitaf5e0fff66d55d07a7910bcd7f170da2f952f7cb (patch)
treecdf217de6cd3ce1c038b7d159d06635a641105f2 /scene/gui/control.cpp
parentd2a67c9c1fdee470064f2b3c5750c98f174b5399 (diff)
Remove ERR_EXPLAIN from scene/* code
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 3246b9f3ec..9b9fc863dd 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1995,12 +1995,7 @@ Control *Control::find_next_valid_focus() const {
Node *n = get_node(data.focus_next);
if (n) {
from = Object::cast_to<Control>(n);
-
- if (!from) {
-
- ERR_EXPLAIN("Next focus node is not a control: " + n->get_name());
- ERR_FAIL_V(NULL);
- }
+ ERR_FAIL_COND_V_MSG(!from, NULL, "Next focus node is not a control: " + n->get_name() + ".");
} else {
return NULL;
}
@@ -2090,12 +2085,7 @@ Control *Control::find_prev_valid_focus() const {
Node *n = get_node(data.focus_prev);
if (n) {
from = Object::cast_to<Control>(n);
-
- if (!from) {
-
- ERR_EXPLAIN("Previous focus node is not a control: " + n->get_name());
- ERR_FAIL_V(NULL);
- }
+ ERR_FAIL_COND_V_MSG(!from, NULL, "Previous focus node is not a control: " + n->get_name() + ".");
} else {
return NULL;
}
@@ -2377,12 +2367,7 @@ Control *Control::_get_focus_neighbour(Margin p_margin, int p_count) {
Node *n = get_node(data.focus_neighbour[p_margin]);
if (n) {
c = Object::cast_to<Control>(n);
-
- if (!c) {
-
- ERR_EXPLAIN("Neighbour focus node is not a control: " + n->get_name());
- ERR_FAIL_V(NULL);
- }
+ ERR_FAIL_COND_V_MSG(!c, NULL, "Neighbor focus node is not a control: " + n->get_name() + ".");
} else {
return NULL;
}