From 55d21b6b025b8a2fa95ff507521d36e95ea6f230 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Mon, 26 Jun 2023 01:39:16 +0800 Subject: [PATCH] dr game 0.2.1.0 --- docs/src/change_log/dr_game.md | 18 ++++++++++++++++-- mods/dr_game/__init__.py | 2 +- mods/dr_game/sr1_ship.py | 18 +++++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/docs/src/change_log/dr_game.md b/docs/src/change_log/dr_game.md index ac08155..e5564bb 100644 --- a/docs/src/change_log/dr_game.md +++ b/docs/src/change_log/dr_game.md @@ -2,8 +2,20 @@ # DR game/DR rs 更新日志 - 最新版本号 - - DR game: 0.2.0.0 - - DR rs: 0.2.14.0 + - DR game: 0.2.1.0 + - DR rs: 0.2.15.0 + +## DR rs 0.2.15.0 + +### 添加 + +- `IdType = i64` + - 统一的 id 类型 + - Unified id type +- `PySR1Ship` + - `get_connection -> Vec<(i32, i32, IdType, IdType)>` + - 获取飞船的连接信息 + - Get the connection information of the ship ## DR rs 0.2.14.0 @@ -23,6 +35,8 @@ - 将 `sr1_ship` 中的 `Camera_rs` 改为 `Difficult_Rocket.utils.camera.Camera` - Change `Camera_rs` in `sr1_ship` to `Difficult_Rocket.utils.camera.Camera` +- 添加了部件的连接线(都是彩色哒) + - Add the connection line of the part (all are colored) ## DR rs 0.2.13.0 diff --git a/mods/dr_game/__init__.py b/mods/dr_game/__init__.py index e3deee7..523dc40 100644 --- a/mods/dr_game/__init__.py +++ b/mods/dr_game/__init__.py @@ -54,7 +54,7 @@ DR_mod_runtime = _DR_mod_runtime() class DR_mod(ModInfo): mod_id = "difficult_rocket_mod" name = "Difficult Rocket mod" - version = Version("0.2.0.0") + version = Version("0.2.1.0") writer = "shenjackyuanjie" link = "shenjack.top" diff --git a/mods/dr_game/sr1_ship.py b/mods/dr_game/sr1_ship.py index db85e32..072369e 100644 --- a/mods/dr_game/sr1_ship.py +++ b/mods/dr_game/sr1_ship.py @@ -124,7 +124,8 @@ class SR1ShipRender(BaseScreen): self.load_xml('configs/dock1.xml') self.part_box_batch = Batch() self.part_batch = Batch() - self.part_group = Group() + self.part_group = Group(2) + self.part_line_group = Group(1, parent=self.part_group) self.debug_label = Label(x=20, y=main_window.height - 100, font_size=DR_status.std_font_size, text='SR1 render!', font_name=Fonts.微软等宽无线, width=main_window.width - 20, height=20, @@ -133,6 +134,7 @@ class SR1ShipRender(BaseScreen): self.parts_sprite: Dict[int, Sprite] = {} self.part_box_dict: Dict[int, Rectangle] = {} self.part_line_box: Dict[int, List[Line]] = {} + self.part_line_list: List[Line] = [] load_end_time = time.time_ns() logger.info(sr_tr().mod.info.setup.use_time().format( (load_end_time - load_start_time) / 1000000000)) @@ -219,6 +221,20 @@ class SR1ShipRender(BaseScreen): if count >= each_count: count = 0 yield each_count + if DR_mod_runtime.use_DR_rust: + for connect in self.rust_ship.connection: + # 连接线 + parent_part_data = self.part_data[connect[2]] + child_part_data = self.part_data[connect[3]] + color = (random.randrange(100, 255), random.randrange(0, 255), random.randrange(0, 255), 255) + self.part_line_list.append(Line(x=parent_part_data.x * 60, y=parent_part_data.y * 60, + x2=child_part_data.x * 60, y2=child_part_data.y * 60, + batch=self.part_batch, group=self.part_line_group, + width=1, color=color)) + count += 1 + if count >= each_count: + count = 0 + yield each_count self.drawing = False raise GeneratorExit