1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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

@@ -70,15 +70,15 @@ void CurveEditor::set_curve(Ref<Curve> curve) {
return;
if (_curve_ref.is_valid()) {
_curve_ref->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed");
_curve_ref->disconnect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed");
_curve_ref->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveEditor::_curve_changed));
_curve_ref->disconnect(Curve::SIGNAL_RANGE_CHANGED, callable_mp(this, &CurveEditor::_curve_changed));
}
_curve_ref = curve;
if (_curve_ref.is_valid()) {
_curve_ref->connect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed");
_curve_ref->connect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed");
_curve_ref->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveEditor::_curve_changed));
_curve_ref->connect(Curve::SIGNAL_RANGE_CHANGED, callable_mp(this, &CurveEditor::_curve_changed));
}
_selected_point = -1;
@@ -749,7 +749,6 @@ void CurveEditor::_draw() {
void CurveEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_gui_input"), &CurveEditor::on_gui_input);
ClassDB::bind_method(D_METHOD("_curve_changed"), &CurveEditor::_curve_changed);
}
//---------------