Bug fixes

* Fixed mixed paths in outfit import feature
* Fixed paths in outfit import feature
* Fixed missing imports
This commit is contained in:
LoafyLemon 2024-03-30 19:20:46 +00:00
parent 7164a782e7
commit e93aa18285
2 changed files with 8 additions and 5 deletions

View File

@ -8,6 +8,7 @@ init python in image_payload:
import binascii
import struct
import zlib
import os
CHUNK_TYPE_END = "IEND"
CHUNK_TYPE_PUNK = "wtSi"
@ -74,7 +75,7 @@ init python in image_payload:
print("Chunk injected!")
def list(input):
path = os.path.join(config.gamedir, "outfits", input)
path = os.path.join(renpy.config.gamedir, "outfits", input)
with open(path, "rb") as input_file:
@ -90,8 +91,8 @@ init python in image_payload:
return
def inject(input, output, content):
input_path = os.path.join(config.gamedir, "outfits", input)
output_path = os.path.join(config.gamedir, "outfits", output)
input_path = os.path.join(renpy.config.gamedir, "outfits", input)
output_path = os.path.join(renpy.config.gamedir, "outfits", output)
content = zlib.compress(str(content).encode())
with open(input_path, "rb") as input_file, open(output_path, "wb") as output_file:
@ -117,7 +118,7 @@ init python in image_payload:
def extract(input):
print("Attempting to extract punked data from", input)
path = os.path.join(config.gamedir, "outfits", input)
path = os.path.join(renpy.config.gamedir, input)
with open(path, "rb") as input_file:

View File

@ -1,4 +1,6 @@
init -1 python:
import os
def __check_exists(key):
if not key in states.dolls:
raise KeyError(f"{key!r} character is undefined.")
@ -179,7 +181,7 @@ init -1 python:
files = []
for f in os.listdir(path):
fp = os.path.join(path, f)
rp = os.path.relpath(fp, config.gamedir)
rp = os.path.relpath(fp, config.gamedir).replace("\\", "/")
if os.path.isfile(os.path.join(path, f)) and f.endswith(".png"):
files.append(build_button(rp))