ECommons is a multi-functional library designed to work within Dalamud Plugins. It features a variety of different systems and shortcuts which cuts out a lot of boiler plate code normally used to do standard plugin tasks.
git submodule add https://github.com/NightmareXIV/ECommons.git
Add it to your plugin's CSProj file:
<ItemGroup>
<ProjectReference Include="..\ECommons\ECommons\ECommons.csproj" />
</ItemGroup>
Then, in the entry point of your plugin:
ECommonsMain.Init(pluginInterface, this);
where pluginInterface is a DalamudPluginInterface.
Don't forget to dispose it in your plugin's dispose method:
ECommonsMain.Dispose();
Using certain functions like clipboard or keypresses will require you to enable Windows Forms module. Add the following section into your plugin's .csproj
file:
<PropertyGroup>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
Additionally, to be able to build on Linux (if you're using Github Actions or want to send your plugin to official Dalamud repo), you will have to enable windows targeting. Add the following section into your plugin's .csproj
file:
<PropertyGroup>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
ECommonsMain.Init(pluginInterface, this, Modules.<Module>);
where <Module> is one of the following:
- All (For all modules)
- Localization
- SplatoonAPI
- DalamudReflector
- ObjectLife
- ObjectFunctions