Add EditorContextMenuPluginManager and refactor menu plugins

This commit is contained in:
kobewi
2024-09-03 23:07:19 +02:00
parent e2dd56bea7
commit ecc0ab8061
13 changed files with 288 additions and 252 deletions

View File

@@ -403,11 +403,11 @@
</method>
<method name="add_context_menu_plugin">
<return type="void" />
<param index="0" name="slot" type="int" enum="EditorPlugin.ContextMenuSlot" />
<param index="0" name="slot" type="int" enum="EditorContextMenuPlugin.ContextMenuSlot" />
<param index="1" name="plugin" type="EditorContextMenuPlugin" />
<description>
Adds a plugin to the context menu. [param slot] is the position in the context menu where the plugin will be added.
Context menus are supported for three commonly used areas: the file system, scene tree, and editor script list panel.
Adds a plugin to the context menu. [param slot] is the context menu where the plugin will be added.
See [enum EditorContextMenuPlugin.ContextMenuSlot] for available context menus. A plugin instance can belong only to a single context menu slot.
</description>
</method>
<method name="add_control_to_bottom_panel">
@@ -635,10 +635,9 @@
</method>
<method name="remove_context_menu_plugin">
<return type="void" />
<param index="0" name="slot" type="int" enum="EditorPlugin.ContextMenuSlot" />
<param index="1" name="plugin" type="EditorContextMenuPlugin" />
<param index="0" name="plugin" type="EditorContextMenuPlugin" />
<description>
Removes a context menu plugin from the specified slot.
Removes the specified context menu plugin.
</description>
</method>
<method name="remove_control_from_bottom_panel">
@@ -891,17 +890,5 @@
<constant name="AFTER_GUI_INPUT_CUSTOM" value="2" enum="AfterGUIInput">
Pass the [InputEvent] to other editor plugins except the main [Node3D] one. This can be used to prevent node selection changes and work with sub-gizmos instead.
</constant>
<constant name="CONTEXT_SLOT_SCENE_TREE" value="0" enum="ContextMenuSlot">
Context menu slot for the SceneTree.
</constant>
<constant name="CONTEXT_SLOT_FILESYSTEM" value="1" enum="ContextMenuSlot">
Context menu slot for the FileSystem.
</constant>
<constant name="CONTEXT_SLOT_SCRIPT_EDITOR" value="2" enum="ContextMenuSlot">
Context menu slot for the ScriptEditor file list.
</constant>
<constant name="CONTEXT_SUBMENU_SLOT_FILESYSTEM_CREATE" value="3" enum="ContextMenuSlot">
Context menu slot for the FileSystem create submenu.
</constant>
</constants>
</class>