Using a custom button state from a theme

You can add extra properties to the theme but that does not mean that the node will magically know how to use them. You’ll need to code your own button from scratch if you want to go that route. Here’s the Button draw code godot/scene/gui/button.cpp at 9c7e4031c03edb1f40c9a2876f6876fb2d404141 · godotengine/godot · GitHub

It’s better if you use a theme type variation and set it when button.locked is true and remove it when is false.