You would need to specify the “group” of the menu that exists in gui.xml as the “group” argument to newCommand.
Then your menu will be added underneath the menu you specified.
My code is below.
------------------------------------------------------------------------------
-- Top Menu
------------------------------------------------------------------------------
plugin:newCommand{
id="toLoopExtending",
title="Loop Extending",
group="sprite_crop",
onclick=LoopExtending
}
------------------------------------------------------------------------------
-- Dialogs
------------------------------------------------------------------------------
plugin:newCommand{
id="toEditLayerMetaDataDialogShow",
title="Mask Options",
group="layer_popup_new",
onclick=EditLayerMetaDataDialogShow
}
plugin:newCommand{
id="toEditCelMetaDataDialogShow",
title="Mask Options (Cel)",
group="cel_popup_new",
onclick=EditCelMetaDataDialogShow
}
------------------------------------------------------------------------------
-- Frame Menu
------------------------------------------------------------------------------
plugin:newCommand{
id="toFrameCopyout",
title="new Sprite From frames",
group="frame_popup_reverse",
onclick=FrameCopyout
}
------------------------------------------------------------------------------
-- Layer Menu
------------------------------------------------------------------------------
-- Mask and Link(Src/Dst) Cel Menu
plugin:newCommand{
id="toUpdateAll",
title="Update (Copy & Paste)",
group="layer_popup_new",
onclick=UpdateAll
}
plugin:newCommand{
id="toStoreAll",
title="Store Offset",
group="layer_popup_new",
onclick=StoreAll
}
And one thing that struck me is the way you specified the “onclick” argument.
It looks like the result of the DoTheThing run is specified as “onclick”.
I think the correct way is as follows
function DoTheThing()
print("Doing a thing!")
end
function init(plugin)
print("foo init")
plugin:newCommand{
id="dothething",
text="Do A Thing",
group="help",
onclick=DoTheThing
}
end