1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Add more menus support to EditorContextMenuPlugin

This commit is contained in:
kobewi
2024-12-18 14:42:10 +01:00
parent fafc07335b
commit ba54a2805a
7 changed files with 93 additions and 3 deletions

View File

@@ -52,6 +52,9 @@ public:
CONTEXT_SLOT_FILESYSTEM,
CONTEXT_SLOT_SCRIPT_EDITOR,
CONTEXT_SLOT_FILESYSTEM_CREATE,
CONTEXT_SLOT_SCRIPT_EDITOR_CODE,
CONTEXT_SLOT_SCENE_TABS,
CONTEXT_SLOT_2D_EDITOR,
};
inline static constexpr int BASE_ID = 2000;
@@ -100,6 +103,7 @@ public:
void add_plugin(ContextMenuSlot p_slot, const Ref<EditorContextMenuPlugin> &p_plugin);
void remove_plugin(const Ref<EditorContextMenuPlugin> &p_plugin);
bool has_plugins_for_slot(ContextMenuSlot p_slot);
void add_options_from_plugins(PopupMenu *p_popup, ContextMenuSlot p_slot, const Vector<String> &p_paths);
Callable match_custom_shortcut(ContextMenuSlot p_slot, const Ref<InputEvent> &p_event);
bool activate_custom_option(ContextMenuSlot p_slot, int p_option, const Variant &p_arg);