endlessm / godot-block-coding

Block-based visual programming plugin for Godot
https://godotengine.org/asset-library/asset/3095
MIT License
244 stars 16 forks source link

Always showing a full file_path in the block UI seems messy #165

Open cassidyjames opened 1 month ago

cassidyjames commented 1 month ago

What Happened

I was following along with our own Block Coding pong tutorial on YouTube around 2:54, and noticed that file paths get really unwieldy when shown in blocks. I wonder if we could simplify their presentation a bit here.

For example, maybe we can truncate it to just the filename when normally displayed, and only show the full path as a tooltip/when focusing to edit the path.

How to Reproduce

  1. Drag a "load file" block onto the canvas
  2. ~Drag~/copy+paste the path to an asset, like the one in res://addons/block_code/examples/pong_game/assets/wall_hit.ogg
  3. See how wide the block looks!

screenshot

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

manuq commented 1 month ago

What about not having a load sound block at all? Something like:

Chevifier commented 1 month ago

What about not having a load sound block at all? Something like:

  • The files in the project are traversed
  • Any ogg is a sound block, using as name a convertion from the file path
  • In the current example res://addons/block_code/examples/pong_game/assets/wall_hit.ogg becomes the sound block "Wall Hit".

Thats actually a neat Idea Drag and Drop the ogg file in the window converting it to an audio block. So we can still have the load file block but also have a dedicated audio block that searches for all ogg, mp3 etc files independent of there location in the filesystem granted it may be a slow process for larger projects but it could be cached after the first search.