mirror of
https://github.com/godotengine/godot.git
synced 2025-01-24 11:32:51 -05:00
Add "button_selected" signal to ButtonGroup
This commit is contained in:
parent
12843167ca
commit
870ed6f2fa
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue