You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Merge pull request #94582 from citizenll/feat_context_menu_plugin4.x
Add support for custom items to editor right-click context menus
This commit is contained in:
@@ -53,6 +53,7 @@ class EditorToolAddons;
|
||||
class EditorTranslationParserPlugin;
|
||||
class EditorUndoRedoManager;
|
||||
class ScriptCreateDialog;
|
||||
class EditorContextMenuPlugin;
|
||||
|
||||
class EditorPlugin : public Node {
|
||||
GDCLASS(EditorPlugin, Node);
|
||||
@@ -102,6 +103,13 @@ public:
|
||||
AFTER_GUI_INPUT_CUSTOM,
|
||||
};
|
||||
|
||||
enum ContextMenuSlot {
|
||||
CONTEXT_SLOT_SCENE_TREE,
|
||||
CONTEXT_SLOT_FILESYSTEM,
|
||||
CONTEXT_SLOT_SCRIPT_EDITOR,
|
||||
CONTEXT_SUBMENU_SLOT_FILESYSTEM_CREATE,
|
||||
};
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
||||
@@ -249,6 +257,9 @@ public:
|
||||
void add_resource_conversion_plugin(const Ref<EditorResourceConversionPlugin> &p_plugin);
|
||||
void remove_resource_conversion_plugin(const Ref<EditorResourceConversionPlugin> &p_plugin);
|
||||
|
||||
void add_context_menu_plugin(ContextMenuSlot p_slot, const Ref<EditorContextMenuPlugin> &p_plugin);
|
||||
void remove_context_menu_plugin(ContextMenuSlot p_slot, const Ref<EditorContextMenuPlugin> &p_plugin);
|
||||
|
||||
void enable_plugin();
|
||||
void disable_plugin();
|
||||
|
||||
@@ -259,6 +270,7 @@ public:
|
||||
VARIANT_ENUM_CAST(EditorPlugin::CustomControlContainer);
|
||||
VARIANT_ENUM_CAST(EditorPlugin::DockSlot);
|
||||
VARIANT_ENUM_CAST(EditorPlugin::AfterGUIInput);
|
||||
VARIANT_ENUM_CAST(EditorPlugin::ContextMenuSlot);
|
||||
|
||||
typedef EditorPlugin *(*EditorPluginCreateFunc)();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user