godot-nim / gdext-nim

Nim for Godot GDExtension. A pure library and a CLI tool.
MIT License
47 stars 5 forks source link

Define custom class icons in bootstrap.nim, for gdextension generation #35

Open insomniacUNDERSCORElemon opened 3 months ago

insomniacUNDERSCORElemon commented 3 months ago

Allow a general absolute path (such as "res://core/icons/") as well as defining specific classes via relative paths ("control/label.png").

This will make editing many icons easier. Or workspace name changes (like using "res://addons/mycooladdon/icons/")

Defining class icons in a distributed fashion could be a possibility as well, though as files need to be imported anyways* I am not sure if distributed is the best idea especially if a dev decides to rework their icon subfolder name(s). Maybe fixed by only defining the icon file itself in the class.nim file and absolute folders for class groupings in bootstrap.nim, though this may not be worth it now.

*\= class names being tied to file names means you are unlikely to change just one, so there is more use in that only if multiple classes are defined in one file


Alternatively, the simple way would just be to define only icons folder path an simply try to load files in that folder that match the class names. Though an option for case style (so camelCase classes can have snake_case files) would be nice here.

This would mean less configuration, however it also makes less sense for generalized (reusable) icon designs.

**= such as nodes/ or type/


Relates to https://github.com/godot-nim/gdextshell/issues/8