fmt + 步进版本号
This commit is contained in:
parent
a8be1eadd8
commit
7a960bb6ed
2
mods/dr_game/Difficult_Rocket_rs/src/Cargo.lock
generated
2
mods/dr_game/Difficult_Rocket_rs/src/Cargo.lock
generated
@ -146,7 +146,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "difficult_rocket_rs"
|
name = "difficult_rocket_rs"
|
||||||
version = "0.3.4"
|
version = "0.3.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"dict_derive",
|
"dict_derive",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "difficult_rocket_rs"
|
name = "difficult_rocket_rs"
|
||||||
version = "0.3.4"
|
version = "0.3.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license-file = '../../LICENSE'
|
license-file = '../../LICENSE'
|
||||||
authors = ["shenjackyuanjie <3695888@qq.com>"]
|
authors = ["shenjackyuanjie <3695888@qq.com>"]
|
||||||
|
@ -16,11 +16,23 @@ from Difficult_Rocket.api.types import Options, Version
|
|||||||
|
|
||||||
from lib_not_dr import loggers
|
from lib_not_dr import loggers
|
||||||
|
|
||||||
DR_rust_version = Version("0.3.4") # DR_mod 的 Rust 编写部分的兼容版本
|
DR_rust_version = Version("0.3.5") # DR_mod 的 Rust 编写部分的兼容版本
|
||||||
|
|
||||||
logger = loggers.config.get_logger_from_old("client.dr_game", "client")
|
logger = loggers.config.get_logger_from_old("client.dr_game", "client")
|
||||||
|
|
||||||
|
|
||||||
|
class ModLoadFaildError(BaseException):
|
||||||
|
"""
|
||||||
|
就是用来告诉你, mod 加载错误
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class DRrsNotMatch(ModLoadFaildError):
|
||||||
|
"""
|
||||||
|
就是用来告诉你, mod 的 rust 版本不匹配
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class _DR_mod_runtime(Options): # NOQA
|
class _DR_mod_runtime(Options): # NOQA
|
||||||
name = "DR mod runtime"
|
name = "DR mod runtime"
|
||||||
|
|
||||||
@ -39,12 +51,16 @@ class _DR_mod_runtime(Options): # NOQA
|
|||||||
relationship = (
|
relationship = (
|
||||||
"larger" if self.DR_rust_version > self.DR_rust_version else "smaller"
|
"larger" if self.DR_rust_version > self.DR_rust_version else "smaller"
|
||||||
)
|
)
|
||||||
logger.warn(
|
logger.fatal(
|
||||||
f"DR_rust builtin version is {self.DR_rust_version} "
|
f"DR_rust builtin version is {self.DR_rust_version} "
|
||||||
f"but true version is {get_version_str()}.\n"
|
f"but true version is {get_version_str()}.\n"
|
||||||
f"Builtin version {relationship} than true version",
|
f"Builtin version {relationship} than true version",
|
||||||
tag="load_dll",
|
tag="load_dll",
|
||||||
)
|
)
|
||||||
|
raise DRrsNotMatch(
|
||||||
|
f"DR rs found with version {get_version_str()}, "
|
||||||
|
f"but compat version is {DR_rust_version}"
|
||||||
|
)
|
||||||
self.use_DR_rust = self.use_DR_rust and self.DR_rust_available
|
self.use_DR_rust = self.use_DR_rust and self.DR_rust_available
|
||||||
except Exception:
|
except Exception:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
@ -60,7 +76,7 @@ DR_mod_runtime = _DR_mod_runtime()
|
|||||||
class DR_mod(ModInfo): # NOQA
|
class DR_mod(ModInfo): # NOQA
|
||||||
mod_id = "difficult_rocket_mod"
|
mod_id = "difficult_rocket_mod"
|
||||||
name = "Difficult Rocket mod"
|
name = "Difficult Rocket mod"
|
||||||
version = Version("0.3.3.0")
|
version = Version("0.3.4")
|
||||||
|
|
||||||
writer = "shenjackyuanjie"
|
writer = "shenjackyuanjie"
|
||||||
link = "shenjack.top"
|
link = "shenjack.top"
|
||||||
|
@ -188,13 +188,14 @@ class SR1ShipRender(BaseScreen):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self.logger.error(traceback.format_exc(), tag="load_xml")
|
self.logger.error(traceback.format_exc(), tag="load_xml")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def draw_parts(
|
def draw_parts(
|
||||||
self,
|
self,
|
||||||
cache: List[Tuple[SR1PartType_rs, SR1PartData_rs]],
|
cache: List[Tuple[SR1PartType_rs, SR1PartData_rs]],
|
||||||
count: int,
|
count: int,
|
||||||
each_count: int,
|
each_count: int,
|
||||||
draw_part_box: bool,
|
draw_part_box: bool,
|
||||||
draw_alpha: int
|
draw_alpha: int,
|
||||||
):
|
):
|
||||||
# 渲染传入的parts
|
# 渲染传入的parts
|
||||||
part_group = Group(2, parent=self.part_group)
|
part_group = Group(2, parent=self.part_group)
|
||||||
@ -299,8 +300,6 @@ class SR1ShipRender(BaseScreen):
|
|||||||
self.status.draw_done = False
|
self.status.draw_done = False
|
||||||
# rust 渲染
|
# rust 渲染
|
||||||
if DR_mod_runtime.use_DR_rust:
|
if DR_mod_runtime.use_DR_rust:
|
||||||
|
|
||||||
|
|
||||||
# 渲染所有未连接零件
|
# 渲染所有未连接零件
|
||||||
all_disconnected_groups = self.rust_ship.disconnected_parts()
|
all_disconnected_groups = self.rust_ship.disconnected_parts()
|
||||||
for parts_groups, connections in all_disconnected_groups:
|
for parts_groups, connections in all_disconnected_groups:
|
||||||
@ -313,9 +312,6 @@ class SR1ShipRender(BaseScreen):
|
|||||||
count = 0
|
count = 0
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 渲染所有已连接零件
|
# 渲染所有已连接零件
|
||||||
draw_part_box = False
|
draw_part_box = False
|
||||||
cache = self.rust_ship.as_dict()
|
cache = self.rust_ship.as_dict()
|
||||||
|
Loading…
Reference in New Issue
Block a user