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.
you could still allow (but not require) explicitly defined filenames just for this, so Myclass.icon = "label.png" could still be a thing
you could also add in searching for a node type icon (at least the closest match, control node or node2D is better than just node) if there isn't a class-specific icon so a line like the above isn't needed.
Though this would be better to use a subfolder** here as there are a lot of nodes and even supporting a fraction of them would ruin organization when mixed in with specific-use icons.
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.
Myclass.icon = "label.png"
could still be a thing**= such as
nodes/
ortype/
Relates to https://github.com/godot-nim/gdextshell/issues/8