Skip to content

Commit

Permalink
Merge pull request #87 from magicbear/objectification
Browse files Browse the repository at this point in the history
Reconstruct the whole PalEdit, i18n support, add characters, use GvasFile to improve performance
  • Loading branch information
EternalWraith authored Feb 11, 2024
2 parents f7924cc + 15afe4e commit f35a097
Show file tree
Hide file tree
Showing 11 changed files with 3,856 additions and 1,202 deletions.
2,655 changes: 1,523 additions & 1,132 deletions PalEdit.py

Large diffs are not rendered by default.

440 changes: 373 additions & 67 deletions PalInfo.py

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions SaveConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,38 @@ def main():
output_path = args.output
convert_json_to_sav(args.filename, output_path, args.force)

def convert_sav_to_obj(filename):
print(f"Decompressing sav file")
with open(filename, "rb") as f:
data = f.read()
raw_gvas, _ = decompress_sav_to_gvas(data)
print(f"Loading GVAS file")
gvas_file = GvasFile.read(raw_gvas, PALWORLD_TYPE_HINTS, PALWORLD_CUSTOM_PROPERTIES)
return gvas_file.dump()


def convert_obj_to_sav(obj, output_path, force=False):
if os.path.exists(output_path):
print(f"{output_path} already exists, this will overwrite the file")
if not force:
if not confirm_prompt("Are you sure you want to continue?"):
exit(1)
gvas_file = GvasFile.load(obj)
print(f"Compressing SAV file")
if (
"Pal.PalWorldSaveGame" in gvas_file.header.save_game_class_name
or "Pal.PalLocalWorldSaveGame" in gvas_file.header.save_game_class_name
):
save_type = 0x32
else:
save_type = 0x31
sav_file = compress_gvas_to_sav(
gvas_file.write(PALWORLD_CUSTOM_PROPERTIES), save_type
)
print(f"Writing SAV file to {output_path}")
with open(output_path, "wb") as f:
f.write(sav_file)


def convert_sav_to_json(filename, output_path, force=False, minify=False):
print(f"Converting {filename} to JSON, saving to {output_path}")
Expand Down
Binary file added resources/Ice Reptyro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f35a097

Please sign in to comment.