Skip to content

Commit

Permalink
platforms.active
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterparty committed Feb 6, 2024
1 parent 2ecb0a9 commit 1397fc9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions schema/randomprime.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,11 @@
"layer": {
"$ref": "#/$defs/addModifyLayer"
},
"active": {
"description": "Default active state of the platform.",
"type": "boolean",
"default": true
},
"position": {
"description": "The position of the platform.",
"$ref": "#/$defs/vector3"
Expand Down
8 changes: 6 additions & 2 deletions src/add_modify_obj_patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ pub fn patch_add_platform<'r>(
asset_type: FourCC::from_bytes(fourcc),
}
);
area.add_dependencies(game_resources,0,deps_iter);
area.add_dependencies(game_resources,0, deps_iter);

macro_rules! new {
() => {
Expand Down Expand Up @@ -1551,7 +1551,7 @@ pub fn patch_add_platform<'r>(
},

speed: 5.0,
active: 1,
active: config.active.unwrap_or(true) as u8,

dcln: dcln,

Expand Down Expand Up @@ -1584,6 +1584,10 @@ pub fn patch_add_platform<'r>(
if let Some(rotation) = config.rotation {
property_data.rotation = rotation.into();
}

if let Some(active) = config.active {
property_data.active = active as u8;
}
};
}

Expand Down
1 change: 1 addition & 0 deletions src/patch_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ pub struct PlatformConfig
{
pub id: Option<u32>,
pub layer: Option<u32>,
pub active: Option<bool>,
pub position: [f32;3],
pub rotation: Option<[f32;3]>,
pub alt_platform: Option<bool>, // deprecated
Expand Down
4 changes: 4 additions & 0 deletions src/patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16850,6 +16850,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo
xray_only: None,
thermal_only: None,
layer: None,
active: None,
},
),
);
Expand All @@ -16868,6 +16869,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo
xray_only: None,
thermal_only: None,
layer: None,
active: None,
},
),
);
Expand All @@ -16886,6 +16888,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo
xray_only: None,
thermal_only: None,
layer: None,
active: None,
},
),
);
Expand All @@ -16904,6 +16907,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo
xray_only: None,
thermal_only: None,
layer: None,
active: None,
},
),
);
Expand Down

0 comments on commit 1397fc9

Please sign in to comment.