Skip to content

Commit 8a3ce92

Browse files
AWSWCommunityAWSWCommunity
authored andcommitted
Insert old-style mods into the mod registry
1 parent 8a400cd commit 8a3ce92

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modloader/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import modinfo
55
import importlib
6+
import modinfo
67

78
print('AWSW Mod Loader Init')
89

@@ -28,8 +29,12 @@ def get_mod_path():
2829

2930
# Try importing the mod. If all goes well, the mod is imported through the Mod class
3031
print("Begin mod load: {}".format(mod))
31-
#try:
32-
importlib.import_module(mod)
32+
33+
mod_object = importlib.import_module(mod)
34+
35+
# Run through the module's attributes to determine whether we should load it as a legacy mod.
36+
if not 'loadable_mod' in dir(mod_object):
37+
modinfo.add_mod(mod, mod_object)
3338

3439
# After all mods are loaded, call their respective mod_complete functions
3540
for mod_name, mod in modinfo.get_mods().iteritems():

0 commit comments

Comments
 (0)