-
-
Notifications
You must be signed in to change notification settings - Fork 4
Addons
MisfitMaid edited this page Jan 28, 2023
·
2 revisions
The following is a rough guide to the DID api. Note that until 1.0 release, nothing here is set in stone.
Obviously, to do anything, you'll need to add the following to your info.toml:
optional_dependencies = ["DID"]A LaneProvider is a simple class that exposes a string of information to DID that the user can select to show in a particular lane. Its format is very straightforward, and the minimal example below is about all you'll need to get started!
void Main() {
#if DEPENDENCY_DID
DID::registerLaneProviderAddon(DIDExample());
#endif
}
#if DEPENDENCY_DID
class DIDExample : DID::LaneProvider {
DID::LaneProviderSettings@ getProviderSetup() {
DID::LaneProviderSettings settings;
settings.author = "Your Name Here";
settings.internalName = "MyPluginID/ExampleAddon";
settings.friendlyName = "Example LaneProvider";
return settings;
}
DID::LaneConfig@ getLaneConfig(DID::LaneConfig@ &in defaults) {
DID::LaneConfig c = defaults;
c.content = "0123456789+-/:."; // takes a string
// there's also LaneConfig.color, which takes a vec4.
return c;
}
}
#endifWIP