2022-02-08 17:15:09 +08:00
|
|
|
# -------------------------------
|
|
|
|
# Difficult Rocket
|
2023-01-20 14:08:12 +08:00
|
|
|
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
|
2022-02-08 17:15:09 +08:00
|
|
|
# All rights reserved
|
|
|
|
# -------------------------------
|
|
|
|
|
|
|
|
"""
|
|
|
|
writen by shenjackyuanjie
|
|
|
|
mail: 3695888@qq.com
|
|
|
|
github: @shenjackyuanjie
|
|
|
|
gitee: @shenjackyuanjie
|
|
|
|
"""
|
|
|
|
|
2022-02-16 13:36:26 +08:00
|
|
|
# system function
|
2023-04-22 10:39:18 +08:00
|
|
|
from typing import Tuple, List
|
2022-02-08 17:15:09 +08:00
|
|
|
|
2022-02-16 13:36:26 +08:00
|
|
|
# from libs
|
2022-03-22 21:18:04 +08:00
|
|
|
from MCDR.version import Version
|
2022-03-06 22:12:51 +08:00
|
|
|
from MCDR.serializer import Serializable
|
2022-02-16 13:36:26 +08:00
|
|
|
|
|
|
|
# from DR
|
2022-10-11 21:54:02 +08:00
|
|
|
from Difficult_Rocket import DR_runtime, Options
|
2022-02-08 17:15:09 +08:00
|
|
|
|
|
|
|
"""
|
|
|
|
mod系统参数
|
|
|
|
"""
|
2023-04-22 10:39:18 +08:00
|
|
|
MOD_loader_version = "0.1.0.0" # mod系统版本 版本号遵守 semver ++
|
2022-03-22 21:18:04 +08:00
|
|
|
semver_loader_version = Version(MOD_loader_version)
|
2022-02-08 17:15:09 +08:00
|
|
|
|
|
|
|
"""
|
|
|
|
加载mod时会更改的参数
|
|
|
|
这里的只是范例,实际加载时会根据mod配置修改
|
|
|
|
"""
|
|
|
|
|
2023-04-22 10:39:18 +08:00
|
|
|
RequireVersion = Tuple[Version, Version]
|
|
|
|
# 第一个是最低兼容版本,第二个是最高兼容版本
|
|
|
|
# 例如: ("1.0.0", "1.1.0") 表示从1.0.0版本开始兼容,到1.1.0版本结束兼容
|
|
|
|
ForceRequire = bool
|
2022-02-08 17:15:09 +08:00
|
|
|
|
2023-04-22 10:39:18 +08:00
|
|
|
|
|
|
|
# TODO 完善中
|
2022-02-08 17:15:09 +08:00
|
|
|
class MODInfo(Serializable):
|
|
|
|
"""
|
|
|
|
加载mod时候的参数
|
|
|
|
"""
|
|
|
|
"""基本信息"""
|
2023-04-22 10:39:18 +08:00
|
|
|
name: str # mod 名称
|
|
|
|
version: Version # mod 版本
|
2022-02-08 17:15:09 +08:00
|
|
|
|
|
|
|
"""作者、描述"""
|
|
|
|
writer: str # 作者
|
2020-11-28 15:17:44 +08:00
|
|
|
link: str = "" # 作者链接
|
2022-02-16 13:36:26 +08:00
|
|
|
description: str = "" # 描述 (务必简洁明了)
|
|
|
|
info: str = "" # 其他信息 (可以很多很多)
|
2022-02-08 17:15:09 +08:00
|
|
|
|
2023-04-22 10:39:18 +08:00
|
|
|
"""版本相关信息"""
|
|
|
|
DR_version: RequireVersion = (DR_runtime.DR_version, DR_runtime.DR_version) # DR SDK 兼容版本
|
|
|
|
DR_Api_version: RequireVersion = (DR_runtime.API_version, DR_runtime.API_version) # DR Api版本
|
|
|
|
Mod_Require_version: List[Tuple[str, ForceRequire, RequireVersion]] = [] # mod 依赖版本
|
2022-02-08 17:15:09 +08:00
|
|
|
|
2023-04-22 10:39:18 +08:00
|
|
|
"""mod 状态"""
|
|
|
|
is_enable: bool = True # 是否启用
|
|
|
|
is_loaded: bool = False # 是否加载
|
2022-10-11 21:54:02 +08:00
|
|
|
|
2023-04-22 10:39:18 +08:00
|
|
|
"""mod 配置"""
|
|
|
|
config: Options = Options() # mod 配置存储
|
2022-10-11 21:54:02 +08:00
|
|
|
|
2022-02-08 17:15:09 +08:00
|
|
|
|
|
|
|
"""
|
|
|
|
一些重置用函数
|
|
|
|
"""
|