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 a configuration warning system for Resources #9098

Open
derkork opened this issue Feb 15, 2024 · 4 comments · May be fixed by godotengine/godot#90049
Open

Add a configuration warning system for Resources #9098

derkork opened this issue Feb 15, 2024 · 4 comments · May be fixed by godotengine/godot#90049

Comments

@derkork
Copy link

derkork commented Feb 15, 2024

Describe the project you are working on

This is not game specific, it would be universally useful across projects.

Describe the problem or limitation you are having in your project

When you are working with resources, there are possibilities to misconfigure these resources, similar to how one can misconfigure a node. To solve this problem, nodes have the _get_configuration_warnings function which you can implement yourself to notify the user about misconfiguration. Resources have no such facility and as such, misconfigurations of resources will go unnoticed until the game is run.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would be helpful if resources also got a _get_configuration_warnings function similar to how nodes do. Like with nodes these would require the scrip to be @tool and there is also an update_configuration_warning function to trigger an update.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

The system would work pretty much identical to how nodes are used. However since resources can be used in various places, the warnings would need to be displayed in the inspector, for example somewhere on top of the properties like this:
2024-02-15_17-59-26

This way the warnings could also be shown when a resource is embedded inside of node property or another resource.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It would be used quite often, I think and right now one would need some custom inspector plugin for every resource that should participate in this system.

Is there a reason why this should be core and not an add-on in the asset library?

If checking of configuration errors in nodes is core, I think checking for them in resources should also be core.

@Calinou
Copy link
Member

Calinou commented Feb 15, 2024

Individual properties can have configuration warnings since 4.3, but they're still limited to nodes currently: godotengine/godot#68420

@Calinou Calinou changed the title Have a configuration warning facility for resources Add a configuration warning system for Resources Feb 15, 2024
@nlupugla
Copy link

This seems like a really nice idea, especially when multiple properties depend on each other. For example, you could warn if dead == true and hp > 0.

@smedelyan
Copy link

Hey, any news on this yet?

@Calinou
Copy link
Member

Calinou commented Jun 12, 2024

Hey, any news on this yet?

godotengine/godot#90049 implements this feature but is currently on hold. 4.3 is in feature freeze, so any new features can only make it in for 4.4 at the earliest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants