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

Add builtin icons as a fallback option and as a way to use the editor's icons #100298

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sylbeth
Copy link

@sylbeth sylbeth commented Dec 12, 2024

This check makes it so, in case any custom icon finding or opening were to fail, it fallbacks on a builtin icon in the theme with the same name. This way, we can specify an icon that's already in the engine instead of having to provide it. For example, if you wanted your CustomNode icon to be that of a CharacterBody2D, you could specify it as a path with "CharacterBody2D".

This would palliate the need to automatically find the base class to use as the icon. Not only that, but it also covers more use cases. Let's say you make a node that's akin to a person, but you use Node2D as the base instead. You could specify the icon to be that of CharacterBody2D instead.

This allows users not to have to provide the icon, saving space on the computer and also stopping them from bloating the project folders.

In this implementation though, worst case scenario the GDExtension::get_singleton()->class_get_icon_path(p_class) gets called twice, but this can easily be changed if that's what's wanted here, and I can change it myself.

Original proposal: godotengine/godot-proposals#11336

(and already ran the pre-commit run)

…'s icons

This check makes it so, in case any custom icon finding or opening were to fail, it fallbacks on a builtin icon in the theme with the same name. This way, we can specify an icon that's already in the engine instead of having to provide it. For example, if you wanted your CustomNode icon to be that of a CharacterBody2D, you could specify it as a path with "CharacterBody2D".
Add builtin icons as a fallback option and as a way to use the editor's icons
@sylbeth sylbeth requested a review from RadiantUwU December 12, 2024 18:17
@paddy-exe paddy-exe requested review from a team and removed request for RadiantUwU December 19, 2024 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to use Editor icons from the path to icon in GDExtension
3 participants