Skip to content

Commit 33d24e3

Browse files
committed
Remove requirement of using Python 3.10 and below
- I added a 'legacy mode' flag to revert HearthSim/UnityPack#101 as it caused problems on Rei - I tested the new setup (using custom unitypack) vs old one, and the output .asset files were bit-for-bit identical
1 parent bb2ac64 commit 33d24e3

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

build.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ def save(self):
274274
print(">>>> ERROR: This script does not work on Python 2.7")
275275
exit(-1)
276276

277-
if not (sys.version_info < (3, 11)):
278-
print(">>>> WARNING: This script probably does not work on Python 3.11 because unitypack uses old version of decrunch which does not build. Use Python 3.10 or below if you have this error.")
279-
280277
Globals.SEVEN_ZIP_EXECUTABLE = findWorkingExecutablePath(["7za", "7z"], ['-h'])
281278
if Globals.SEVEN_ZIP_EXECUTABLE is None:
282279
print(">>>> ERROR: Can't find 7zip as '7z' or '7za'")

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
numpy
22
Pillow
3-
unitypack
3+
unitypack @ git+https://github.com/drojf/UnityPack@master # custom build of unitypack which does not require 'decrunch'
4+
setuptools # required for unitypack or else get `pkg_resources` error

scripts/EMIPGenerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def generateHeader(numEdits):
185185
bundle = assetsFile.read()
186186
unityVersion = [int(x) for x in bundle[20:28].decode("utf-8").rstrip("\0").split(".")[:2]]
187187
assetsFile.seek(0)
188-
assets = Asset.from_file(assetsFile)
188+
assets = Asset.from_file(assetsFile, legacy_mode=True)
189189
for edit in edits:
190190
edit.getAssetInfo(assets, bundle)
191191
edits = [x for x in edits if x.id != None]

scripts/UnityTextModifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def __str__(self):
133133
edits = newEdits
134134

135135
assetsFile.seek(0)
136-
assets = Asset.from_file(assetsFile)
136+
assets = Asset.from_file(assetsFile, legacy_mode=True)
137137
for id, obj in assets.objects.items():
138138
for edit in edits:
139139
edit.checkObject(id, obj, bundle)

0 commit comments

Comments
 (0)