Signals: Manually port most of remaining connect_compat uses

It's tedious work...

Some can't be ported as they depend on private or protected methods
of different classes, which is not supported by callable_mp (even if
it's a class inherited by the current one).
This commit is contained in:
Rémi Verschelde
2020-02-21 23:26:13 +01:00
parent 01afc442c7
commit f742dabafe
50 changed files with 187 additions and 244 deletions

View File

@@ -29,6 +29,7 @@
/*************************************************************************/
#include "menu_button.h"
#include "core/os/keyboard.h"
#include "scene/main/viewport.h"
@@ -137,8 +138,8 @@ MenuButton::MenuButton() {
popup->hide();
add_child(popup);
popup->set_pass_on_modal_close_click(false);
popup->connect_compat("about_to_show", this, "set_pressed", varray(true)); // For when switching from another MenuButton.
popup->connect_compat("popup_hide", this, "set_pressed", varray(false));
popup->connect("about_to_show", callable_mp((BaseButton *)this, &BaseButton::set_pressed), varray(true)); // For when switching from another MenuButton.
popup->connect("popup_hide", callable_mp((BaseButton *)this, &BaseButton::set_pressed), varray(false));
}
MenuButton::~MenuButton() {