From 697819b5bab6f7882ccdafc2801578c98266d976 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Sun, 16 Apr 2023 17:47:14 +0100 Subject: [PATCH] Bug fixes * Fixed and replaced getattr methods in some instances referencing character states * Fixed get_character_unlock, and get_character_mood referencing wrong var and store * Fixed lint self defining character tag instead of using a global func --- game/scripts/shops/dress/menu.rpy | 2 +- game/scripts/utility/lint.rpy | 2 +- game/scripts/wardrobe/functions.rpy | 4 ++-- game/scripts/wardrobe/studio.rpy | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/game/scripts/shops/dress/menu.rpy b/game/scripts/shops/dress/menu.rpy index eb2bb121..dd23c6c0 100644 --- a/game/scripts/shops/dress/menu.rpy +++ b/game/scripts/shops/dress/menu.rpy @@ -155,7 +155,7 @@ screen shop_dress_menu(): vbox: pos (6, 6) for category in category_items.keys(): - if getattr(renpy.store, category+"_unlocked"): + if get_character_unlock(category): $ icon = Fixed(icon_bg, Frame( Transform("interface/icons/head/{}.webp".format(category), fit="contain"), xysize=(42, 42), offset=(3, 3)), "interface/achievements/glass_iconbox.webp") vbox: diff --git a/game/scripts/utility/lint.rpy b/game/scripts/utility/lint.rpy index b8908495..cf704884 100644 --- a/game/scripts/utility/lint.rpy +++ b/game/scripts/utility/lint.rpy @@ -20,7 +20,7 @@ init -1 python: # Add images to linting list to avoid undefined errors for i in states.dolls: - prefix = "{}_main".format(i) + prefix = get_character_tag(i) renpy.lint.image_prefixes[prefix] = True nodes = [i for i in renpy.game.script.all_stmts if isinstance(i, (renpy.ast.Say, renpy.ast.Menu))] diff --git a/game/scripts/wardrobe/functions.rpy b/game/scripts/wardrobe/functions.rpy index 5fecad35..7251deaf 100644 --- a/game/scripts/wardrobe/functions.rpy +++ b/game/scripts/wardrobe/functions.rpy @@ -80,12 +80,12 @@ init -1 python: def get_character_unlock(key): if not key in states.dolls: raise KeyError("'{}' character is undefined.".format(key)) - return getattr(store, "{}_unlocked".format(key)) + return getattr(states, f"{key[:3]}").unlocked def get_character_mood(key): if not key in states.dolls: raise KeyError("'{}' character is undefined.".format(key)) - return getattr(store, "{}_mood".format(key[:3])) + return getattr(states, f"{key[:3]}").mood def get_outfit_score(outfit): """Returns outfit 'lewdness' score""" diff --git a/game/scripts/wardrobe/studio.rpy b/game/scripts/wardrobe/studio.rpy index 0cac3eba..edd411ef 100644 --- a/game/scripts/wardrobe/studio.rpy +++ b/game/scripts/wardrobe/studio.rpy @@ -317,7 +317,7 @@ screen studio(): vbox: for k, v in studio.drags.items(): $ active = (states.active_girl == k and v[1]) - $ unlocked = getattr(states, f"{k[:3]}").unlocked + $ unlocked = get_character_unlock(k) if not v[1]: $ action = [ SetDict(studio.drags[k], 1, True), Function(studio.drag_activated, [v[0]]), renpy.restart_interaction ]