Plugin that works fine by itself does nothing in a dock

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By leod
:warning: Old Version Published before Godot 3 was released.

I have a relatively small, simple dock plugin that works exactly as it should when ran in the editor or by itself, but as soon as I add it as a dock, not much in terms of signals seems to function.
I can hit buttons and press enter as much as I want, nothing appears and I can’t tell why because I’ve seen other dock plugins use signals just fine.

Can someone take a look at the Godot project files here and give me a pointer to what I’m doing wrong?
https://dl.dropboxusercontent.com/u/9054912/Misc/Godot%20Todo.zip

For reference, it’s supposed to let you add task groups by typing a title into the lineedit at the top and then hitting enter/pressing the +.
Then each group can add and delete tasks, minimize or be deleted and the whole thing saves its state on disc in user://dev_todo_deck/todo_dock_state.save and reload it when the project is opened again, which works perfectly fine outside of the dock.

What happens for me is that I can write a title into the LineEdit, but neither enter nor hitting the + add a group. If I manually add a default group through the editor, it shows up fine but none of the buttons on that will work then, it seems like either the scripts or the signals just don’t run/register or something.

:bust_in_silhouette: Reply From: volzhs

You need to add tool keyword at first line in each .gd

Thanks, thankfully that was easier of a fix than I thought!
I feel like the Godot docs don’t make it clear enough that every single script in the plugin has to be a tool, I kind of just expected the editor to know that “oh yes, this is a plugin, I’ll display it” instead.

But doesn’t matter, works as advertised now, thanks again!

leod | 2016-10-23 13:51