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

Sound: Allow dragging and dropping the audio file from the Filesystem dock #166

Open
cassidyjames opened this issue Jul 26, 2024 · 5 comments
Labels
💎 Bounty enhancement New feature or request

Comments

@cassidyjames
Copy link
Member

cassidyjames commented Jul 26, 2024

What Happened

I was following along with our own Block Coding pong tutorial on YouTube around 2:54, and tried to replicate apparently hallucinated Will's action of dragging and dropping a file onto the path. It didn't work, so I had to right-click and copy the path.

I feel like drag and drop is going to be extra important to our target demographic here.

How to Reproduce

  1. Add a "Load file" block to the canvas
  2. Try to drag an audio resource to the path

Block Coding Plugin Version

v0.6.1

Godot Engine Version

v4.2.2.stable.flathub [15073afe3]

Operating System

Fedora Silverblue 40

Logs or command-line output

No response

Anything else?

No response

@cassidyjames cassidyjames added the enhancement New feature or request label Jul 26, 2024
@manuq
Copy link
Contributor

manuq commented Jul 29, 2024

@cassidyjames from the video it seems that @wnbaum is also copy/pasting the path, not doing drag and drop.

Besides, I wonder if this should be easier. Eg. all ogg files in the project could be blocks that can be dragged directly from the Picker (the blocks palette).

@cassidyjames
Copy link
Member Author

Ah maybe I misunderstood what was happening in that video, then! But yeah, I guess this issue could be reworded to allow dragging and dropping the audio files, instead. :)

@cassidyjames cassidyjames changed the title Can no longer drag a file to the "load file" sound block Can't drag a file to a sound block Aug 16, 2024
@manuq manuq changed the title Can't drag a file to a sound block Sound: Allow dragging and dropping the audio file from the Filesystem dock Oct 23, 2024
@manuq
Copy link
Contributor

manuq commented Oct 28, 2024

The easiest implementation would be:

  • Allow dragging files from the Filesystem dock to the Block Coding canvas
  • When dropped, a value block is created of type String and value res://..../ (the resource path)
  • Then this block can be attached to the 1st slot of the current "load file () as sound ()".

A much better implementation but also a more complex one:

  • Allow dragging sound files from the Filesystem dock to the Block Coding canvas.
  • When dropped, the sound is preloaded at the top of the generated script using the resource path. An AudioStreamPlayer is instantiated automatically in the _ready() method using that resource. And a value block is created of type String to reference the AudioStreamPlayer instance by name. The name can be the last part of the path using String.get_file().
  • The "play the sound (name)" and "stop the sound (name)" blocks would accept that block, but now the "load file () as sound (name)" block is not needed anymore.

@dsd
Copy link
Member

dsd commented Oct 28, 2024

Our partner org Endless Studios is offering a modest bounty for completion of this task
(mostly thinking of the easy implementation mentioned above - that could be a good starting point even if we later do the more complex one)
/bounty $40

Copy link

algora-pbc bot commented Oct 28, 2024

💎 $40 bounty • Endless OS Foundation

Steps to solve:

  1. Start working: Comment /attempt #166 with your implementation plan
  2. Submit work: Create a pull request including /claim #166 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to endlessm/godot-block-coding!

Add a bountyShare on socials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants