plugin-manager icon indicating copy to clipboard operation
plugin-manager copied to clipboard

Support plugins with multiple files

Open rikkolovescats opened this issue 1 year ago • 2 comments

The game currently also supports plugins with multiple files. So you could have a directory tree like this for your awesome_plugin:

mods
├── awesome_plugin
│   ├── __init__.py
│   └── loader.py
└── random_plugin.py

with these file contents:

# awesome_plugin/__init__.py

# ba_meta require api 7
import ba
from .loader import load_awesome_plugin

# ba_meta export plugin
class AwesomePlugin(ba.Plugin):
    def on_app_running(self):
        load_awesome_plugin()
# awesome_plugin/loader.py

import ba

def load_awesome_plugin():
    ba.screenmessage("Awesome Plugin loaded!")

The game'll pick this plugin up and you should see a Awesome Plugin loaded! screenmessage.


At the moment, only single-file .py plugins work with plugin manager. Support for such multi-file plugins will be nice to have.

rikkolovescats avatar May 15 '23 17:05 rikkolovescats

This isn't on my priority list at the moment as I feel for most plugins having multiple files would probably be over engineering.

rikkolovescats avatar May 20 '23 09:05 rikkolovescats

I think we should avoid this for now, this'll add complexity to code which'll probably not bring good enough returns (at least yet).

rikkolovescats avatar Jul 28 '23 19:07 rikkolovescats