From d10265e54810f87fe1b28dd0f016e8ee8fa8177c Mon Sep 17 00:00:00 2001 From: Juan Ferrari Date: Wed, 8 Nov 2023 23:22:37 -0300 Subject: [PATCH 1/2] Add warning for AudioStreamWAV in audio_cue.gd --- addons/popochiu/engine/audio_manager/audio_cue.gd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/popochiu/engine/audio_manager/audio_cue.gd b/addons/popochiu/engine/audio_manager/audio_cue.gd index 3c9e78b17..b57432282 100644 --- a/addons/popochiu/engine/audio_manager/audio_cue.gd +++ b/addons/popochiu/engine/audio_manager/audio_cue.gd @@ -93,9 +93,12 @@ func set_loop(value: bool) -> void: 'AudioStreamOggVorbis', 'AudioStreamMP3': audio.loop = value 'AudioStreamWAV': - (audio as AudioStreamWAV).loop_mode =\ - AudioStreamWAV.LOOP_FORWARD if value\ - else AudioStreamWAV.LOOP_DISABLED + if (audio as AudioStreamWAV).get_loop_end() == 0 && value: + push_warning("res://addons/popochiu/engine/audio_manager/audio_cue.gd:97 " + resource_name + " does not have the correct metadata for loop, please check AudioStreamWAV documentation") + else: + (audio as AudioStreamWAV).loop_mode =\ + AudioStreamWAV.LOOP_FORWARD if value\ + else AudioStreamWAV.LOOP_DISABLED notify_property_list_changed() From 87cdbd04597384e94d4bc312a61f8394e378e7a2 Mon Sep 17 00:00:00 2001 From: Juan Ferrari Date: Fri, 10 Nov 2023 00:45:00 -0300 Subject: [PATCH 2/2] Fix comments on the PR --- addons/popochiu/engine/audio_manager/audio_cue.gd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/popochiu/engine/audio_manager/audio_cue.gd b/addons/popochiu/engine/audio_manager/audio_cue.gd index b57432282..a6620b0e3 100644 --- a/addons/popochiu/engine/audio_manager/audio_cue.gd +++ b/addons/popochiu/engine/audio_manager/audio_cue.gd @@ -94,7 +94,11 @@ func set_loop(value: bool) -> void: audio.loop = value 'AudioStreamWAV': if (audio as AudioStreamWAV).get_loop_end() == 0 && value: - push_warning("res://addons/popochiu/engine/audio_manager/audio_cue.gd:97 " + resource_name + " does not have the correct metadata for loop, please check AudioStreamWAV documentation") + PopochiuUtils.print_warning( + "[b]%s[/b]" % resource_name +\ + " does not have the correct metadata to loop, please check" +\ + " AudioStreamWAV documentation" + ) else: (audio as AudioStreamWAV).loop_mode =\ AudioStreamWAV.LOOP_FORWARD if value\