Skip to content

Commit

Permalink
create_vfs needs index
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Blume committed Jul 30, 2024
1 parent 8e37ba7 commit 2e2ff43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wgrd_cons_tools/create_vfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ def create_vfs(dat_file_paths: list[str], vfs_dict: dict[str, pathlib.Path] = No
if vfs_dict is None:
vfs_dict = {}

idx = 0
for filepath in dat_file_paths:
print(f"parsing {filepath}")
data = EDat.parse_file(filepath, _cons_xml_filesdictionary_parse_files=False)
for vfspath, meta in data.files.items():
vfs_dict[vfspath] = (os.path.abspath(filepath), meta.offset + data.offset_data, meta.size, meta.checksum)
vfs_dict[vfspath] = (os.path.abspath(filepath), meta.offset + data.offset_data, meta.size, meta.checksum, idx)
idx += 1

return vfs_dict

Expand Down

0 comments on commit 2e2ff43

Please sign in to comment.