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 an inspection/auto-fix interface for node configuration warnings #2519

Open
GuyUnger opened this issue Mar 28, 2021 · 5 comments
Open

Add an inspection/auto-fix interface for node configuration warnings #2519

GuyUnger opened this issue Mar 28, 2021 · 5 comments

Comments

@GuyUnger
Copy link

Describe the project you are working on

This change will help all my projects

Describe the problem or limitation you are having in your project

Physics nodes need a collision shape or collision polygon. The editor shows a warning symbol if it doesn't have one yet. Clicking on the this symbol explains the issue but might as well give options to solve them.

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

Instead of an "ok" button I propose to add buttons to add one of the necessary nodes in a menu below the warning where it won't take over the whole screen.

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

Godot_cPsfQYpiGJ

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

Can be worked around by adding the nodes as normal

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

Because it's a minor quality of life improvement

@Calinou
Copy link
Member

Calinou commented Mar 28, 2021

Implementing a generic API to automatically fix issues (and therefore run arbitrary code) sounds very difficult. Keep in mind that this functionality needs to be exposed to tool scripts as well, since tool scripts can already return node configuration warnings by overriding the _get_configuration_warning() -> String method.

Also, consider that a single node may return multiple node configuration warnings at the same time. However, these aren't properly exposed as multiple warnings yet – this will require godotengine/godot#43180 to be merged first.

@YuriSizov
Copy link
Contributor

Implementing a generic API to automatically fix issues (and therefore run arbitrary code) sounds very difficult.

I can imagine something like UndoRedo's approach with defining and then committing an action, where a validation error comes with a pre-defined action that the user can commit via a confirmation popup.

@Xrayez
Copy link
Contributor

Xrayez commented Mar 28, 2021

Using a warning to fix an issue should be the last resort on UX level. There should be main tools to help this regardless of the warning system.

The "Add Node" create dialog should also suggest corresponding nodes to be instantiated as children beforehand (not necessarily in intrusive way like confirmation popups, but more like a drop-down menu of complementary nodes).

@shak2
Copy link

shak2 commented Jun 6, 2024

You could reverse the situation. Have the full node set created at creation when using the add child UI and then the user has to actively delete the collision node if they want that, which leads to the warning triangle.

That way the default creation state is without the warning.

@AThousandShips
Copy link
Member

That would require dedicated behaviour when being created in the inspector, otherwise it'd break things when adding the collision shape it already has when being created, or when created via scripting, it'd be fragile and difficult to maintain and use

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

No branches or pull requests

6 participants