From 317c496f5c1aa25af4144ea04cef4ba6fe420830 Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Tue, 20 Jan 2015 20:01:02 +0800 Subject: Add InputEvent::ACTION get/set support for variant Add action_press/action_release method bind --- core/variant_op.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'core/variant_op.cpp') diff --git a/core/variant_op.cpp b/core/variant_op.cpp index ec43b1275c..fbb5e2631d 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -1687,6 +1687,19 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) return; } } + if (ie.type == InputEvent::ACTION) { + + if (str =="action") { + valid=true; + ie.action.action=p_value; + return; + } + else if (str == "pressed") { + valid=true; + ie.action.pressed=p_value; + return; + } + } } break; case DICTIONARY: { @@ -2365,6 +2378,17 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { return Vector2(ie.screen_drag.speed_x,ie.screen_drag.speed_y); } } + if (ie.type == InputEvent::ACTION) { + + if (str =="action") { + valid=true; + return ie.action.action; + } + else if (str == "pressed") { + valid=true; + ie.action.pressed; + } + } } break; case DICTIONARY: { -- cgit v1.2.3