some mod update
This commit is contained in:
parent
c6e5d8f4f1
commit
5200e30613
@ -137,6 +137,7 @@ class _DR_runtime(Options):
|
|||||||
# global_logger: logging.Logger
|
# global_logger: logging.Logger
|
||||||
|
|
||||||
# game options
|
# game options
|
||||||
|
mod_path: str = './mods'
|
||||||
language: str = 'zh-CN'
|
language: str = 'zh-CN'
|
||||||
default_language: str = 'zh-CN'
|
default_language: str = 'zh-CN'
|
||||||
|
|
||||||
@ -154,7 +155,9 @@ class _DR_runtime(Options):
|
|||||||
with contextlib.suppress(FileNotFoundError):
|
with contextlib.suppress(FileNotFoundError):
|
||||||
with open('./configs/main.toml', 'r', encoding='utf-8') as f:
|
with open('./configs/main.toml', 'r', encoding='utf-8') as f:
|
||||||
import rtoml
|
import rtoml
|
||||||
self.language = rtoml.load(f)['runtime']['language']
|
config_file = rtoml.load(f)
|
||||||
|
self.language = config_file['runtime']['language']
|
||||||
|
self.mod_path = config_file['game']['mods']['path']
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -162,6 +165,12 @@ class _DR_runtime(Options):
|
|||||||
mod_list = self.find_mods()
|
mod_list = self.find_mods()
|
||||||
|
|
||||||
def find_mods(self) -> List[str]:
|
def find_mods(self) -> List[str]:
|
||||||
|
objects = os.listdir(self.mod_path)
|
||||||
|
for obj in objects:
|
||||||
|
if os.path.isdir(os.path.join(self.mod_path, obj)):
|
||||||
|
...
|
||||||
|
else:
|
||||||
|
...
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user