Optionally restrict your plugin to specific games:
// Only load for Battlefield 1 and Battlefield V[assembly: PluginValidForProfile((int)ProfileVersion.Battlefield1)][assembly: PluginValidForProfile((int)ProfileVersion.BattlefieldV)]// Or exclude specific profiles[assembly: PluginNotValidForProfile((int)ProfileVersion.Anthem)]
Asset definitions control how assets are displayed and edited. Here’s a real example from ~/workspace/source/Plugins/TexturePlugin/TextureAssetDefinition.cs:
using Frosty.Core;using Frosty.Core.Controls;using FrostySdk.Interfaces;using FrostySdk.Managers;using System.Collections.Generic;using System.Windows.Media;namespace TexturePlugin{ public class TextureAssetDefinition : AssetDefinition { private static ImageSource imageSource = new ImageSourceConverter() .ConvertFromString("pack://application:,,,/FrostyCore;component/Images/Assets/ImageFileType.png") as ImageSource; // Define supported export formats public override void GetSupportedExportTypes(List<AssetExportType> exportTypes) { exportTypes.Add(new AssetExportType("png", "Portable Network Graphics")); exportTypes.Add(new AssetExportType("tga", "Truevision TGA")); exportTypes.Add(new AssetExportType("hdr", "High Dynamic Range")); exportTypes.Add(new AssetExportType("dds", "Direct Draw Surface")); base.GetSupportedExportTypes(exportTypes); } // Provide an icon for this asset type public override ImageSource GetIcon() { return imageSource; } // Handle asset export public override bool Export(EbxAssetEntry entry, string path, string filterType) { if (!base.Export(entry, path, filterType)) { if (filterType == "png" || filterType == "tga" || filterType == "hdr" || filterType == "dds") { EbxAsset asset = App.AssetManager.GetEbx(entry); dynamic textureAsset = (dynamic)asset.RootObject; ResAssetEntry resEntry = App.AssetManager.GetResEntry(textureAsset.Resource); Texture texture = App.AssetManager.GetResAs<Texture>(resEntry); TextureExporter exporter = new TextureExporter(); exporter.Export(texture, path, "*." + filterType); return true; } } return false; } // Provide a custom editor public override FrostyAssetEditor GetEditor(ILogger logger) { return new FrostyTextureEditor(logger); } }}
Register your asset definition in AssemblyInfo.cs:
using TexturePlugin;[assembly: RegisterAssetDefinition("TextureAsset", typeof(TextureAssetDefinition))]
The first parameter is the asset type name from the game’s type library. The PluginManager handles registration (from ~/workspace/source/FrostyPlugin/PluginManager.cs:452-483).