An example plugin for ETS2LA C#. You can use this as a starting point for you own.
Note: This project provides built in tasks for VSCode. You can take a look at .vscode/tasks.json to see how they work, and modify them to work with your own IDE.
- Clone/Fork the repository, this will also clone ETS2LA as a submodule to
./ETS2LA. Make sure your IDE is configured to also clone the submodules (or git with--recurse-submodules). You can do this manually by runninggit submodule update --init --recursiveafter cloning, or by checking the "Initialize submodules" option when cloning in GitHub Desktop. - Open the solution in your IDE and run the project. This will boot up ETS2LA with your plugin loaded.
- Your plugin files will be added to
ProjectName/bin/Debug/net.10.0, copying the .DLLs from here to./Pluginsin a live ETS2LA instance will also "install" your plugin. - We've also provided
ETS2LA.bat/shwhich will build ETS2LA, then all your plugins, and then run ETS2LA with the plugins copied to the right place. You can modify this script to your needs (for example copy any other libraries that your plugin needs to the output folder as well).
Note: ETS2LA C# does not yet provide a plugin repository, you will need to install plugins via copying the .DLLs to /Plugins.
Note: If you want to reload your plugins without restating ETS2LA, first unload them in the plugin manager, and then run BuildYourPlugins.bat/sh to build and copy the new .DLLs to the plugins folder, then reload them in the plugin manager.
Note: Linux users, remember to allow execution of the .sh files with chmod +x filename.sh or via your file manager!
- Run the task
Run ETS2LAto start ETS2LA with your plugin installed. - Do any changes to your plugins' code.
- Unload all plugins in the plugin manager in ETS2LA.
- Run the task
Build your projects, update .DLLs in ETS2LAto build your plugins and copy their .DLLs to ETS2LA's plugins folder. - Reload your plugins in the plugin manager in ETS2LA.
You can add more plugins to your repository by cloning the ExamplePlugin project and renaming it. Each project can also contain multiple plugins, so you are not limited to one per project namespace.
For further information please see the rewrite branch documentation on the ETS2LA Repo. The API is still in development and subject to change, but the documentation should be up to date with the latest changes.
We're also working on https://docs.ets2la.com which will have more detailed API documentation and guides.