| 163 | } |
| 164 | |
| 165 | void 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 | |
| 203 | void FFlowEditorModule::UnregisterAssets() |
| 204 | { |