diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-10-04 22:43:38 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-10-04 22:43:38 +0200 |
commit | e5688f51cb08076fef8c5720d8fe7177841d34e7 (patch) | |
tree | c06c162528b9085288abc265797960c4bd1c9386 /doc | |
parent | 9108c6261b9d88b7bcd642db5760f431d1b42d37 (diff) | |
parent | 866c50a9260be4f92f6131384c9cfccabb8df7a7 (diff) | |
download | redot-engine-e5688f51cb08076fef8c5720d8fe7177841d34e7.tar.gz |
Merge pull request #97292 from KoBeWi/infinite_submenus_in_your_editor
Add submenu support to EditorContextMenuPlugin
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/EditorContextMenuPlugin.xml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/classes/EditorContextMenuPlugin.xml b/doc/classes/EditorContextMenuPlugin.xml index 71c4ca0f9b..fb90a2a5cd 100644 --- a/doc/classes/EditorContextMenuPlugin.xml +++ b/doc/classes/EditorContextMenuPlugin.xml @@ -47,6 +47,24 @@ [/codeblock] </description> </method> + <method name="add_context_submenu_item"> + <return type="void" /> + <param index="0" name="name" type="String" /> + <param index="1" name="menu" type="PopupMenu" /> + <param index="2" name="icon" type="Texture2D" default="null" /> + <description> + Add a submenu to the context menu of the plugin's specified slot. The submenu is not automatically handled, you need to connect to its signals yourself. Also the submenu is freed on every popup, so provide a new [PopupMenu] every time. + [codeblock] + func _popup_menu(paths): + var popup_menu = PopupMenu.new() + popup_menu.add_item("Blue") + popup_menu.add_item("White") + popup_menu.id_pressed.connect(_on_color_submenu_option) + + add_context_menu_item("Set Node Color", popup_menu) + [/codeblock] + </description> + </method> <method name="add_menu_shortcut"> <return type="void" /> <param index="0" name="shortcut" type="Shortcut" /> |