Configs and DataStorage
On this page we will explain the built in config system as well as the predefinied data directory for your plugin.
Configs using TOML
The built in config system of Onsharp uses the file format TOML which is a vartion of YAML and INI. The creation as well as the loading of the config will be managed by Onsharp itself. You just need to define a data class, and let Onsharp load this class.
This data class is marked with the config attribute. You must define the name of the config file with the first parameter. The second parameter is optional and can define a sub directory.
Now you just need to register the config:
The config file gets automatically created in the data folder of the plugin and than loaded and returned.
Data Storage
The data storage is not fully implemented currently. If you just want to write some kind of file to your data folder, you can access the directory info via Data.Directory
Last updated
Was this helpful?