From d503115899322e9b8bd835da82da3d6f74028bda Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 25 Mar 2025 15:42:38 +0100 Subject: set proper class name in pptr from all_toplevel --- src/assetbundle.rs | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/assetbundle.rs') diff --git a/src/assetbundle.rs b/src/assetbundle.rs index f87d7b8..3940628 100644 --- a/src/assetbundle.rs +++ b/src/assetbundle.rs @@ -77,7 +77,13 @@ impl AssetBundle { let main_obs = main .objects .iter() - .map(|o| (main.ecx.clone(), o.to_owned())) + .map(|o| { + ( + main.ecx.clone(), + main.get_object_type_tree(o).unwrap().type_string.to_owned(), + o.to_owned(), + ) + }) .collect::>(); let shared_obs = if let Some(shared_assets) = shared_assets { let shared = self.get_fs_file(&shared_assets).unwrap(); @@ -85,7 +91,17 @@ impl AssetBundle { shared .objects .iter() - .map(|o| (shared.ecx.clone(), o.to_owned())) + .map(|o| { + ( + shared.ecx.clone(), + shared + .get_object_type_tree(o) + .unwrap() + .type_string + .to_owned(), + o.to_owned(), + ) + }) .collect() } else { Vec::new() @@ -94,8 +110,8 @@ impl AssetBundle { main_obs .into_iter() .chain(shared_obs) - .map(|(ecx, o)| PPtr { - class: "".to_string(), + .map(|(ecx, class, o)| PPtr { + class, ecx, file_id: 0, path_id: o.path_id, @@ -127,7 +143,7 @@ impl AssetBundle { .into_iter() .chain(shared_obs) .map(|(ecx, o)| PPtr { - class: "".to_string(), + class: class_name.to_owned(), ecx, file_id: 0, path_id: o.path_id, -- cgit v1.2.3-70-g09d2