Add "button_selected" signal to ButtonGroup
(cherry picked from commit 870ed6f2fa
)
This commit is contained in:
parent
a8502ae6f6
commit
728ac94313
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user