From 3e61b825d2143c0726340e3586e71ef3ff6ec025 Mon Sep 17 00:00:00 2001 From: toasterparty Date: Mon, 26 Feb 2024 12:47:33 -0800 Subject: [PATCH] spiderBallWaypoint generic edit support --- structs/src/lib.rs | 3 ++ structs/src/scly.rs | 1 + .../src/scly_props/spider_ball_waypoint.rs | 29 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 structs/src/scly_props/spider_ball_waypoint.rs diff --git a/structs/src/lib.rs b/structs/src/lib.rs index b98a0eb3..0f839d43 100644 --- a/structs/src/lib.rs +++ b/structs/src/lib.rs @@ -59,6 +59,7 @@ pub mod scly_props pub mod sound; pub mod spawn_point; pub mod special_function; + pub mod spider_ball_waypoint; pub mod streamed_audio; pub mod switch; pub mod timer; @@ -157,6 +158,7 @@ pub mod scly_props pub use self::sound::*; pub use self::spawn_point::*; pub use self::special_function::*; + pub use self::spider_ball_waypoint::*; pub use self::streamed_audio::*; pub use self::switch::*; pub use self::timer::*; @@ -255,6 +257,7 @@ pub use scly_props::snake_weed_swarm::*; pub use scly_props::sound::*; pub use scly_props::spawn_point::*; pub use scly_props::special_function::*; +pub use scly_props::spider_ball_waypoint::*; pub use scly_props::streamed_audio::*; pub use scly_props::switch::*; pub use scly_props::timer::*; diff --git a/structs/src/scly.rs b/structs/src/scly.rs index 4e704a94..54edd450 100644 --- a/structs/src/scly.rs +++ b/structs/src/scly.rs @@ -648,6 +648,7 @@ build_scly_property!( Sound, is_sound, as_sound, as_sound_mut, SpawnPoint, is_spawn_point, as_spawn_point, as_spawn_point_mut, SpecialFunction, is_special_function, as_special_function, as_special_function_mut, + SpiderBallWaypoint, is_spider_ball_waypoint, as_spider_ball_waypoint, as_spider_ball_waypoint_mut, StreamedAudio, is_streamed_audio, as_streamed_audio, as_streamed_audio_mut, Switch, is_switch, as_switch, as_switch_mut, Timer, is_timer, as_timer, as_timer_mut, diff --git a/structs/src/scly_props/spider_ball_waypoint.rs b/structs/src/scly_props/spider_ball_waypoint.rs new file mode 100644 index 00000000..fa227e0f --- /dev/null +++ b/structs/src/scly_props/spider_ball_waypoint.rs @@ -0,0 +1,29 @@ +use auto_struct_macros::auto_struct; + +use reader_writer::CStr; +use reader_writer::typenum::*; +use reader_writer::generic_array::GenericArray; +use crate::SclyPropertyData; + +#[auto_struct(Readable, Writable)] +#[derive(Debug, Clone)] +pub struct SpiderBallWaypoint<'r> +{ + #[auto_struct(expect = 5)] + prop_count: u32, + + pub name: CStr<'r>, + + pub position: GenericArray, + pub rotation: GenericArray, + pub active: u8, + pub unknown2: u32, +} + +use crate::{impl_position, impl_rotation}; +impl<'r> SclyPropertyData for SpiderBallWaypoint<'r> +{ + const OBJECT_TYPE: u8 = 0x2C; + impl_position!(); + impl_rotation!(); +}