From 378b684b28151ad919d84587ad734bb8e8217891 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 4 Aug 2024 17:59:59 +0200 Subject: [PATCH] Hide Initial Clip property if not relevant in AudioStreamInteractive editor If no clips have been created yet, there's no clip to choose from for the Initial Clip property. --- modules/interactive_music/audio_stream_interactive.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/interactive_music/audio_stream_interactive.cpp b/modules/interactive_music/audio_stream_interactive.cpp index 8472c4e352c..0913694caba 100644 --- a/modules/interactive_music/audio_stream_interactive.cpp +++ b/modules/interactive_music/audio_stream_interactive.cpp @@ -431,6 +431,10 @@ void AudioStreamInteractive::_validate_property(PropertyInfo &r_property) const if (prop == "initial_clip") { #ifdef TOOLS_ENABLED + if (get_clip_count() == 0) { + // Hide property since there's no clip to choose from. + r_property.usage = PROPERTY_USAGE_NO_EDITOR; + } r_property.hint_string = _get_streams_hint(); #endif } else if (prop.begins_with("clip_") && prop != "clip_count") {