From b1e03d536f0f2cceb470b9f768b6841b4ea94251 Mon Sep 17 00:00:00 2001 From: marynate Date: Sun, 13 Jul 2014 08:48:02 +0800 Subject: [PATCH 1/2] Fixed touchscreen was processing input in editor --- scene/2d/screen_button.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 9d0c9f3d1a1..6d843b87cd6 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -92,7 +92,10 @@ void TouchScreenButton::_notification(int p_what) { if (!get_scene()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility==VISIBILITY_TOUCHSCREEN_ONLY) return; update(); - set_process_input(true); + + if (!get_scene()->is_editor_hint()) + set_process_input(true); + if (action.operator String()!="" && InputMap::get_singleton()->has_action(action)) { action_id=InputMap::get_singleton()->get_action_id(action); } else { From 568be61b0985d4abb1b6ca7ffcec7f79447d3514 Mon Sep 17 00:00:00 2001 From: marynate Date: Sun, 13 Jul 2014 10:08:50 +0800 Subject: [PATCH 2/2] Fixed potential crash when touchscreenbutton has no texture assigned --- scene/2d/screen_button.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 6d843b87cd6..848f5afeb94 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -170,7 +170,8 @@ void TouchScreenButton::_input(const InputEvent& p_event) { } } else { - touched=Rect2(Point2(),texture->get_size()).has_point(coord); + if (texture.is_valid()) + touched=Rect2(Point2(),texture->get_size()).has_point(coord); }