diff --git a/game/scripts/doll/bodypart.rpy b/game/scripts/doll/bodypart.rpy index 72fe706b..2bdc3379 100644 --- a/game/scripts/doll/bodypart.rpy +++ b/game/scripts/doll/bodypart.rpy @@ -9,7 +9,7 @@ init 1 python: } def __init__(self, name, categories, type, id, zorder=None, unlocked=False, level=0, blacklist=[], parent=None, modpath=None): - super().__init__(name, categories, type, id, None, zorder, unlocked, level, blacklist, parent, modpath) + super().__init__(name, categories, type, id, None, zorder, unlocked, level, blacklist, modpath, parent) def __repr__(self): return f"DollBodypart(name={self.name}, categories={self.categories}, type={self.type}, id={self.id}, color={self.color}, zorder={self.zorder}, unlocked={self.unlocked}, level={self.level}, blacklist={self.blacklist}, parent={self.parent}, modpath={self.modpath or None})" diff --git a/game/scripts/doll/clothes.rpy b/game/scripts/doll/clothes.rpy index dbb34a79..287b08ac 100644 --- a/game/scripts/doll/clothes.rpy +++ b/game/scripts/doll/clothes.rpy @@ -69,7 +69,7 @@ init python: salt = str( [self.name, self.char.pose, self.type, self.id, str(self.color), str(self.char.body._hash)] ) return hash(salt) - @functools.cache + @functools.cache # <- TODO: Reevaluate if this function should allow multiple caches (aside from different subpaths) def get_layers(self, hash, subpath=""): path = posixpath.join(self.modpath, "characters", self.name, "poses", self.char.pose, subpath, "clothes", self.type, self.id) @@ -130,7 +130,7 @@ init python: else: layers.setdefault(ltype, [f, zorder]) - return layers + return dict(sorted(layers.items(), key=lambda x: (extract_number(x[0]), x[0]))) @functools.cache def build_image(self, hash, subpath="", matrix=None, maxsize=(1010, 1200)): diff --git a/game/scripts/utility/common_functions.rpy b/game/scripts/utility/common_functions.rpy index 20eefb75..cfe66436 100644 --- a/game/scripts/utility/common_functions.rpy +++ b/game/scripts/utility/common_functions.rpy @@ -224,4 +224,10 @@ init python early: return len(self._callable()) def execute_callbacks(callbacks): - for callback in callbacks: callback() \ No newline at end of file + for callback in callbacks: callback() + + def extract_number(key): + match = re.match(r'^(\d+)', key) + if match: + return int(match.group(1)) + return float('inf') # Return a large number for non-numeric keys diff --git a/game/scripts/utility/updater.rpy b/game/scripts/utility/updater.rpy index b00da8cc..e48a1589 100644 --- a/game/scripts/utility/updater.rpy +++ b/game/scripts/utility/updater.rpy @@ -1,7 +1,7 @@ init python: import requests - UPDATE_URL = bytes.fromhex("687474703a2f2f757064617465732e73696c76657273747564696f67616d65732e6f72672f6173736574732f757064617465732e6a736f6e").decode() + UPDATE_URL = bytes.fromhex("687474703a2f2f757064617465732e73696c76657273747564696f67616d65732e6f7267").decode() UPDATE_VER = None UPDATE_HINT = "" @@ -192,7 +192,7 @@ init python: return im.Data(data, path) # Fetch file if doesn't exist - url = url.split("updates.json")[0] + "logo.webp" + url = os.path.join(url.split("updates.json")[0], "logo.webp") try: response = requests.get(url, timeout=5)