Compare commits
2 Commits
08d8a3cb8c
...
4111a39ecb
Author | SHA1 | Date | |
---|---|---|---|
4111a39ecb | |||
5e84e8cd25 |
@ -1 +1 @@
|
|||||||
Subproject commit e48bc0cd740e3b7df4a275399fe25578a6d626cd
|
Subproject commit 8bef88a5922c13cd5ff466f300a2610ce43eacbb
|
2
mods/dr_game/Difficult_Rocket_rs/src/Cargo.lock
generated
2
mods/dr_game/Difficult_Rocket_rs/src/Cargo.lock
generated
@ -133,7 +133,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "difficult_rocket_rs"
|
name = "difficult_rocket_rs"
|
||||||
version = "0.2.24"
|
version = "0.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fs-err",
|
"fs-err",
|
||||||
"pyo3",
|
"pyo3",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "difficult_rocket_rs"
|
name = "difficult_rocket_rs"
|
||||||
version = "0.2.24"
|
version = "0.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license-file = '../../LICENSE'
|
license-file = '../../LICENSE'
|
||||||
authors = ["shenjackyuanjie <3695888@qq.com>"]
|
authors = ["shenjackyuanjie <3695888@qq.com>"]
|
||||||
|
@ -12,7 +12,7 @@ package_path = "Difficult_Rocket_rs"
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="Difficult_Rocket_rs",
|
name="Difficult_Rocket_rs",
|
||||||
version="0.2.21.0",
|
version="0.3.0",
|
||||||
author="shenjackyuanjie",
|
author="shenjackyuanjie",
|
||||||
author_email="3695888@qq.com",
|
author_email="3695888@qq.com",
|
||||||
rust_extensions=[
|
rust_extensions=[
|
||||||
|
@ -7,8 +7,9 @@ use crate::sr1_data::part_list::Damage as RawDamage;
|
|||||||
use crate::sr1_data::part_list::{AttachPoint, AttachPoints, Engine, Lander, Rcs, Shape as RawShape, Solar, Tank};
|
use crate::sr1_data::part_list::{AttachPoint, AttachPoints, Engine, Lander, Rcs, Shape as RawShape, Solar, Tank};
|
||||||
use crate::sr1_data::part_list::{RawPartList, RawPartType, SR1PartTypeEnum};
|
use crate::sr1_data::part_list::{RawPartList, RawPartType, SR1PartTypeEnum};
|
||||||
use crate::sr1_data::ship::{
|
use crate::sr1_data::ship::{
|
||||||
Activate as RawActivate, Connection, Connections, DisconnectedPart as RawDisconnectedPart, DisconnectedParts as RawDisconnectedParts,
|
Activate as RawActivate, Connection, Connections, DisconnectedPart as RawDisconnectedPart,
|
||||||
Engine as RawEngine, Part as RawPartData, Parts as RawParts, Pod as RawPod, RawShip, Staging as RawStaging, Step as RawStep, Tank as RawTank,
|
DisconnectedParts as RawDisconnectedParts, Engine as RawEngine, Part as RawPartData, Parts as RawParts,
|
||||||
|
Pod as RawPod, RawShip, Staging as RawStaging, Step as RawStep, Tank as RawTank,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::data_type::math::{Point2D, Rotatable};
|
use crate::data_type::math::{Point2D, Rotatable};
|
||||||
@ -248,7 +249,11 @@ impl SR1PartTypeData for SR1PartType {
|
|||||||
fn to_raw_part_type(&self) -> RawPartType {
|
fn to_raw_part_type(&self) -> RawPartType {
|
||||||
let tank: Option<Tank> = match &self.attr {
|
let tank: Option<Tank> = match &self.attr {
|
||||||
Some(attr) => match attr.to_owned() {
|
Some(attr) => match attr.to_owned() {
|
||||||
SR1PartTypeAttr::Tank { fuel, dry_mass, fuel_type } => Some(Tank {
|
SR1PartTypeAttr::Tank {
|
||||||
|
fuel,
|
||||||
|
dry_mass,
|
||||||
|
fuel_type,
|
||||||
|
} => Some(Tank {
|
||||||
fuel,
|
fuel,
|
||||||
dry_mass,
|
dry_mass,
|
||||||
fuel_type: Some(fuel_type),
|
fuel_type: Some(fuel_type),
|
||||||
@ -280,7 +285,15 @@ impl SR1PartTypeData for SR1PartType {
|
|||||||
};
|
};
|
||||||
let rcs: Option<Rcs> = match &self.attr {
|
let rcs: Option<Rcs> = match &self.attr {
|
||||||
Some(attr) => match attr.to_owned() {
|
Some(attr) => match attr.to_owned() {
|
||||||
SR1PartTypeAttr::Rcs { power, consumption, size } => Some(Rcs { power, consumption, size }),
|
SR1PartTypeAttr::Rcs {
|
||||||
|
power,
|
||||||
|
consumption,
|
||||||
|
size,
|
||||||
|
} => Some(Rcs {
|
||||||
|
power,
|
||||||
|
consumption,
|
||||||
|
size,
|
||||||
|
}),
|
||||||
_ => None,
|
_ => None,
|
||||||
},
|
},
|
||||||
_ => None,
|
_ => None,
|
||||||
@ -770,7 +783,8 @@ impl SR1Ship {
|
|||||||
writer.write_event(Event::Start(pod_elem.to_owned())).unwrap();
|
writer.write_event(Event::Start(pod_elem.to_owned())).unwrap();
|
||||||
|
|
||||||
let mut stage_attr = BytesStart::new("Staging");
|
let mut stage_attr = BytesStart::new("Staging");
|
||||||
stage_attr.push_attribute(("currentStage", part.attr.current_stage.unwrap().to_string().as_str()));
|
stage_attr
|
||||||
|
.push_attribute(("currentStage", part.attr.current_stage.unwrap().to_string().as_str()));
|
||||||
match &part.attr.steps {
|
match &part.attr.steps {
|
||||||
Some(steps) => {
|
Some(steps) => {
|
||||||
writer.write_event(Event::Start(stage_attr)).unwrap();
|
writer.write_event(Event::Start(stage_attr)).unwrap();
|
||||||
@ -779,7 +793,8 @@ impl SR1Ship {
|
|||||||
for activate in step.iter() {
|
for activate in step.iter() {
|
||||||
let mut activate_attr = BytesStart::new("Activate");
|
let mut activate_attr = BytesStart::new("Activate");
|
||||||
activate_attr.push_attribute(("Id", activate.0.to_string().as_str()));
|
activate_attr.push_attribute(("Id", activate.0.to_string().as_str()));
|
||||||
activate_attr.push_attribute(("moved", (activate.1 as i8).to_string().as_str()));
|
activate_attr
|
||||||
|
.push_attribute(("moved", (activate.1 as i8).to_string().as_str()));
|
||||||
writer.write_event(Event::Empty(activate_attr)).unwrap();
|
writer.write_event(Event::Empty(activate_attr)).unwrap();
|
||||||
}
|
}
|
||||||
writer.write_event(Event::End(BytesEnd::new("Step"))).unwrap();
|
writer.write_event(Event::End(BytesEnd::new("Step"))).unwrap();
|
||||||
@ -805,7 +820,8 @@ impl SR1Ship {
|
|||||||
part_attr.push_attribute(("chuteAngle", part.attr.chute_angle.unwrap().to_string().as_str()));
|
part_attr.push_attribute(("chuteAngle", part.attr.chute_angle.unwrap().to_string().as_str()));
|
||||||
part_attr.push_attribute(("inflate", (part.attr.inflate.unwrap() as i8).to_string().as_str()));
|
part_attr.push_attribute(("inflate", (part.attr.inflate.unwrap() as i8).to_string().as_str()));
|
||||||
part_attr.push_attribute(("inflation", part.attr.inflation.unwrap().to_string().as_str()));
|
part_attr.push_attribute(("inflation", part.attr.inflation.unwrap().to_string().as_str()));
|
||||||
part_attr.push_attribute(("deployed", (part.attr.deployed.unwrap() as i8).to_string().as_str()));
|
part_attr
|
||||||
|
.push_attribute(("deployed", (part.attr.deployed.unwrap() as i8).to_string().as_str()));
|
||||||
part_attr.push_attribute(("rope", (part.attr.rope.unwrap() as i8).to_string().as_str()));
|
part_attr.push_attribute(("rope", (part.attr.rope.unwrap() as i8).to_string().as_str()));
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
@ -841,7 +857,11 @@ impl SR1Ship {
|
|||||||
writer.write_event(Event::End(BytesEnd::new("Connections"))).unwrap();
|
writer.write_event(Event::End(BytesEnd::new("Connections"))).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_disconnect(data: &Option<ConnectionType>, writer: &mut Writer<Cursor<Vec<u8>>>, save_status: &SaveStatus) {
|
fn write_disconnect(
|
||||||
|
data: &Option<ConnectionType>,
|
||||||
|
writer: &mut Writer<Cursor<Vec<u8>>>,
|
||||||
|
save_status: &SaveStatus,
|
||||||
|
) {
|
||||||
match data {
|
match data {
|
||||||
Some(data) => {
|
Some(data) => {
|
||||||
writer.write_event(Event::Start(BytesStart::new("DisconnectedParts"))).unwrap();
|
writer.write_event(Event::Start(BytesStart::new("DisconnectedParts"))).unwrap();
|
||||||
|
@ -25,7 +25,7 @@ enum LoadingState {
|
|||||||
|
|
||||||
#[pyfunction]
|
#[pyfunction]
|
||||||
fn get_version_str() -> String {
|
fn get_version_str() -> String {
|
||||||
"0.2.23.0".to_string()
|
"0.3.0".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[pyfunction]
|
#[pyfunction]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# cargo fmt config
|
# cargo fmt config
|
||||||
|
|
||||||
# 最大行长
|
# 最大行长
|
||||||
max_width = 150
|
max_width = 120
|
||||||
# 链式调用的最大长度
|
# 链式调用的最大长度
|
||||||
chain_width = 100
|
chain_width = 100
|
||||||
# 数组的最大长度
|
# 数组的最大长度
|
||||||
@ -11,7 +11,7 @@ attr_fn_like_width = 100
|
|||||||
# 函数调用参数的最大长度
|
# 函数调用参数的最大长度
|
||||||
fn_call_width = 80
|
fn_call_width = 80
|
||||||
# 简单函数格式化为单行
|
# 简单函数格式化为单行
|
||||||
fn_single_line = true
|
fn_single_line = false
|
||||||
|
|
||||||
# 自动对齐最大长度
|
# 自动对齐最大长度
|
||||||
enum_discrim_align_threshold = 5
|
enum_discrim_align_threshold = 5
|
||||||
|
@ -303,7 +303,8 @@ impl SR1PartTypeData for RawPartType {
|
|||||||
explosion_power: Some(0_f64),
|
explosion_power: Some(0_f64),
|
||||||
explosion_size: Some(0_f64),
|
explosion_size: Some(0_f64),
|
||||||
});
|
});
|
||||||
let attach_points: Option<Vec<AttachPoint>> = self.attach_points.as_ref().map(|attach_points| attach_points.unzip());
|
let attach_points: Option<Vec<AttachPoint>> =
|
||||||
|
self.attach_points.as_ref().map(|attach_points| attach_points.unzip());
|
||||||
SR1PartType {
|
SR1PartType {
|
||||||
id: self.id.clone(),
|
id: self.id.clone(),
|
||||||
name: self.name.clone(),
|
name: self.name.clone(),
|
||||||
|
@ -17,7 +17,7 @@ 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.2.23.0") # DR_mod 的 Rust 编写部分的兼容版本
|
DR_rust_version = Version("0.3.0") # 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")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user