+4 votes

I'm building a plugin and I want one of my custom nodes to show the warning sign when some of the properties are not set properly.

Is there any way to do that?

in Engine by (24 points)

2 Answers

+2 votes
Best answer

There is a virtual method Node::get_configuration_warning in cpp.
but it's not exposed to gdscript.

I'm not sure if there is any workaround for it.
you can open issue and discuss about this on github.


by (9,776 points)
selected by

I opened the issue!

+8 votes

As of 3.1 you can do this by adding _get_configuration_warning to your GDScript:

tool # must be a tool script to work
extends Node

export(String) var name:String

func _get_configuration_warning():
    if not name:
        return 'Name not set'
    return ''
by (4,209 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.