Skip to content

Steps to create a new plugin

Artyom edited this page Jun 5, 2024 · 7 revisions
  1. Create a “your-plugin-name” folder in the static folder and copy the contents of any of the existing folders.
  • In the file admin.html find with Ctrl+F all words, where the name of the plugin you copied is used and replace it “your-plugin-name”. Then do the same in index.html and in js/admin.js.
  • In folder img replace the pictures of teams with your own pictures and rename them.
  1. Create a “your-plugin-name”.go file in app/models, then rewrite it (copy one of the files in this folder and rename the structures "some-plugin"OverlayFields and "some-plugin"Overlay to "your-plugin-name"OverlayFields and "your-plugin-name, and change their name to yours in other places where they are used).
  • In the New “your-plugin-name ”Overlay function, change the players variable - change the team and logo parameters to the names and paths to their images that you created earlier.
  1. In app/store folder copy any of files that already exists and rename it to “your-plugin-name”_overlay_repository.go
  • Rename the “your-plugin-name"OverlayCollection structure and the New "your-plugin-name”OverlayCollection function in the same way as in step 2.
  1. In app/store/pogreb.go add in structure PogrebDB field: “your-plugin-name"OverlayCollection *“your-plugin-name"OverlayCollection and then add in func InitializePogrebDB raw: db."your-plugin-name”OverlayCollection = New"your-plugin-name”OverlayCollection(pdb).
  2. In app/routes.go in functions, where there is a check for plugin, add a condition: else if plugin == “your-plugin-name” then copy the condition body from any past and replace the structure with your own.
Clone this wiki locally