Skip to content

Commit 24f9d02

Browse files
AWSWCommunityAWSWCommunity
authored andcommitted
Clean up mod loader
1 parent eb67def commit 24f9d02

File tree

9 files changed

+504
-30
lines changed

9 files changed

+504
-30
lines changed
File renamed without changes.

clean.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

modloader/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1+
import renpy
12
import os
23
import sys
3-
import importlib
4-
5-
import renpy
6-
74
import modinfo
5+
import importlib
86

97
def get_mod_path():
108
"""Get the mod path
@@ -21,7 +19,7 @@ def get_mod_path():
2119
sys.path.append(get_mod_path())
2220

2321
for mod in os.listdir(get_mod_path()):
24-
# Some mods require resources to be recognized by renpy. If a folder exist, force renpy to load it
22+
# Some mods require resources to be recognized by renpy. If a folder exists, force renpy to load it
2523
resource_dir = get_mod_path() + mod + "/resource"
2624
if os.path.isdir(resource_dir):
2725
renpy.config.searchpath.append(resource_dir)
@@ -38,3 +36,6 @@ def get_mod_path():
3836
for mod_name, mod in modinfo.get_mods().iteritems():
3937
print("Completing mod {}".format(mod_name))
4038
mod.mod_complete()
39+
40+
# force renpy to reindex all game files
41+
renpy.loader.old_config_archives = None

modloader/modinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
modlist = {}
21

32
def add_mod(mod_name, mod):
43
print("Adding mod {}".format(mod_name))
54
modlist[mod_name] = mod
65

76
def get_mods():
87
return modlist
8+

0 commit comments

Comments
 (0)