dr game 0.2.1.0

This commit is contained in:
shenjack 2023-06-26 01:39:16 +08:00
parent c4a1807033
commit 55d21b6b02
3 changed files with 34 additions and 4 deletions

View File

@ -2,8 +2,20 @@
# DR game/DR rs 更新日志 # DR game/DR rs 更新日志
- 最新版本号 - 最新版本号
- DR game: 0.2.0.0 - DR game: 0.2.1.0
- DR rs: 0.2.14.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 ## DR rs 0.2.14.0
@ -23,6 +35,8 @@
- 将 `sr1_ship` 中的 `Camera_rs` 改为 `Difficult_Rocket.utils.camera.Camera` - 将 `sr1_ship` 中的 `Camera_rs` 改为 `Difficult_Rocket.utils.camera.Camera`
- Change `Camera_rs` in `sr1_ship` to `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 ## DR rs 0.2.13.0

View File

@ -54,7 +54,7 @@ DR_mod_runtime = _DR_mod_runtime()
class DR_mod(ModInfo): class DR_mod(ModInfo):
mod_id = "difficult_rocket_mod" mod_id = "difficult_rocket_mod"
name = "Difficult Rocket mod" name = "Difficult Rocket mod"
version = Version("0.2.0.0") version = Version("0.2.1.0")
writer = "shenjackyuanjie" writer = "shenjackyuanjie"
link = "shenjack.top" link = "shenjack.top"

View File

@ -124,7 +124,8 @@ class SR1ShipRender(BaseScreen):
self.load_xml('configs/dock1.xml') self.load_xml('configs/dock1.xml')
self.part_box_batch = Batch() self.part_box_batch = Batch()
self.part_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, self.debug_label = Label(x=20, y=main_window.height - 100, font_size=DR_status.std_font_size,
text='SR1 render!', font_name=Fonts.微软等宽无线, text='SR1 render!', font_name=Fonts.微软等宽无线,
width=main_window.width - 20, height=20, width=main_window.width - 20, height=20,
@ -133,6 +134,7 @@ class SR1ShipRender(BaseScreen):
self.parts_sprite: Dict[int, Sprite] = {} self.parts_sprite: Dict[int, Sprite] = {}
self.part_box_dict: Dict[int, Rectangle] = {} self.part_box_dict: Dict[int, Rectangle] = {}
self.part_line_box: Dict[int, List[Line]] = {} self.part_line_box: Dict[int, List[Line]] = {}
self.part_line_list: List[Line] = []
load_end_time = time.time_ns() load_end_time = time.time_ns()
logger.info(sr_tr().mod.info.setup.use_time().format( logger.info(sr_tr().mod.info.setup.use_time().format(
(load_end_time - load_start_time) / 1000000000)) (load_end_time - load_start_time) / 1000000000))
@ -219,6 +221,20 @@ class SR1ShipRender(BaseScreen):
if count >= each_count: if count >= each_count:
count = 0 count = 0
yield each_count 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 self.drawing = False
raise GeneratorExit raise GeneratorExit