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
This commit is contained in:
LoafyLemon 2023-04-16 17:47:14 +01:00
parent 6409b2b7d8
commit 697819b5ba
4 changed files with 5 additions and 5 deletions

View File

@ -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:

View File

@ -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))]

View File

@ -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"""

View File

@ -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 ]