Move structs to their own files
This commit is contained in:
parent
fe745be3e3
commit
35fa818827
23 changed files with 373 additions and 339 deletions
|
@ -71,7 +71,7 @@ pub fn serialized_struct(_metadata: TokenStream, input: TokenStream)
|
|||
let id = &input.ident;
|
||||
|
||||
let output = quote! {
|
||||
#[binrw]
|
||||
#[binrw::binrw]
|
||||
#input
|
||||
|
||||
#[automatically_derived]
|
||||
|
@ -99,7 +99,6 @@ pub fn serialized_field(attr: TokenStream, input: TokenStream) -> TokenStream {
|
|||
let input2 = parse_macro_input!(input as Item);
|
||||
|
||||
let output = quote! {
|
||||
#[binrw]
|
||||
#input2
|
||||
};
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use crate::da_assemble_id_data::DAAssembleIdDataStruct;
|
||||
use crate::da_customize_asset_id::DACustomizeAssetIdDataStruct;
|
||||
use crate::da_trigger_data::DATriggerDataStruct;
|
||||
use crate::da_tuning_data::DATuningDataStruct;
|
||||
use crate::str_property::StrProperty;
|
||||
use crate::structs::PropertyBase;
|
||||
use crate::structs::{
|
||||
DAAssembleIdDataStruct, DACustomizeAssetIdDataStruct, DATriggerDataStruct, DATuningDataStruct,
|
||||
};
|
||||
use binrw::binrw;
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[paramacro::serialized_struct("DABuildData")]
|
||||
|
|
35
src/da_assemble_id_data.rs
Normal file
35
src/da_assemble_id_data.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
use crate::{da_machine_coloring_data::DAMachineColoringDataStruct, guid::Guid};
|
||||
|
||||
#[paramacro::serialized_struct("DAAssembleIdData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAAssembleIdDataStruct {
|
||||
#[paramacro::serialized_field = "Hanger"]
|
||||
pub hanger: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Headset"]
|
||||
pub headset: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Mobility"]
|
||||
pub mobility: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Thruster"]
|
||||
pub thruster: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Utility"]
|
||||
pub utility: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "PrimaryFrontWeapon"]
|
||||
pub primary_front_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "SecondaryFrontWeapon"]
|
||||
pub secondary_front_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "LeftRearWeapon"]
|
||||
pub left_rear_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "RightRearWeapon"]
|
||||
pub right_rear_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "ColoringData"]
|
||||
pub coloring_data: DAMachineColoringDataStruct,
|
||||
}
|
35
src/da_customize_asset_id.rs
Normal file
35
src/da_customize_asset_id.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
use crate::{
|
||||
bool_property::BoolProperty, da_humanoid_coloring_data::DAHumanoidColoringDataStruct,
|
||||
da_humanoid_figure_data::DAHumanoidFigureData, primary_asset_id::PrimaryAssetIdStruct,
|
||||
};
|
||||
|
||||
#[paramacro::serialized_struct("DACustomizeAssetIdData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DACustomizeAssetIdDataStruct {
|
||||
#[paramacro::serialized_field = "Body"]
|
||||
pub body: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Face"]
|
||||
pub face: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "FrontHair"]
|
||||
pub front_hair: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BackHair"]
|
||||
pub back_hair: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "ColoringData"]
|
||||
pub coloring_data: DAHumanoidColoringDataStruct,
|
||||
|
||||
#[paramacro::serialized_field = "FigureData"]
|
||||
pub figure_data: DAHumanoidFigureData,
|
||||
|
||||
#[paramacro::serialized_field = "bInverseFaceMesh"]
|
||||
pub inverse_face_mesh: BoolProperty,
|
||||
|
||||
#[paramacro::serialized_field = "bInverseFrontHairMesh"]
|
||||
pub inverse_front_hair_mesh: BoolProperty,
|
||||
|
||||
#[paramacro::serialized_field = "bInverseBackHairMesh"]
|
||||
pub inverse_back_hair_mesh: BoolProperty,
|
||||
}
|
38
src/da_humanoid_coloring_data.rs
Normal file
38
src/da_humanoid_coloring_data.rs
Normal file
|
@ -0,0 +1,38 @@
|
|||
use crate::linear_color::LinearColorStruct;
|
||||
|
||||
#[paramacro::serialized_struct("DAHumanoidColoringData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAHumanoidColoringDataStruct {
|
||||
#[paramacro::serialized_field = "Skin"]
|
||||
pub skin: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HairBase"]
|
||||
pub hair_base: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HairGradation"]
|
||||
pub hair_gradation: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HairHighlight"]
|
||||
pub hair_highlight: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HeadOption"]
|
||||
pub head_option: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "EyeL"]
|
||||
pub eye_l: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "EyeR"]
|
||||
pub eye_r: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodyMain"]
|
||||
pub body_main: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodySub1"]
|
||||
pub body_sub1: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodySub2"]
|
||||
pub body_sub2: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodySub3"]
|
||||
pub body_sub3: LinearColorStruct,
|
||||
}
|
20
src/da_humanoid_figure_data.rs
Normal file
20
src/da_humanoid_figure_data.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
use crate::float_property::FloatProperty;
|
||||
|
||||
#[paramacro::serialized_struct("DAHumanoidFigureData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAHumanoidFigureData {
|
||||
#[paramacro::serialized_field = "BustUp"]
|
||||
pub bust_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "FatUp"]
|
||||
pub fat_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "ArmUp"]
|
||||
pub arm_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "LegUp"]
|
||||
pub leg_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "WaistUp"]
|
||||
pub waist_up: FloatProperty,
|
||||
}
|
8
src/da_load_option.rs
Normal file
8
src/da_load_option.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use crate::int_property::IntProperty;
|
||||
|
||||
#[paramacro::serialized_struct("DALoadOption")]
|
||||
#[derive(Debug)]
|
||||
pub struct DALoadOptionStruct {
|
||||
#[paramacro::serialized_field = "LoadTypes"]
|
||||
pub load_types: IntProperty,
|
||||
}
|
32
src/da_machine_coloring_data.rs
Normal file
32
src/da_machine_coloring_data.rs
Normal file
|
@ -0,0 +1,32 @@
|
|||
use crate::da_module_color::DAModuleColorStruct;
|
||||
|
||||
#[paramacro::serialized_struct("DAMachineColoringData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAMachineColoringDataStruct {
|
||||
#[paramacro::serialized_field = "Hanger"]
|
||||
pub hanger: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Headset"]
|
||||
pub headset: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Mobility"]
|
||||
pub mobility: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Thruster"]
|
||||
pub thruster: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Utility"]
|
||||
pub utility: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "PrimaryFrontWeapon"]
|
||||
pub primary_front_weapon: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "SecondaryFrontWeapon"]
|
||||
pub secondary_front_weapon: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "LeftRearWeapon"]
|
||||
pub left_rear_weapon: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "RightRearWeapon"]
|
||||
pub right_rear_weapon: DAModuleColorStruct,
|
||||
}
|
17
src/da_module_color.rs
Normal file
17
src/da_module_color.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use crate::linear_color::LinearColorStruct;
|
||||
|
||||
#[paramacro::serialized_struct("DAModuleColor")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAModuleColorStruct {
|
||||
#[paramacro::serialized_field = "Main"]
|
||||
pub main: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Sub"]
|
||||
pub sub: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Inner"]
|
||||
pub inner: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Glow"]
|
||||
pub glow: LinearColorStruct,
|
||||
}
|
8
src/da_module_item_data.rs
Normal file
8
src/da_module_item_data.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use crate::int_property::IntProperty;
|
||||
|
||||
#[paramacro::serialized_struct("DAModuleItemData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAModuleItemDataStruct {
|
||||
#[paramacro::serialized_field = "ModuleLevel"]
|
||||
pub module_level: IntProperty,
|
||||
}
|
14
src/da_trigger_data.rs
Normal file
14
src/da_trigger_data.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
use crate::enum_property::EnumProperty;
|
||||
|
||||
#[paramacro::serialized_struct("DATriggerData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DATriggerDataStruct {
|
||||
#[paramacro::serialized_field = "A"]
|
||||
pub a: EnumProperty,
|
||||
|
||||
#[paramacro::serialized_field = "B"]
|
||||
pub b: EnumProperty,
|
||||
|
||||
#[paramacro::serialized_field = "C"]
|
||||
pub c: EnumProperty,
|
||||
}
|
8
src/da_tuning_data.rs
Normal file
8
src/da_tuning_data.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use crate::map_property::MapProperty;
|
||||
|
||||
#[paramacro::serialized_struct("DATuningData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DATuningDataStruct {
|
||||
#[paramacro::serialized_field = "GrantedTuningPointList"]
|
||||
pub granted_tuning_point_list: MapProperty,
|
||||
}
|
11
src/da_tuning_point_data.rs
Normal file
11
src/da_tuning_point_data.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
use crate::int_property::IntProperty;
|
||||
|
||||
#[paramacro::serialized_struct("DATuningPointData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DATuningPointData {
|
||||
#[paramacro::serialized_field = "TuningPoint"]
|
||||
tuning_point: IntProperty,
|
||||
|
||||
#[paramacro::serialized_field = "MaxTuningPoint"]
|
||||
max_tuning_point: IntProperty,
|
||||
}
|
23
src/datetime.rs
Normal file
23
src/datetime.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
use binrw::binrw;
|
||||
|
||||
use crate::structs::PropertyBase;
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct DateTimeStruct {
|
||||
pub unk: [u8; 8],
|
||||
}
|
||||
|
||||
impl PropertyBase for DateTimeStruct {
|
||||
fn type_name() -> &'static str {
|
||||
"StructProperty"
|
||||
}
|
||||
|
||||
fn struct_name() -> Option<&'static str> {
|
||||
Some("DateTime")
|
||||
}
|
||||
|
||||
fn size_in_bytes(&self) -> u32 {
|
||||
8
|
||||
}
|
||||
}
|
16
src/lib.rs
16
src/lib.rs
|
@ -2,6 +2,18 @@ pub mod array_property;
|
|||
pub mod bool_property;
|
||||
mod build_data;
|
||||
mod common;
|
||||
mod da_assemble_id_data;
|
||||
mod da_customize_asset_id;
|
||||
mod da_humanoid_coloring_data;
|
||||
mod da_humanoid_figure_data;
|
||||
mod da_load_option;
|
||||
mod da_machine_coloring_data;
|
||||
mod da_module_color;
|
||||
mod da_module_item_data;
|
||||
mod da_trigger_data;
|
||||
mod da_tuning_data;
|
||||
mod da_tuning_point_data;
|
||||
mod datetime;
|
||||
mod enum_property;
|
||||
pub mod float_property;
|
||||
mod guid;
|
||||
|
@ -11,10 +23,14 @@ pub mod map_property;
|
|||
mod name_property;
|
||||
mod primary_asset_id;
|
||||
mod primary_asset_type;
|
||||
mod quat;
|
||||
mod save_slot_info;
|
||||
pub mod set_property;
|
||||
pub mod str_property;
|
||||
pub mod struct_property;
|
||||
mod structs;
|
||||
mod transform;
|
||||
mod vector;
|
||||
|
||||
use binrw::helpers::until_eof;
|
||||
use std::fs::write;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use crate::{name_property::NameProperty, primary_asset_type::PrimaryAssetTypeStruct};
|
||||
use binrw::binrw;
|
||||
|
||||
#[paramacro::serialized_struct("PrimaryAssetId")]
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use crate::name_property::NameProperty;
|
||||
use binrw::binrw;
|
||||
|
||||
#[paramacro::serialized_struct("PrimaryAssetType")]
|
||||
#[derive(Debug)]
|
||||
|
|
27
src/quat.rs
Normal file
27
src/quat.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
use binrw::binrw;
|
||||
|
||||
use crate::structs::PropertyBase;
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct QuatStruct {
|
||||
// TODO: check if w is actually in front or in the back, this is a guess
|
||||
pub w: f32,
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
pub z: f32,
|
||||
}
|
||||
|
||||
impl PropertyBase for QuatStruct {
|
||||
fn type_name() -> &'static str {
|
||||
"StructProperty"
|
||||
}
|
||||
|
||||
fn struct_name() -> Option<&'static str> {
|
||||
Some("Quat")
|
||||
}
|
||||
|
||||
fn size_in_bytes(&self) -> u32 {
|
||||
16
|
||||
}
|
||||
}
|
20
src/save_slot_info.rs
Normal file
20
src/save_slot_info.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
use crate::{
|
||||
array_property::ArrayProperty, datetime::DateTimeStruct, name_property::NameProperty,
|
||||
str_property::StrProperty,
|
||||
};
|
||||
|
||||
#[paramacro::serialized_struct("SaveSlotInfo")]
|
||||
#[derive(Debug)]
|
||||
pub struct SaveSlotInfoStruct {
|
||||
#[paramacro::serialized_field = "Name"]
|
||||
pub name: StrProperty,
|
||||
|
||||
#[paramacro::serialized_field = "Timestamp"]
|
||||
pub timestamp: DateTimeStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Level"]
|
||||
pub level: NameProperty,
|
||||
|
||||
#[paramacro::serialized_field = "Players"]
|
||||
pub players: ArrayProperty,
|
||||
}
|
|
@ -1,15 +1,26 @@
|
|||
use crate::build_data::DABuildDataStruct;
|
||||
use crate::common::{read_string_with_length, write_string_with_length};
|
||||
use crate::da_assemble_id_data::DAAssembleIdDataStruct;
|
||||
use crate::da_customize_asset_id::DACustomizeAssetIdDataStruct;
|
||||
use crate::da_humanoid_coloring_data::DAHumanoidColoringDataStruct;
|
||||
use crate::da_humanoid_figure_data::DAHumanoidFigureData;
|
||||
use crate::da_load_option::DALoadOptionStruct;
|
||||
use crate::da_machine_coloring_data::DAMachineColoringDataStruct;
|
||||
use crate::da_module_color::DAModuleColorStruct;
|
||||
use crate::da_module_item_data::DAModuleItemDataStruct;
|
||||
use crate::da_trigger_data::DATriggerDataStruct;
|
||||
use crate::da_tuning_data::DATuningDataStruct;
|
||||
use crate::da_tuning_point_data::DATuningPointData;
|
||||
use crate::datetime::DateTimeStruct;
|
||||
use crate::guid::Guid;
|
||||
use crate::linear_color::LinearColorStruct;
|
||||
use crate::primary_asset_id::PrimaryAssetIdStruct;
|
||||
use crate::primary_asset_type::PrimaryAssetTypeStruct;
|
||||
use crate::structs::{
|
||||
DAAssembleIdDataStruct, DACustomizeAssetIdDataStruct, DAHumanoidColoringDataStruct,
|
||||
DAHumanoidFigureData, DALoadOptionStruct, DAMachineColoringDataStruct, DAModuleColorStruct,
|
||||
DAModuleItemDataStruct, DATriggerDataStruct, DATuningDataStruct, DATuningPointData,
|
||||
DateTimeStruct, PropertyBase, QuatStruct, SaveSlotInfoStruct, TransformStruct, VectorStruct,
|
||||
};
|
||||
use crate::quat::QuatStruct;
|
||||
use crate::save_slot_info::SaveSlotInfoStruct;
|
||||
use crate::structs::PropertyBase;
|
||||
use crate::transform::TransformStruct;
|
||||
use crate::vector::VectorStruct;
|
||||
use binrw::binrw;
|
||||
|
||||
#[binrw]
|
||||
|
|
325
src/structs.rs
325
src/structs.rs
|
@ -1,49 +1,8 @@
|
|||
use crate::Property;
|
||||
use crate::array_property::ArrayProperty;
|
||||
use crate::bool_property::BoolProperty;
|
||||
use crate::build_data::DABuildDataStruct;
|
||||
use crate::common::{read_string_with_length, write_string_with_length};
|
||||
use crate::enum_property::EnumProperty;
|
||||
use crate::float_property::FloatProperty;
|
||||
use crate::guid::Guid;
|
||||
use crate::int_property::IntProperty;
|
||||
use crate::linear_color::LinearColorStruct;
|
||||
use crate::map_property::MapProperty;
|
||||
use crate::name_property::NameProperty;
|
||||
use crate::primary_asset_id::PrimaryAssetIdStruct;
|
||||
use crate::str_property::StrProperty;
|
||||
use binrw::{BinRead, BinResult, BinWrite, binrw};
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct DateTimeStruct {
|
||||
pub unk: [u8; 8],
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DALoadOption")]
|
||||
#[derive(Debug)]
|
||||
pub struct DALoadOptionStruct {
|
||||
#[paramacro::serialized_field = "LoadTypes"]
|
||||
pub load_types: IntProperty,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("SaveSlotInfo")]
|
||||
#[derive(Debug)]
|
||||
pub struct SaveSlotInfoStruct {
|
||||
#[paramacro::serialized_field = "Name"]
|
||||
pub name: StrProperty,
|
||||
|
||||
#[paramacro::serialized_field = "Timestamp"]
|
||||
pub timestamp: DateTimeStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Level"]
|
||||
pub level: NameProperty,
|
||||
|
||||
#[paramacro::serialized_field = "Players"]
|
||||
pub players: ArrayProperty,
|
||||
}
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct GenericProperty {
|
||||
|
@ -61,248 +20,6 @@ pub struct GenericProperty {
|
|||
pub key: Option<Box<Property>>,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DAModuleItemData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAModuleItemDataStruct {
|
||||
#[paramacro::serialized_field = "ModuleLevel"]
|
||||
pub module_level: IntProperty,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DAAssembleIdData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAAssembleIdDataStruct {
|
||||
#[paramacro::serialized_field = "Hanger"]
|
||||
pub hanger: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Headset"]
|
||||
pub headset: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Mobility"]
|
||||
pub mobility: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Thruster"]
|
||||
pub thruster: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "Utility"]
|
||||
pub utility: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "PrimaryFrontWeapon"]
|
||||
pub primary_front_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "SecondaryFrontWeapon"]
|
||||
pub secondary_front_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "LeftRearWeapon"]
|
||||
pub left_rear_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "RightRearWeapon"]
|
||||
pub right_rear_weapon: Guid,
|
||||
|
||||
#[paramacro::serialized_field = "ColoringData"]
|
||||
pub coloring_data: DAMachineColoringDataStruct,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DAMachineColoringData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAMachineColoringDataStruct {
|
||||
#[paramacro::serialized_field = "Hanger"]
|
||||
pub hanger: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Headset"]
|
||||
pub headset: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Mobility"]
|
||||
pub mobility: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Thruster"]
|
||||
pub thruster: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Utility"]
|
||||
pub utility: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "PrimaryFrontWeapon"]
|
||||
pub primary_front_weapon: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "SecondaryFrontWeapon"]
|
||||
pub secondary_front_weapon: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "LeftRearWeapon"]
|
||||
pub left_rear_weapon: DAModuleColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "RightRearWeapon"]
|
||||
pub right_rear_weapon: DAModuleColorStruct,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DAHumanoidColoringData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAHumanoidColoringDataStruct {
|
||||
#[paramacro::serialized_field = "Skin"]
|
||||
pub skin: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HairBase"]
|
||||
pub hair_base: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HairGradation"]
|
||||
pub hair_gradation: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HairHighlight"]
|
||||
pub hair_highlight: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "HeadOption"]
|
||||
pub head_option: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "EyeL"]
|
||||
pub eye_l: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "EyeR"]
|
||||
pub eye_r: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodyMain"]
|
||||
pub body_main: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodySub1"]
|
||||
pub body_sub1: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodySub2"]
|
||||
pub body_sub2: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BodySub3"]
|
||||
pub body_sub3: LinearColorStruct,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DAModuleColor")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAModuleColorStruct {
|
||||
#[paramacro::serialized_field = "Main"]
|
||||
pub main: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Sub"]
|
||||
pub sub: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Inner"]
|
||||
pub inner: LinearColorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Glow"]
|
||||
pub glow: LinearColorStruct,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DATriggerData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DATriggerDataStruct {
|
||||
#[paramacro::serialized_field = "A"]
|
||||
pub a: EnumProperty,
|
||||
|
||||
#[paramacro::serialized_field = "B"]
|
||||
pub b: EnumProperty,
|
||||
|
||||
#[paramacro::serialized_field = "C"]
|
||||
pub c: EnumProperty,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DACustomizeAssetIdData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DACustomizeAssetIdDataStruct {
|
||||
#[paramacro::serialized_field = "Body"]
|
||||
pub body: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Face"]
|
||||
pub face: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "FrontHair"]
|
||||
pub front_hair: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "BackHair"]
|
||||
pub back_hair: PrimaryAssetIdStruct,
|
||||
|
||||
#[paramacro::serialized_field = "ColoringData"]
|
||||
pub coloring_data: DAHumanoidColoringDataStruct,
|
||||
|
||||
#[paramacro::serialized_field = "FigureData"]
|
||||
pub figure_data: DAHumanoidFigureData,
|
||||
|
||||
#[paramacro::serialized_field = "bInverseFaceMesh"]
|
||||
pub inverse_face_mesh: BoolProperty,
|
||||
|
||||
#[paramacro::serialized_field = "bInverseFrontHairMesh"]
|
||||
pub inverse_front_hair_mesh: BoolProperty,
|
||||
|
||||
#[paramacro::serialized_field = "bInverseBackHairMesh"]
|
||||
pub inverse_back_hair_mesh: BoolProperty,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DAHumanoidFigureData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DAHumanoidFigureData {
|
||||
#[paramacro::serialized_field = "BustUp"]
|
||||
pub bust_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "FatUp"]
|
||||
pub fat_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "ArmUp"]
|
||||
pub arm_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "LegUp"]
|
||||
pub leg_up: FloatProperty,
|
||||
|
||||
#[paramacro::serialized_field = "WaistUp"]
|
||||
pub waist_up: FloatProperty,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DATuningData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DATuningDataStruct {
|
||||
#[paramacro::serialized_field = "GrantedTuningPointList"]
|
||||
pub granted_tuning_point_list: MapProperty,
|
||||
}
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct SavedBuildData {
|
||||
pub build_data: DABuildDataStruct,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("DATuningPointData")]
|
||||
#[derive(Debug)]
|
||||
pub struct DATuningPointData {
|
||||
#[paramacro::serialized_field = "TuningPoint"]
|
||||
tuning_point: IntProperty,
|
||||
|
||||
#[paramacro::serialized_field = "MaxTuningPoint"]
|
||||
max_tuning_point: IntProperty,
|
||||
}
|
||||
|
||||
#[paramacro::serialized_struct("Transform")]
|
||||
#[derive(Debug)]
|
||||
pub struct TransformStruct {
|
||||
#[paramacro::serialized_field = "Rotation"]
|
||||
rotation: QuatStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Translation"]
|
||||
translation: VectorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Scale3D"]
|
||||
scale: VectorStruct,
|
||||
}
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct QuatStruct {
|
||||
// TODO: check if w is actually in front or in the back, this is a guess
|
||||
pub w: f32,
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
pub z: f32,
|
||||
}
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct VectorStruct {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
pub z: f32,
|
||||
}
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct StructFieldPrelude {
|
||||
|
@ -356,48 +73,6 @@ pub(crate) trait PropertyBase {
|
|||
}
|
||||
}
|
||||
|
||||
impl PropertyBase for DateTimeStruct {
|
||||
fn type_name() -> &'static str {
|
||||
"StructProperty"
|
||||
}
|
||||
|
||||
fn struct_name() -> Option<&'static str> {
|
||||
Some("DateTime")
|
||||
}
|
||||
|
||||
fn size_in_bytes(&self) -> u32 {
|
||||
8
|
||||
}
|
||||
}
|
||||
|
||||
impl PropertyBase for VectorStruct {
|
||||
fn type_name() -> &'static str {
|
||||
"StructProperty"
|
||||
}
|
||||
|
||||
fn struct_name() -> Option<&'static str> {
|
||||
Some("Vector")
|
||||
}
|
||||
|
||||
fn size_in_bytes(&self) -> u32 {
|
||||
16
|
||||
}
|
||||
}
|
||||
|
||||
impl PropertyBase for QuatStruct {
|
||||
fn type_name() -> &'static str {
|
||||
"StructProperty"
|
||||
}
|
||||
|
||||
fn struct_name() -> Option<&'static str> {
|
||||
Some("Quat")
|
||||
}
|
||||
|
||||
fn size_in_bytes(&self) -> u32 {
|
||||
16
|
||||
}
|
||||
}
|
||||
|
||||
#[binrw::writer(writer, endian)]
|
||||
pub(crate) fn write_struct_field<T: PropertyBase + BinWrite<Args<'static> = ()> + Debug>(
|
||||
structure: &T,
|
||||
|
|
14
src/transform.rs
Normal file
14
src/transform.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
use crate::{quat::QuatStruct, vector::VectorStruct};
|
||||
|
||||
#[paramacro::serialized_struct("Transform")]
|
||||
#[derive(Debug)]
|
||||
pub struct TransformStruct {
|
||||
#[paramacro::serialized_field = "Rotation"]
|
||||
rotation: QuatStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Translation"]
|
||||
translation: VectorStruct,
|
||||
|
||||
#[paramacro::serialized_field = "Scale3D"]
|
||||
scale: VectorStruct,
|
||||
}
|
25
src/vector.rs
Normal file
25
src/vector.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
use binrw::binrw;
|
||||
|
||||
use crate::structs::PropertyBase;
|
||||
|
||||
#[binrw]
|
||||
#[derive(Debug)]
|
||||
pub struct VectorStruct {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
pub z: f32,
|
||||
}
|
||||
|
||||
impl PropertyBase for VectorStruct {
|
||||
fn type_name() -> &'static str {
|
||||
"StructProperty"
|
||||
}
|
||||
|
||||
fn struct_name() -> Option<&'static str> {
|
||||
Some("Vector")
|
||||
}
|
||||
|
||||
fn size_in_bytes(&self) -> u32 {
|
||||
16
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue