From 710400f2cefe180952c3becdf84e53cffbfc0e4b Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:14:33 +0100 Subject: [PATCH] Repr instead of adding simple quotes manually it's a tad slower but it's a better general practice and we're in an error handling branch anyway --- game/scripts/wardrobe/functions.rpy | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/game/scripts/wardrobe/functions.rpy b/game/scripts/wardrobe/functions.rpy index 92fd77ea..dc56eaa4 100644 --- a/game/scripts/wardrobe/functions.rpy +++ b/game/scripts/wardrobe/functions.rpy @@ -1,45 +1,45 @@ init -1 python: def get_character_progression(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(states, f"{key[:3]}").level def get_character_scheduling(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(states, f"{key[:3]}").wardrobe_scheduling def get_character_requirement(key, type): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(renpy.store, key[:3]+"_requirements").get(type, 0) def get_character_response(key, type): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(renpy.store, key[:3]+"_responses").get(type) def get_character_object(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(store, key) def get_character_outfit(key, type="default"): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(store, "{}_outfit_{}".format(key[:3], type)) def get_character_body(key, type="default"): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(store, "{}_body_{}".format(key[:3], type)) def get_character_outfit_req(key, item): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) if not isinstance(item, DollOutfit): - raise TypeError("'{}' is not a DollOutfit instance.".format(item)) + raise TypeError("{!r} is not a DollOutfit instance.".format(item)) req = ["{}: {}".format(i.type, i.level) for i in item.group] has_bra = any(i.type == "bra" for i in item.group) @@ -54,42 +54,42 @@ init -1 python: def get_character_tag(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return "{}_main".format(key) def get_character_sayer(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(store, key[:3]) def get_character_gift_label(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return "give_{}_gift".format(key[:3]) def get_character_potion_check_label(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return "{}_potion_check".format(key[:3]) def get_character_potion_check(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(store, "{}_potion_check".format(key[:3])) def get_character_unlock(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(states, f"{key[:3]}").unlocked def get_character_gifted(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(states, f"{key[:3]}").gifted def get_character_mood(key): if not key in states.dolls: - raise KeyError("'{}' character is undefined.".format(key)) + raise KeyError("{!r} character is undefined.".format(key)) return getattr(states, f"{key[:3]}").mood def get_outfit_score(outfit):