diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/button_group.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index 04ba5fc06d..5d9f290f78 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -60,6 +60,9 @@ void ButtonGroup::_pressed(Object *p_button) { BaseButton *bb=E->get(); bb->set_pressed( b==bb ); + if (b==bb){ + emit_signal("button_selected", b); + } } } @@ -153,6 +156,7 @@ void ButtonGroup::_bind_methods() { ObjectTypeDB::bind_method(_MD("_pressed"),&ButtonGroup::_pressed); ObjectTypeDB::bind_method(_MD("set_pressed_button","button:BaseButton"),&ButtonGroup::_pressed); + ADD_SIGNAL( MethodInfo("button_selected",PropertyInfo(Variant::OBJECT,"button",PROPERTY_HINT_RESOURCE_TYPE,"BaseButton"))); } ButtonGroup::ButtonGroup() : BoxContainer(true) |