-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Ability for plugins to add entry under right mouse click context menu #6128
Comments
I was thinking on something like this(I proposed it on #4276, for menu buttons) which is like i implemented on #6065, but with a new class. enum ContextMenu {
CONTEXT_MENU_SCENE_DOCK,
CONTEXT_MENU_FILESYSTEM_DOCK
// And possibly others
};
void add_item_to_context_menu(ContextMenu menu, String name, Object *handler, String callback, Variant ud);
// And possibly other functions to add a item with a icon or shortcut.
void add_submenu_to_context_menu(ContextMenu menu, String name, PopupMenu submenu);
void remove_item_from_context_menu(ContextMenu menu, String name); The way of where the menu will display the plugin item can be:
|
I suggest to also add an optional callback that allows for overriding whether or not the item should be instanced when recreating the context menu. void add_item_to_context_menu(ContextMenu menu, String name, Object *handler, String callback, Variant ud, String can_instance_callback=""); This is useful for context-sensitive context menus (wow, what a sentence :p). |
kicking to 3.1 |
I could use this for #15928 - A way to add a custom tools to scene_tree_dock context menu. As is, the proposal seems to miss the ability to assign shortcuts. Any thoughts on this? |
Moving to the next milestone as 3.1 is now feature frozen. |
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! |
Operating system or device - Godot version:
Issue description (what happened, and what was expected):
Yesterday I wrote a plugin which potentially solves #4584 #4584 (it allows you to extend scenes easily).
The problem is there is no way to add an entry to right click mouse button context menu, so I needed to put new button near the editor 'settings' button, which is not elegant and take space all the time. Besides I can imagine there will be more plugins which allows to perform operations on nodes selected in scene tree tab...
In context menu I think there should be subcategory for each plugin which would automatically unfold when mouse cursor is near:
![subcategory](https://cloud.githubusercontent.com/assets/6129594/17616491/5950fb60-6075-11e6-8b68-e5c049d9a1cf.gif)
Steps to reproduce:
Link to minimal example project (optional but very welcome):
The text was updated successfully, but these errors were encountered: