Source code for modloader.modinfo
"""This file is free software under the MIT license"""
# pylint: disable=invalid-name
import os.path
from os import listdir
try:
import renpy.config
except AttributeError:
# Building documentation
pass
modlist = {}
moddirnames = []
[docs]def add_mod(mod_name, mod):
"""Add a mod in the registry"""
print "Adding mod {}".format(mod_name)
modlist[mod_name] = mod
[docs]def get_mods():
"""Get the mods in the registry"""
return modlist
[docs]def reset_mods():
"""Remove all mods from the registry"""
modlist.clear()
moddirnames[:] = listdir(os.path.join(os.path.normpath(renpy.config.gamedir), "mods"))
def get_mod_folders():
return moddirnames