Plugin Architecture
Plugins are .NET assemblies loaded dynamically at runtime. Plugin Discovery:Plugin Lifecycle
Plugins are loaded in two phases:1
Startup Phase
Loaded before game profile selection:
- Profile definitions
- Global type editors
- Type overrides
- Startup actions
2
Initialize Phase
Loaded after profile is selected:
- Asset definitions (game-specific)
- Custom handlers
- Menu extensions
- Tab extensions
- Options pages
Plugin Attributes
Plugins use assembly-level attributes to declare functionality:Core Attributes
- Plugin Metadata
- Profile Validation
- Third-Party DLLs
Extension Types
Asset Definitions
Define how asset types are displayed and edited:Asset definitions registered for a base type automatically apply to all derived types via the TypeLibrary.
Custom Handlers
Provide specialized editing for specific asset types:- EBX Handler
- Resource Handler
Menu Extensions
Add custom menu items to the editor:Tab Extensions
Add custom tabs to the main editor window:Data Explorer Context Menu
Add right-click menu items in the asset browser:Startup Actions
Execute code during application startup:Execution Actions (Mod Manager)
Execute during mod application:Type System Integration
Global Type Editors
Custom editors for specific field types:Type Overrides
Replace type handling entirely:Shader Registration
Register custom shaders for rendering:Custom Asset Managers
Handle non-standard asset storage:Profile Registration
Add support for new games:Plugin Example: Texture Plugin
Complete example of a texture handling plugin:Plugin Best Practices
Recommendations:
- Use appropriate load phases - Startup for core functionality, Initialize for game-specific
- Validate profile compatibility - Use PluginValidForProfile attributes
- Handle errors gracefully - Catch exceptions and log to ILogger
- Mark dependencies - Use RegisterThirdPartyDll for libraries
- Follow naming conventions - Clear, descriptive class and attribute names
- Document public APIs - Add XML comments for plugin developers
- Test across games - Verify behavior with different profiles
- Version appropriately - Use semantic versioning
Plugin Development Workflow
1
Create Project
Create a .NET Framework 4.6.1+ class library project
2
Reference Frosty
Add references to FrostySdk.dll and FrostyCore.dll
3
Implement Extensions
Add classes with appropriate attributes
4
Build Plugin
Compile to DLL
5
Deploy
Copy DLL to Plugins folder in Frosty installation
6
Test
Launch Frosty Editor/Mod Manager and verify plugin loads
Plugin Debugging
Attach Visual Studio debugger to Frosty process:Common Plugin Patterns
Batch Asset Processing
Batch Asset Processing
Custom File Format Import
Custom File Format Import
Resource Preview
Resource Preview
Next Steps
Architecture
Understand the overall system architecture
Asset System
Learn about EBX, RES, and chunk asset management