FrostyAssetEditor and integrate with the Frosty Editor’s tab system.
FrostyAssetEditor Base Class
From~/workspace/source/FrostyPlugin/Controls/FrostyAssetEditor.cs:32:
Creating a Basic Editor
1
Create Editor Class
Inherit from
FrostyAssetEditor and pass the logger to the base constructor:2
Define the UI Template
Create a WPF control template in your plugin’s XAML resource dictionary:
3
Register the Template
Override the static constructor to register your control template:
4
Load Asset Data
Override
LoadAsset to perform custom loading:Accessing Asset Data
Root Object Access
TheRootObject property provides access to the main asset object:
Loading Dependencies
Dependencies are automatically loaded. Access them via thedependentObjects dictionary:
Adding New Dependencies
From~/workspace/source/FrostyPlugin/Controls/FrostyAssetEditor.cs:106:
Modifying Assets
To mark an asset as modified, set theAssetModified property to true. This automatically saves changes:
From ~/workspace/source/FrostyPlugin/Controls/FrostyAssetEditor.cs:64:
Example: Modifying Properties
Property Grid Integration
TheFrostyPropertyGrid control provides automatic property editing. Name it PART_AssetPropertyGrid in your template:
- Displays all properties of the root object
- Binds to
AssetModifiedto save changes - Provides type-appropriate editors (text boxes, dropdowns, etc.)
Custom Toolbar Items
Add custom toolbar buttons to your editor:Handling Resources
Loading Texture Resources
Loading MeshSet Resources
Complete Example
Here’s a simplified texture editor:Cleanup
OverrideClosed() to release resources when the editor is closed:
Next Steps
Custom Actions
Add context menu actions and commands
Attributes Reference
Complete attribute reference