diff --git a/game/scripts/utility/punk.rpy b/game/scripts/utility/punk.rpy index 75ce236c..1a7eefce 100644 --- a/game/scripts/utility/punk.rpy +++ b/game/scripts/utility/punk.rpy @@ -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: diff --git a/game/scripts/wardrobe/functions.rpy b/game/scripts/wardrobe/functions.rpy index 6c0dc6a0..ea972f46 100644 --- a/game/scripts/wardrobe/functions.rpy +++ b/game/scripts/wardrobe/functions.rpy @@ -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))