Add none ship compat #24 fixed
This commit is contained in:
parent
38cbae7c9d
commit
2f63dd9e74
10
configs/none_ship.xml
Normal file
10
configs/none_ship.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<Ship version="1" liftedOff="0" touchingGround="0">
|
||||
<Parts>
|
||||
<Part partType="pod-1" id="1" x="0.000000" y="0.750000" angle="0.000000" angleV="0.000000" editorAngle="0">
|
||||
<Pod throttle="0.000000" name="">
|
||||
<Staging currentStage="0"/>
|
||||
</Pod>
|
||||
</Part>
|
||||
</Parts>
|
||||
<Connections/>
|
||||
</Ship>
|
@ -18,9 +18,20 @@
|
||||
- 基于 `PyConsole`
|
||||
- 用于替换 `DR sdk` 的默认控制台方法
|
||||
|
||||
## DR rs 0.2.10.1
|
||||
|
||||
### `types.rs`
|
||||
|
||||
- 兼容了 `Option<Vec<Step>>` 的 `sr1_data.rs`
|
||||
- `Vec<Step>` -> `Option<Vec<Step>>`
|
||||
|
||||
### Bug 修复
|
||||
|
||||
- [#24](https://github.com/shenjackyuanjie/Difficult-Rocket/issues/24) `无法解析 带 staging 不带 steps的飞船`
|
||||
|
||||
## DR rs 0.2.10.0
|
||||
|
||||
## `python::PySR1PartType`
|
||||
### `python::PySR1PartType`
|
||||
|
||||
- 添加可从 Python 端获取的部件信息
|
||||
- `get_descriptiton -> String`
|
||||
|
@ -472,7 +472,7 @@ pub mod ship {
|
||||
#[serde(rename = "currentStage")]
|
||||
pub current_stage: i32,
|
||||
#[serde(rename = "Step")]
|
||||
pub steps: Vec<Step>,
|
||||
pub steps: Option<Vec<Step>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
|
@ -439,7 +439,7 @@ pub mod sr1 {
|
||||
}
|
||||
let stages = RawStaging {
|
||||
current_stage: current_stage.to_owned(),
|
||||
steps: actives,
|
||||
steps: Some(actives),
|
||||
};
|
||||
RawPod {
|
||||
name: name.clone(),
|
||||
@ -629,14 +629,19 @@ pub mod sr1 {
|
||||
Some(pod.stages.current_stage),
|
||||
Some({
|
||||
let mut steps = Vec::new();
|
||||
for step in &pod.stages.steps {
|
||||
let mut step_vec = Vec::new();
|
||||
if let Some(active) = &step.activates {
|
||||
for act in active {
|
||||
step_vec.push((act.id, i8_to_bool(act.moved)));
|
||||
match &pod.stages.steps {
|
||||
Some(step_vec) => {
|
||||
for step in step_vec {
|
||||
let mut step_vec = Vec::new();
|
||||
if let Some(active) = &step.activates {
|
||||
for act in active {
|
||||
step_vec.push((act.id, i8_to_bool(act.moved)));
|
||||
}
|
||||
}
|
||||
steps.push(step_vec);
|
||||
}
|
||||
}
|
||||
steps.push(step_vec);
|
||||
None => {}
|
||||
}
|
||||
steps
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user