Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#87 Add warning when loop metadata is missing for AudioStreamWAV #104

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

JuannFerrari
Copy link
Collaborator

@JuannFerrari JuannFerrari commented Nov 9, 2023

This PR is for issue #87

What
This PR adds a warning in the Godot console to help developers notice that the WAV file added does not have the correct metadata to loop

Why
Is not a bug from Popochiu per se, according to godotengine/godot#40359 if the metadata is not present a WAV file won't loop.

@JuannFerrari JuannFerrari requested a review from mapedorr November 9, 2023 02:26
Copy link
Collaborator

@mapedorr mapedorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion to keep messages consistency throught the whole plugin.

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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using this way of displaying the warning so that it is understood as something triggered by the plugin and avoid long code lines:

PopochiuUtils.print_warning(
	"[b]%s[/b]" % resource_name +\
	" does not have the correct metadata to loop, please check" +\
	" AudioStreamWAV documentation"
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's great, I will change it

Copy link
Collaborator

@mapedorr mapedorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mapedorr mapedorr merged commit cfe7a32 into alpha_4 Nov 10, 2023
mapedorr added a commit that referenced this pull request Nov 10, 2023
* Fix "Start with it" for inventory items.

fix: Devs can select items to start with in the Main tab.
fix: Setting an inventory item as active with `add_as_active` makes the
cursor take the appearance of the item.
fea: Added `is_pixel_art_game` property to ProjectSettings.
upd: When selecting Pixel in Game type (setup popup) the default texture
filter is set to TEXTURE_FILTER_NEAREST for props, characters and
inventory items.

* #87 Add warning when loop metadata is missing for AudioStreamWAV (#104)

* Add warning for AudioStreamWAV in audio_cue.gd

* Fix comments on the PR

* NPC's follows the player (#105)

* initial commit to let npc's follow the player

* Fix comments on the PR

* Add `v_frames` property to PopochiuProp.

fea: Add settings option for pixel perfect games.
fea: The cursor sprite doesn't leave the viewport when the mouse pointer
leaves the game window.
fea: When the game is pixel perfect, the cursor moves in whole pixels
(thanks to @Whyshchuck )

* Updated max size for plugin popups

---------

Co-authored-by: Juan Ferrari <[email protected]>
mapedorr added a commit that referenced this pull request Nov 10, 2023
* Fix "Start with it" for inventory items.

fix: Devs can select items to start with in the Main tab.
fix: Setting an inventory item as active with `add_as_active` makes the
cursor take the appearance of the item.
fea: Added `is_pixel_art_game` property to ProjectSettings.
upd: When selecting Pixel in Game type (setup popup) the default texture
filter is set to TEXTURE_FILTER_NEAREST for props, characters and
inventory items.

* #87 Add warning when loop metadata is missing for AudioStreamWAV (#104)

* Add warning for AudioStreamWAV in audio_cue.gd

* Fix comments on the PR

* NPC's follows the player (#105)

* initial commit to let npc's follow the player

* Fix comments on the PR

* Add `v_frames` property to PopochiuProp.

fea: Add settings option for pixel perfect games.
fea: The cursor sprite doesn't leave the viewport when the mouse pointer
leaves the game window.
fea: When the game is pixel perfect, the cursor moves in whole pixels
(thanks to @Whyshchuck )

* Updated max size for plugin popups

---------

Co-authored-by: Juan Ferrari <[email protected]>
@mapedorr mapedorr deleted the add-warning-loop-wav branch November 11, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants