Include z3pr's data files in the frozen package.
Warning: requires dev6 version of it
This commit is contained in:
parent
2096d6ae5b
commit
606f1fd4f8
4
Rom.py
4
Rom.py
|
@ -1501,10 +1501,12 @@ def apply_rom_settings(rom, beep, color, quickswap, fastmenu, disable_music, spr
|
|||
if any(options.values()):
|
||||
ColorF = z3pr.ColorF
|
||||
|
||||
data_dir = local_path("data") if is_bundled() else None
|
||||
|
||||
def next_color():
|
||||
return ColorF(local_random.random(), local_random.random(), local_random.random())
|
||||
|
||||
z3pr.randomize(rom.buffer, "maseya", next_color, options)
|
||||
z3pr.randomize(rom.buffer, "maseya", next_color, options, data_dir)
|
||||
else:
|
||||
logging.warning("Could not find z3pr palette shuffle. "
|
||||
"If you want improved palette shuffling please install the maseya-z3pr package.")
|
||||
|
|
12
setup.py
12
setup.py
|
@ -113,6 +113,16 @@ for data in extra_data:
|
|||
os.makedirs(buildfolder / "Players", exist_ok=True)
|
||||
shutil.copyfile("playerSettings.yaml", buildfolder / "Players" / "playerSettings.yaml")
|
||||
|
||||
try:
|
||||
from maseya import z3pr
|
||||
except ImportError:
|
||||
print("Maseya Palette Shuffle not found, skipping data files.")
|
||||
else:
|
||||
# maseya Palette Shuffle exists and needs its data files
|
||||
print("Maseya Palette Shuffle found, including data files...")
|
||||
file = z3pr.__file__
|
||||
installfile(Path(os.path.dirname(file)) / "data", keep_content=True)
|
||||
|
||||
qusb2sneslog = buildfolder / "QUsb2Snes" / "log.txt"
|
||||
if os.path.exists(qusb2sneslog):
|
||||
os.remove(qusb2sneslog)
|
||||
|
@ -120,7 +130,7 @@ if os.path.exists(qusb2sneslog):
|
|||
if signtool:
|
||||
for exe in exes:
|
||||
print(f"Signing {exe.targetName}")
|
||||
os.system(signtool+exe.targetName)
|
||||
os.system(signtool + exe.targetName)
|
||||
|
||||
|
||||
manifest_creation()
|
||||
|
|
Loading…
Reference in New Issue