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

Add optional arguments to AudioStreamRandomizer

Adds stream and weight parameters to add_stream. By default, weight is
1.0f.
This commit is contained in:
MrBlockers
2022-10-26 17:54:31 -04:00
parent 2a04b18d37
commit 569ead5762
4 changed files with 9 additions and 7 deletions

View File

@@ -81,7 +81,7 @@ void AudioStreamRandomizerEditorPlugin::_move_stream_array_element(Object *p_und
if (p_from_index < 0) {
undo_redo_man->add_undo_method(randomizer, "remove_stream", p_to_pos < 0 ? randomizer->get_streams_count() : p_to_pos);
} else if (p_to_pos < 0) {
undo_redo_man->add_undo_method(randomizer, "add_stream", p_from_index);
undo_redo_man->add_undo_method(randomizer, "add_stream", p_from_index, Ref<AudioStream>());
}
List<PropertyInfo> properties;
@@ -107,7 +107,7 @@ void AudioStreamRandomizerEditorPlugin::_move_stream_array_element(Object *p_und
#undef ADD_UNDO
if (p_from_index < 0) {
undo_redo_man->add_do_method(randomizer, "add_stream", p_to_pos);
undo_redo_man->add_do_method(randomizer, "add_stream", p_to_pos, Ref<AudioStream>());
} else if (p_to_pos < 0) {
undo_redo_man->add_do_method(randomizer, "remove_stream", p_from_index);
} else {