From af2c312d109f0e7c2807957809f9eef8caa3aa8c Mon Sep 17 00:00:00 2001 From: shenjack-mac <3695888@qq.com> Date: Sat, 22 Apr 2023 22:00:51 +0800 Subject: [PATCH] fix: is_dir() not is_dir --- Difficult_Rocket/__init__.py | 3 ++- configs/main.toml | 5 ++--- mods/dr_game/__init__.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Difficult_Rocket/__init__.py b/Difficult_Rocket/__init__.py index 71e65c0..e6aefba 100644 --- a/Difficult_Rocket/__init__.py +++ b/Difficult_Rocket/__init__.py @@ -160,7 +160,7 @@ class _DR_runtime(Options): sys.path.append(self.mod_path) for mod_path in paths: try: - if mod_path.is_dir: # 处理文件夹 mod + if mod_path.is_dir() and mod_path.name != '__pycache__': # 处理文件夹 mod if importlib.util.find_spec(mod_path.name) is not None: module = importlib.import_module(mod_path.name) mods.append(mod_path.name) @@ -171,6 +171,7 @@ class _DR_runtime(Options): module = importlib.import_module(mod_path.name) mods.append(mod_path.name) elif mod_path.suffix == '.py': # 处理单文件 mod + print(f'importing mod {mod_path=} {mod_path.stem}') module = importlib.import_module(mod_path.stem) mods.append(mod_path.stem) except ImportError: diff --git a/configs/main.toml b/configs/main.toml index aa2f87a..51cf24d 100644 --- a/configs/main.toml +++ b/configs/main.toml @@ -7,8 +7,8 @@ fonts_folder = "libs/fonts" [window] style = "None" -width = 1406 -height = 900 +width = 958 +height = 587 visible = true gui_scale = 1 caption = "Difficult Rocket v{DR_version}|DR_rs v{DR_Rust_get_version}" @@ -19,6 +19,5 @@ full_screen = false width = 1024 height = 768 gui_scale = 1 - [game.mods] path = "mods" diff --git a/mods/dr_game/__init__.py b/mods/dr_game/__init__.py index f6a9679..7858482 100644 --- a/mods/dr_game/__init__.py +++ b/mods/dr_game/__init__.py @@ -5,7 +5,7 @@ # ------------------------------- from MCDR.version import Version -from Difficult_Rocket.mod import ModInfo +from Difficult_Rocket.api.mod import ModInfo INFO = ModInfo( mod_id="Difficult_Rocket_mod",