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.
This commit is contained in:
Hugo Locurcio 2024-08-04 17:59:59 +02:00
parent 3978628c6c
commit 378b684b28
1 changed files with 4 additions and 0 deletions

View File

@ -431,6 +431,10 @@ void AudioStreamInteractive::_validate_property(PropertyInfo &r_property) const
if (prop == "initial_clip") { if (prop == "initial_clip") {
#ifdef TOOLS_ENABLED #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(); r_property.hint_string = _get_streams_hint();
#endif #endif
} else if (prop.begins_with("clip_") && prop != "clip_count") { } else if (prop.begins_with("clip_") && prop != "clip_count") {