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 #1

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

sylbeth
Copy link
Owner

@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

…'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".
@sylbeth sylbeth merged commit 41c5bc5 into master Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant