-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 a "Plugins" or "Tools" menu option #1429
Comments
I think EditorPlugin has a function to add menus to different parts of the On Tue, Feb 24, 2015 at 2:00 AM, Vinodkumar KN notifications@github.com
|
Editor Plugin has some predefined positions. But after adding so many plugins, godot will run out of space of Plugin buttons. |
There is now a "Tools" global menu I think, so it could probably be used to put plugins in it. Someone would have to check if that can be done easily already, or if some changes are needed to make plugins appear in this menu. |
AFAICT, to add a custom control in the editor, one have to rely on |
So I guess this issue should be about adding more possibilities to the places available for |
It should be easy to do. I propose |
I think it could be added directly in the |
Can we categorize it with a sub menu as the plugin developer's needs. Etc |
Anyone up to implementing this? @MarianoGnu, @neikeq, @TheHX? :) |
I'm up for implementing this, i was thinking on creating a class for this, so it can be more flexible. I created a simple header to demonstrate the API for the class: tool_menu.h. |
I don't belive a class is worth, this should be handled the same way other containers do, adding functions to EditorNode and exposing them to EditorPlugin class. The functions to expose: name can be like "tileset plugin/create” |
@MarianoGnu maybe |
I don't like the idea of adding the custom buttons into the "Plugins" menu, i prefer to add they to the "Tools" menu, so developers can add more options to the menu. |
I know EditorNode is a little bloated, but a preffer to keep consistense on the way things are done, otherwise you should move all other container to specific classes, and they are not exposed to GdScript anyway |
I like that |
I want to create the new class based on #5691. But is ok to me add the code into the |
Here's my proposal for the API, based on @MarianoGnu initial proposal. # I think it's better to add a optional ID parameter to the button
# If the ID is the default value, the ID of the item is the index of the items in the category
# Ex:
# "my_plugin/item1"; ID = 0
# "another_plugin/item1"; ID = 0 # But probably the plugin buttons won't be mixed, this is just a example.
# "my_plugin/item2"; ID = 1
# "my_plugin/item3"; ID = 2
# "another_plugin/item2"; ID = 1
# The name parameter is in format "my_plugin_name/my_button_item" or "MyPluginName/MyButtonItem" and in menu it'll display "My Button Name"
# In this case the callback function is in format void callback(String name, int ID)
void add_plugin_menu_item(String name, Object handler, String callback, int ID = -1);
# The name parameter is in format is "my_plugin_name/submenu_name" (submenu_name == submenu.get_name())
void add_plugin_submenu_item(String name, PopupMenu submenu);
void remove_plugin_menu_item(String name);
bool has_plugin_menu_item(String name); IMO it's better change the functions names from |
About id, just add an Array args and default it to [], then you can use the same function for everithing :) |
Fixed by b24b52d. |
Since godot features can be extended by plugins, later the editor will have no space for plugin buttons. So please add a Tools menu option in the editor itself. So that all plugin developers can add their menu items(may be categorized) into it.
The text was updated successfully, but these errors were encountered: