diff --git a/src/lib.rs b/src/lib.rs index 8d48ee7..5d55e48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,12 @@ mod common; + +/// Properties pub mod property; + +/// Top-level save objects pub mod save_object; + +/// Various structures pub mod structure; use binrw::helpers::until_eof; diff --git a/src/property/array_property.rs b/src/property/array_property.rs index c484759..0236b62 100644 --- a/src/property/array_property.rs +++ b/src/property/array_property.rs @@ -142,6 +142,8 @@ fn calc_key_data_size_in_bytes(key_data: &ArrayKeyData) -> u32 { } /// An array. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UArrayProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct ArrayProperty { diff --git a/src/property/bool_property.rs b/src/property/bool_property.rs index b09dfc5..b459d91 100644 --- a/src/property/bool_property.rs +++ b/src/property/bool_property.rs @@ -4,6 +4,8 @@ use binrw::binrw; use super::PropertyBase; /// A boolean. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UBoolProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct BoolProperty { diff --git a/src/property/enum_property.rs b/src/property/enum_property.rs index 047278c..5c567ee 100644 --- a/src/property/enum_property.rs +++ b/src/property/enum_property.rs @@ -4,6 +4,8 @@ use binrw::binrw; use super::PropertyBase; /// A enum. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UEnumProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct EnumProperty { diff --git a/src/property/float_property.rs b/src/property/float_property.rs index 440d0dd..2fee530 100644 --- a/src/property/float_property.rs +++ b/src/property/float_property.rs @@ -3,6 +3,8 @@ use binrw::binrw; use super::PropertyBase; /// A float. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UFloatProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct FloatProperty { diff --git a/src/property/int_property.rs b/src/property/int_property.rs index feead97..f11f8cb 100644 --- a/src/property/int_property.rs +++ b/src/property/int_property.rs @@ -3,6 +3,8 @@ use binrw::binrw; use super::PropertyBase; /// A integer. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UIntProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct IntProperty { diff --git a/src/property/map_property.rs b/src/property/map_property.rs index d340a04..7caadfc 100644 --- a/src/property/map_property.rs +++ b/src/property/map_property.rs @@ -271,6 +271,8 @@ fn calc_entry_size_in_bytes(prop: &MapProperty) -> u32 { } /// A map. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UMapProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct MapProperty { diff --git a/src/property/name_property.rs b/src/property/name_property.rs index 0524ca4..6c19d16 100644 --- a/src/property/name_property.rs +++ b/src/property/name_property.rs @@ -4,6 +4,8 @@ use binrw::binrw; use super::PropertyBase; /// A name. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UNameProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct NameProperty { diff --git a/src/property/set_property.rs b/src/property/set_property.rs index 9577699..28acf72 100644 --- a/src/property/set_property.rs +++ b/src/property/set_property.rs @@ -73,6 +73,8 @@ fn custom_parser( } /// A set. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/USetProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct SetProperty { diff --git a/src/property/str_property.rs b/src/property/str_property.rs index 38a89ad..2053544 100644 --- a/src/property/str_property.rs +++ b/src/property/str_property.rs @@ -4,6 +4,8 @@ use binrw::binrw; use super::PropertyBase; /// A string. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UStrProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct StrProperty { diff --git a/src/property/struct_property.rs b/src/property/struct_property.rs index 5f10b45..32b5ff3 100644 --- a/src/property/struct_property.rs +++ b/src/property/struct_property.rs @@ -5,6 +5,8 @@ use crate::{ use binrw::binrw; /// A structure. +/// +/// See [the Unreal Engine documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/CoreUObject/UObject/UStructProperty?application_version=4.27). #[binrw] #[derive(Debug)] pub struct StructProperty { diff --git a/src/save_object/localprofile.rs b/src/save_object/localprofile.rs index bfb7646..fe79a5d 100644 --- a/src/save_object/localprofile.rs +++ b/src/save_object/localprofile.rs @@ -1,8 +1,9 @@ use crate::property::{BoolProperty, IntProperty, StrProperty, map_property::MapProperty}; -#[paramacro::serialized_struct("Transform")] +/// The object stored in `LocalProfile.sav`. +#[paramacro::serialized_struct("")] #[derive(Debug)] -pub struct LocalProfile { +pub struct LocalProfileObject { #[paramacro::serialized_field = "SavedDataVersion"] version: IntProperty, diff --git a/src/save_object/mod.rs b/src/save_object/mod.rs index 9e01196..afccea6 100644 --- a/src/save_object/mod.rs +++ b/src/save_object/mod.rs @@ -1,4 +1,10 @@ pub mod generic; -pub mod localprofile; -pub mod persistent; -pub mod slot; + +mod localprofile; +pub use self::localprofile::LocalProfileObject; + +mod persistent; +pub use self::persistent::PersistentObject; + +mod slot; +pub use self::slot::SlotObject; diff --git a/src/save_object/persistent.rs b/src/save_object/persistent.rs index 93f7d90..52a253a 100644 --- a/src/save_object/persistent.rs +++ b/src/save_object/persistent.rs @@ -1,5 +1,3 @@ -use binrw::binrw; - use crate::{ property::{ BoolProperty, IntProperty, NameProperty, StrProperty, array_property::ArrayProperty, @@ -8,9 +6,10 @@ use crate::{ structure::{DABuildDataStruct, DATuningPointData, TransformStruct}, }; -#[paramacro::serialized_struct("Transform")] +/// The object stored in `Persistent.sav`. +#[paramacro::serialized_struct("")] #[derive(Debug)] -pub struct Persistent { +pub struct PersistentObject { #[paramacro::serialized_field = "SavedDataVersion"] version: IntProperty, @@ -101,11 +100,3 @@ pub struct Persistent { #[paramacro::serialized_field = "bUseSaveSlot"] use_save_slot: BoolProperty, } - -#[binrw] -#[derive(Debug)] -pub struct PersistentObject { - pub size_in_bytes: u32, - #[br(pad_after = 4)] - pub profile: Persistent, -} diff --git a/src/save_object/slot.rs b/src/save_object/slot.rs index a2e303f..019dacd 100644 --- a/src/save_object/slot.rs +++ b/src/save_object/slot.rs @@ -3,9 +3,10 @@ use crate::{ structure::{DALoadOptionStruct, DateTimeStruct, SaveSlotInfoStruct}, }; -#[paramacro::serialized_struct("Transform")] +/// The object stored in `Slot.sav`. +#[paramacro::serialized_struct("")] #[derive(Debug)] -pub struct Slot { +pub struct SlotObject { #[paramacro::serialized_field = "SavedDataVersion"] version: IntProperty,