summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-05 00:14:05 +0200
committerGitHub <noreply@github.com>2017-09-05 00:14:05 +0200
commit0f63b683365a59eac33cbfff9e04560a10cedc75 (patch)
treeb3a80022ef47662fc7b1e2e2adbea99f575ebae5 /scene
parent77d5013f94839f4e470492cd860e83a0944f4478 (diff)
parent1bafc3c6cf442370a03b2ffa0383b6face6063c0 (diff)
Merge pull request #10822 from hoelzl/toggle-button
Fix inconsistent toggle button behavior
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/base_button.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 8fd19e8655..5713a35b7a 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -87,14 +87,14 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
status.pressed = !status.pressed;
pressed();
- if (get_script_instance()) {
- Variant::CallError ce;
- get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
- }
+
emit_signal("pressed");
_unpress_group();
toggled(status.pressed);
+ if (get_script_instance()) {
+ get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed);
+ }
emit_signal("toggled", status.pressed);
}
@@ -143,10 +143,10 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
emit_signal("pressed");
toggled(status.pressed);
- emit_signal("toggled", status.pressed);
if (get_script_instance()) {
get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed);
}
+ emit_signal("toggled", status.pressed);
}
_unpress_group();