Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plugins with multiple files #136

Open
rikkolovescats opened this issue May 15, 2023 · 2 comments
Open

Support plugins with multiple files #136

rikkolovescats opened this issue May 15, 2023 · 2 comments
Labels
enhancement New feature or request plugin-manager Everything plugin manager

Comments

@rikkolovescats
Copy link
Collaborator

rikkolovescats commented May 15, 2023

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 rikkolovescats added enhancement New feature or request plugin-manager Everything plugin manager labels May 15, 2023
@rikkolovescats
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin-manager Everything plugin manager
Projects
None yet
Development

No branches or pull requests

1 participant