remove some raw Version import

This commit is contained in:
shenjack 2023-06-10 18:08:40 +08:00
parent 58796cd79c
commit c656da613f
3 changed files with 33 additions and 8 deletions

View File

@ -12,9 +12,7 @@ import importlib.util
from pathlib import Path from pathlib import Path
from typing import Optional, List, Tuple from typing import Optional, List, Tuple
from Difficult_Rocket.api.types import Options from Difficult_Rocket.api.types import Options, Version
from libs.MCDR.version import Version
game_version = Version("0.8.0.0") # 游戏版本 game_version = Version("0.8.0.0") # 游戏版本
build_version = Version("1.2.1.0") # 编译文件版本(与游戏本体无关) build_version = Version("1.2.1.0") # 编译文件版本(与游戏本体无关)

View File

@ -23,10 +23,7 @@ else:
Game = TypeVar("Game") Game = TypeVar("Game")
ClientWindow = TypeVar("ClientWindow") ClientWindow = TypeVar("ClientWindow")
from Difficult_Rocket import DR_runtime from Difficult_Rocket import DR_runtime
from Difficult_Rocket.utils.options import Options from Difficult_Rocket.api.types import Options, Version
# from libs
from libs.MCDR.version import Version
RequireVersion = Tuple[Version, Version] RequireVersion = Tuple[Version, Version]
# 第一个是最低兼容版本,第二个是最高兼容版本 # 第一个是最低兼容版本,第二个是最高兼容版本

View File

@ -4,8 +4,38 @@
# All rights reserved # All rights reserved
# ------------------------------- # -------------------------------
import logging
from pathlib import Path
from typing import List, Dict, Optional
from Difficult_Rocket.api.screen import BaseScreen from Difficult_Rocket.api.screen import BaseScreen
from Difficult_Rocket import DR_option, DR_runtime from Difficult_Rocket.api.types import Options, Version
from Difficult_Rocket.mod.api import ModInfo
# from Difficult_Rocket import DR_option, DR_runtime
class ModManager(Options):
name = 'Mod Manager'
logger: logging.Logger
mods_path: List[Path] = [Path('./mods')]
loaded_mod_modules: Dict[str, ModInfo] = {}
def find_mods(self) -> List[Path]:
"""
查找mods文件夹下的所有mod
:return:
"""
mods = []
for path in self.mods_path:
if not path.exists():
path.mkdir(parents=True)
continue
for mod in path.iterdir():
...
def init(self) -> None:
self.logger = logging.getLogger('client')
self.logger.name = 'mod_manager'
self.logger.info('Mod Manager init')