mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Merge pull request #100556 from KoBeWi/unlimited_contextizer
Add more menus support to EditorContextMenuPlugin
This commit is contained in:
commit
ce6c3c5c28
7 changed files with 93 additions and 3 deletions
|
|
@ -86,8 +86,11 @@ void EditorContextMenuPlugin::_bind_methods() {
|
|||
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_SCENE_TREE);
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_FILESYSTEM);
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_FILESYSTEM_CREATE);
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_SCRIPT_EDITOR);
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_FILESYSTEM_CREATE);
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_SCRIPT_EDITOR_CODE);
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_SCENE_TABS);
|
||||
BIND_ENUM_CONSTANT(CONTEXT_SLOT_2D_EDITOR);
|
||||
}
|
||||
|
||||
void EditorContextMenuPluginManager::add_plugin(EditorContextMenuPlugin::ContextMenuSlot p_slot, const Ref<EditorContextMenuPlugin> &p_plugin) {
|
||||
|
|
@ -105,6 +108,15 @@ void EditorContextMenuPluginManager::remove_plugin(const Ref<EditorContextMenuPl
|
|||
plugin_list.erase(p_plugin);
|
||||
}
|
||||
|
||||
bool EditorContextMenuPluginManager::has_plugins_for_slot(ContextMenuSlot p_slot) {
|
||||
for (Ref<EditorContextMenuPlugin> &plugin : plugin_list) {
|
||||
if (plugin->slot == p_slot) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void EditorContextMenuPluginManager::add_options_from_plugins(PopupMenu *p_popup, ContextMenuSlot p_slot, const Vector<String> &p_paths) {
|
||||
bool separator_added = false;
|
||||
const int icon_size = p_popup->get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue