[Editor] Fix inspector keying signals argument count.

The second parameter of the signals `EditorInspector.property_keyed` and
`EditorProperty.property_keyed_with_value` can be NIL, causing the event
to fire with less arguments when using `emit_signal` that accepts
Variant arguments, so we use the pointer version instead.
This commit is contained in:
Fabio Alessandrelli 2021-12-03 16:23:32 +01:00
parent fcc2648e18
commit 98b147b319
4 changed files with 18 additions and 7 deletions

View file

@ -2909,8 +2909,11 @@ void EditorPropertyResource::_resource_changed(const RES &p_resource) {
}
}
void EditorPropertyResource::_sub_inspector_property_keyed(const String &p_property, const Variant &p_value, bool) {
emit_signal(SNAME("property_keyed_with_value"), String(get_edited_property()) + ":" + p_property, p_value, false);
void EditorPropertyResource::_sub_inspector_property_keyed(const String &p_property, const Variant &p_value, bool p_advance) {
// The second parameter could be null, causing the event to fire with less arguments, so use the pointer call which preserves it.
const Variant args[3] = { String(get_edited_property()) + ":" + p_property, p_value, p_advance };
const Variant *argp[3] = { &args[0], &args[1], &args[2] };
emit_signal(SNAME("property_keyed_with_value"), argp, 3);
}
void EditorPropertyResource::_sub_inspector_resource_selected(const RES &p_resource, const String &p_property) {