Bladeren bron

Range: Properly bind value emitted by 'changed' signal

This was fixed in the `master` branch by removing the value in #29831,
but for `3.1` we preserve compatibility, even if redundant with
'value_changed'.

Fixes #35395.
Rémi Verschelde 5 jaren geleden
bovenliggende
commit
227a81c119
2 gewijzigde bestanden met toevoegingen van 3 en 1 verwijderingen
  1. 2 0
      doc/classes/Range.xml
  2. 1 1
      scene/gui/range.cpp

+ 2 - 0
doc/classes/Range.xml

@@ -60,6 +60,8 @@
 	</members>
 	<signals>
 		<signal name="changed">
+			<argument index="0" name="value" type="float">
+			</argument>
 			<description>
 				Emitted when [member min_value], [member max_value], [member page], or [member step] change.
 			</description>

+ 1 - 1
scene/gui/range.cpp

@@ -266,7 +266,7 @@ void Range::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("unshare"), &Range::unshare);
 
 	ADD_SIGNAL(MethodInfo("value_changed", PropertyInfo(Variant::REAL, "value")));
-	ADD_SIGNAL(MethodInfo("changed"));
+	ADD_SIGNAL(MethodInfo("changed", PropertyInfo(Variant::REAL, "value")));
 
 	ADD_PROPERTY(PropertyInfo(Variant::REAL, "min_value"), "set_min", "get_min");
 	ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_value"), "set_max", "get_max");