diff --git a/configs/main.toml b/configs/main.toml index 4f5eb27..a6a0078 100644 --- a/configs/main.toml +++ b/configs/main.toml @@ -7,8 +7,8 @@ fonts_folder = "libs/fonts" [window] style = "None" -width = 1021 -height = 1078 +width = 2175 +height = 1808 visible = true gui_scale = 1 caption = "Difficult Rocket v{DR_version}" diff --git a/docs/src/change_log/dr_game.md b/docs/src/change_log/dr_game.md index 94a7ada..78f8a0a 100644 --- a/docs/src/change_log/dr_game.md +++ b/docs/src/change_log/dr_game.md @@ -3,7 +3,15 @@ - 最新版本号 - DR game: 0.2.0.0 - - DR rs: 0.2.10.1 + - DR rs: 0.2.11.0 + +## DR rs 0.2.11.0 + +### 添加 + +- `Python::data::PySR1Ship` + - `get_part_box(&self, part_id: i64) -> Option<(f64, f64), (f64, f64)>` + - 用于获取对应 id 的碰撞箱 ## DR game 0.2.0.0 diff --git a/mods/dr_game/Difficult_Rocket_rs/src/setup.py b/mods/dr_game/Difficult_Rocket_rs/src/setup.py index a362c4d..3a3f63d 100644 --- a/mods/dr_game/Difficult_Rocket_rs/src/setup.py +++ b/mods/dr_game/Difficult_Rocket_rs/src/setup.py @@ -12,7 +12,7 @@ package_path = 'Difficult_Rocket_rs' setup( name='Difficult_Rocket_rs', - version="0.2.10.1", + version="0.2.11.0", author='shenjackyuanjie', author_email='3695888@qq.com', rust_extensions=[RustExtension(target="Difficult_Rocket_rs.Difficult_Rocket_rs", diff --git a/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs index 428f63f..c077576 100644 --- a/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs +++ b/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs @@ -26,7 +26,7 @@ enum LoadState { } #[pyfunction] -fn get_version_str() -> String { "0.2.10.1".to_string() } +fn get_version_str() -> String { "0.2.11.0".to_string() } #[pyfunction] fn test_call(py_obj: &PyAny) -> PyResult { diff --git a/mods/dr_game/__init__.py b/mods/dr_game/__init__.py index 46adba8..a930e96 100644 --- a/mods/dr_game/__init__.py +++ b/mods/dr_game/__init__.py @@ -17,7 +17,7 @@ from Difficult_Rocket.api.mod import ModInfo from Difficult_Rocket.client import ClientWindow from Difficult_Rocket.api.types import Options, Version -DR_rust_version = Version("0.2.10.1") # DR_mod 的 Rust 编写部分的兼容版本 +DR_rust_version = Version("0.2.11.0") # DR_mod 的 Rust 编写部分的兼容版本 logger = logging.getLogger('client.dr_game') diff --git a/mods/dr_game/sr1_ship.py b/mods/dr_game/sr1_ship.py index 1b981d0..c06b6e6 100644 --- a/mods/dr_game/sr1_ship.py +++ b/mods/dr_game/sr1_ship.py @@ -192,39 +192,26 @@ class SR1ShipRender(BaseScreen): cache_sprite.y = cache_sprite.y - cache_sprite.scale_y / 2 self.parts_sprite[part.id] = cache_sprite - part_width = 100 - part_height = 100 - if DR_mod_runtime.use_DR_rust: - part_type = self.part_list_rs.get_part_type(part.p_type) part_debug_box = self.rust_ship.get_part_box(part.id) - if part_type is not None: - part_width = part_type.width * 15 - part_height = part_type.height * 15 - # 白色框框 - part_box = Rectangle(x=render_x, y=render_y, - width=part_width, height=part_height, - batch=self.part_box_batch, group=self.part_group) - part_box.rotation = SR1Rotation.get_rotation(part.angle) - part_box.opacity = 50 - self.part_box_dict[part.id] = part_box - # 线框 - part_line_box = [] - width = 3 - color = (random.randrange(0, 255), random.randrange(0, 255), random.randrange(0, 255), random.randrange(0, 255)) - part_line_box.append(Line(x=part_debug_box[0][0] * 30, y=part_debug_box[0][1] * 30, - x2=part_debug_box[0][0] * 30, y2=part_debug_box[1][1] * 30, - batch=self.part_box_batch, width=width, color=color)) - part_line_box.append(Line(x=part_debug_box[0][0] * 30, y=part_debug_box[1][1] * 30, - x2=part_debug_box[1][0] * 30, y2=part_debug_box[1][1] * 30, - batch=self.part_box_batch, width=width, color=color)) - part_line_box.append(Line(x=part_debug_box[1][0] * 30, y=part_debug_box[1][1] * 30, - x2=part_debug_box[1][0] * 30, y2=part_debug_box[0][1] * 30, - batch=self.part_box_batch, width=width, color=color)) - part_line_box.append(Line(x=part_debug_box[1][0] * 30, y=part_debug_box[0][1] * 30, - x2=part_debug_box[0][0] * 30, y2=part_debug_box[0][1] * 30, - batch=self.part_box_batch, width=width, color=color)) - self.part_line_box[part.id] = part_line_box + if part_debug_box: + # 线框 + part_line_box = [] + width = 3 + color = (random.randrange(0, 255), random.randrange(0, 255), random.randrange(0, 255), random.randrange(0, 255)) + part_line_box.append(Line(x=part_debug_box[0][0] * 30, y=part_debug_box[0][1] * 30, + x2=part_debug_box[0][0] * 30, y2=part_debug_box[1][1] * 30, + batch=self.part_box_batch, width=width, color=color)) + part_line_box.append(Line(x=part_debug_box[0][0] * 30, y=part_debug_box[1][1] * 30, + x2=part_debug_box[1][0] * 30, y2=part_debug_box[1][1] * 30, + batch=self.part_box_batch, width=width, color=color)) + part_line_box.append(Line(x=part_debug_box[1][0] * 30, y=part_debug_box[1][1] * 30, + x2=part_debug_box[1][0] * 30, y2=part_debug_box[0][1] * 30, + batch=self.part_box_batch, width=width, color=color)) + part_line_box.append(Line(x=part_debug_box[1][0] * 30, y=part_debug_box[0][1] * 30, + x2=part_debug_box[0][0] * 30, y2=part_debug_box[0][1] * 30, + batch=self.part_box_batch, width=width, color=color)) + self.part_line_box[part.id] = part_line_box # if not part_render: # 如果不渲染(渲染有毛病) # self.parts_sprite[part.id].visible = False count += 1