ireko/src/structs.rs

128 lines
2.6 KiB
Rust
Raw Normal View History

2025-02-19 19:34:13 -05:00
use crate::{Property, StringBasedProperty};
use binrw::binrw;
#[binrw]
#[derive(Debug)]
pub struct DateTimeStruct {
pub unk: [u8; 25],
}
#[binrw]
#[derive(Debug)]
pub struct DALoadOptionStruct {
pub unk: [u8; 69], // Contains LoadType property
2025-02-19 19:34:13 -05:00
}
#[binrw]
#[derive(Debug)]
pub struct SaveSlotInfoStruct {
pub unk: [u8; 17],
}
#[binrw]
#[derive(Debug)]
pub struct DACharacterCommonStatusStruct {
pub unk: [u8; 17],
}
#[binrw]
#[derive(Debug)]
pub struct ParamsStruct {
pub params_value_type_length: u32,
pub params_value: Box<Property>,
}
#[binrw]
#[derive(Debug)]
pub struct PrimaryAssetNameProperty {
#[br(temp)]
#[bw(ignore)]
pub property_name_length: u32,
#[br(count = property_name_length)]
#[bw(map = |x : &String | x.as_bytes())]
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
pub property_name: String,
#[br(temp)]
#[bw(ignore)]
#[br(if(property_name != "None"))]
pub type_length: u32,
#[br(count = type_length)]
#[bw(map = |x : &String | x.as_bytes())]
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
#[br(if(property_name != "None"))]
pub type_name: String,
#[br(if(property_name != "None"))]
#[br(args { magic: &type_name})]
2025-02-23 15:04:04 -05:00
//
2025-02-19 19:34:13 -05:00
pub key: Option<Box<StringBasedProperty>>,
}
#[binrw]
#[derive(Debug)]
pub struct CarryCountProperty {
#[br(temp)]
#[bw(ignore)]
pub property_name_length: u32,
#[br(count = property_name_length)]
#[bw(map = |x : &String | x.as_bytes())]
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())]
pub property_name: String,
#[br(args { magic: &property_name})]
2025-02-23 15:04:04 -05:00
//
pub key: Option<Box<StringBasedProperty>>,
2025-02-19 19:34:13 -05:00
}
#[binrw]
#[derive(Debug)]
pub struct PrimaryAssetIdStruct {
#[br(pad_before = 17)]
asset: PrimaryAssetNameProperty,
}
#[binrw]
#[derive(Debug)]
pub struct DAModuleItemDataStruct {
#[br(pad_before = 17)]
pub module_level: PrimaryAssetNameProperty,
2025-02-19 19:34:13 -05:00
}
#[binrw]
#[derive(Debug)]
pub struct DABuildDataStruct {
pub unk: [u8; 17],
}
#[binrw]
#[derive(Debug)]
pub struct DAAssembleIdDataStruct {
pub unk: [u8; 17],
}
#[binrw]
#[derive(Debug)]
pub struct GuidStruct {
pub unk: [u8; 33],
}
#[binrw]
#[derive(Debug)]
pub struct DAMachineColoringDataStruct {
pub unk: [u8; 17],
}
#[binrw]
#[derive(Debug)]
pub struct DAModuleColorStruct {
pub unk: [u8; 17],
}
#[binrw]
#[derive(Debug)]
pub struct LinearColorStruct {
pub unk: [u8; 33],
}