MCPcopy Create free account
hub / github.com/MothCocoon/FlowGraph / RegisterAssets

Method RegisterAssets

Source/FlowEditor/Private/FlowEditorModule.cpp:165–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void FFlowEditorModule::RegisterAssets()
166{
167 IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
168
169 // try to merge asset category with a built-in one
170 {
171 const FText AssetCategoryText = GetDefault<UFlowGraphSettings>()->FlowAssetCategoryName;
172
173 // Find matching built-in category
174 if (!AssetCategoryText.IsEmpty())
175 {
176 TArray<FAdvancedAssetCategory> AllCategories;
177 AssetTools.GetAllAdvancedAssetCategories(AllCategories);
178 for (const FAdvancedAssetCategory& ExistingCategory : AllCategories)
179 {
180 if (ExistingCategory.CategoryName.EqualTo(AssetCategoryText))
181 {
182 FlowAssetCategory = ExistingCategory.CategoryType;
183 break;
184 }
185 }
186 }
187
188 if (FlowAssetCategory == EAssetTypeCategories::None)
189 {
190 FlowAssetCategory = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Flow")), AssetCategoryText);
191 }
192 }
193
194 const TSharedRef<IAssetTypeActions> FlowNodeActions = MakeShareable(new FAssetTypeActions_FlowNodeBlueprint());
195 RegisteredAssetActions.Add(FlowNodeActions);
196 AssetTools.RegisterAssetTypeActions(FlowNodeActions);
197
198 const TSharedRef<IAssetTypeActions> FlowNodeAddOnActions = MakeShareable(new FAssetTypeActions_FlowNodeAddOnBlueprint());
199 RegisteredAssetActions.Add(FlowNodeAddOnActions);
200 AssetTools.RegisterAssetTypeActions(FlowNodeAddOnActions);
201}
202
203void FFlowEditorModule::UnregisterAssets()
204{

Callers

nothing calls this directly

Calls 2

GetMethod · 0.80
IsEmptyMethod · 0.80

Tested by

no test coverage detected