Skip to content

Commit

Permalink
fix: disable problematic parsers for 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cheahjs committed Jul 1, 2024
1 parent 7d3f804 commit 3860720
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 6 additions & 2 deletions palworld_save_tools/commands/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from palworld_save_tools.gvas import GvasFile
from palworld_save_tools.json_tools import CustomEncoder
from palworld_save_tools.palsav import compress_gvas_to_sav, decompress_sav_to_gvas
from palworld_save_tools.paltypes import PALWORLD_CUSTOM_PROPERTIES, PALWORLD_TYPE_HINTS
from palworld_save_tools.paltypes import (
DISABLED_PROPERTIES,
PALWORLD_CUSTOM_PROPERTIES,
PALWORLD_TYPE_HINTS,
)


def main():
Expand Down Expand Up @@ -44,7 +48,7 @@ def main():
)
parser.add_argument(
"--custom-properties",
default=",".join(PALWORLD_CUSTOM_PROPERTIES.keys()),
default=",".join(set(PALWORLD_CUSTOM_PROPERTIES.keys()) - DISABLED_PROPERTIES),
type=lambda t: [s.strip() for s in t.split(",")],
help="Comma-separated list of custom properties to decode, or 'all' for all known properties. This can be used to speed up processing by excluding properties that are not of interest. (default: all)",
)
Expand Down
10 changes: 9 additions & 1 deletion palworld_save_tools/commands/resave_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
convert_sav_to_json,
)
from palworld_save_tools.palsav import decompress_sav_to_gvas
from palworld_save_tools.paltypes import DISABLED_PROPERTIES, PALWORLD_CUSTOM_PROPERTIES


def main():
Expand All @@ -17,7 +18,14 @@ def main():
print(f"Testing if {input_path} is the same after resaving...")
output_json_path = input_path + ".resave.json"
output_sav_path = input_path + ".resave.sav"
convert_sav_to_json(input_path, output_json_path, minify=True)
convert_sav_to_json(
input_path,
output_json_path,
minify=True,
custom_properties_keys=list(
set(PALWORLD_CUSTOM_PROPERTIES.keys()) - DISABLED_PROPERTIES
),
)
convert_json_to_sav(output_json_path, output_sav_path)
print(f"Comparing {input_path} and {output_sav_path}...")
with open(input_path, "rb") as f:
Expand Down

0 comments on commit 3860720

Please sign in to comment.