mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 20:23:53 +00:00
ButtonGroup.get_pressed_button bugfix, fixes issue #25057
This commit is contained in:
parent
50c8019dcd
commit
ea211af412
@ -82,16 +82,16 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
|
||||
get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
|
||||
}
|
||||
|
||||
emit_signal("pressed");
|
||||
_unpress_group();
|
||||
emit_signal("pressed");
|
||||
|
||||
} else {
|
||||
|
||||
status.pressed = !status.pressed;
|
||||
pressed();
|
||||
|
||||
emit_signal("pressed");
|
||||
_unpress_group();
|
||||
emit_signal("pressed");
|
||||
|
||||
toggled(status.pressed);
|
||||
if (get_script_instance()) {
|
||||
@ -135,6 +135,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
|
||||
get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
|
||||
}
|
||||
|
||||
_unpress_group();
|
||||
emit_signal("pressed");
|
||||
|
||||
} else {
|
||||
@ -142,6 +143,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
|
||||
status.pressed = !status.pressed;
|
||||
|
||||
pressed();
|
||||
_unpress_group();
|
||||
emit_signal("pressed");
|
||||
|
||||
toggled(status.pressed);
|
||||
@ -150,8 +152,6 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
|
||||
}
|
||||
emit_signal("toggled", status.pressed);
|
||||
}
|
||||
|
||||
_unpress_group();
|
||||
}
|
||||
|
||||
status.press_attempt = false;
|
||||
@ -215,12 +215,14 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
|
||||
get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
|
||||
}
|
||||
|
||||
_unpress_group();
|
||||
emit_signal("pressed");
|
||||
} else {
|
||||
|
||||
status.pressed = !status.pressed;
|
||||
|
||||
pressed();
|
||||
_unpress_group();
|
||||
emit_signal("pressed");
|
||||
|
||||
toggled(status.pressed);
|
||||
@ -229,8 +231,6 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
|
||||
}
|
||||
emit_signal("toggled", status.pressed);
|
||||
}
|
||||
|
||||
_unpress_group();
|
||||
}
|
||||
|
||||
accept_event();
|
||||
|
Loading…
Reference in New Issue
Block a user