Extending Content Browser.
Let's see how to extend Content Browser's context menu. We'd like to add custom commands that can be performed over selected folders.
There is a lot of information about extending editor menu. A good point to start is to read this article:
As it is described in the article, we have our custom game module and started to extend editor from here:
You see that ContentBrowser doesn't provide methods to get MenuEsteder but has methods to get reference on array that contatin delegates that will be called when unreal builds context menu.
Note that we must pass "NewFolder" as hook name to extend path menu (See MultiBoxBuilder.cpp::ApplyHook) It is important to store information about selected path that came from content browser to have a proper context for our extenstion. I've decide to keep Extension variable in FGameEditorModule instance. This solution is a little bit ugly, but works fine.
Don't forget to add public dependencies to Slate, ContentBrowser and other modules in GameEditor.Build.cs
Комментариев нет:
Отправить комментарий