Bug fixes and callbacks

* Added parcel callback support for the outfit store
* Added execute_callback wrapper function
* Fixed ball quest item never unlocking after receiving the outfit, soft-locking the game
This commit is contained in:
LoafyLemon 2023-06-16 15:51:48 +01:00
parent 16443b47ae
commit d8601def73
3 changed files with 11 additions and 2 deletions

View File

@ -34,6 +34,8 @@ label purchase_outfit(item):
maf "As you wish sweetie... It should be ready shortly."
gen "Thank you." ("base", xpos="far_left", ypos="head")
elif item == her_outfit_ball:
$ parcel_callbacks.append(renpy.curry(setattr)(ball_outfit_ITEM, "owned", 1))
if not states.her.ev.yule_ball.e4_complete:
gen "Could you make a dress for me?" ("base", xpos="far_left", ypos="head")
maf "A dress? Do you mean something like a ball dress, or more burlesque?"

View File

@ -27,6 +27,7 @@ label shop_dress_menu:
store_cart = set()
menu_items = shop_dress_sortfilter([x for x in category_items.get(current_category, []) if bool(x.unlocked == False and x.price > 0 and not x in store_cart)], current_sorting)
current_item = next(iter(menu_items), None)
parcel_callbacks = []
show screen shop_dress()
@ -107,14 +108,17 @@ label shop_dress_menu:
$ _tmp = "tomorrow" if transit_time == 1 else "in about {} days".format(str(transit_time))
maf "You can expect a parcel [_tmp]."
$ Parcel(contents=[(k, 1) for k in store_cart], wait=transit_time).send()
# Executes callbacks upon receival of the parcel.
$ curry = renpy.curry(execute_callbacks)(parcel_callbacks) if parcel_callbacks else None
$ parcel_callbacks = []
$ Parcel(contents=[(k, 1) for k in store_cart], wait=transit_time, func=curry).send()
return
else:
gen "Nothing has caught my eye I'm afraid." ("base", xpos="far_left", ypos="head")
maf "Maybe next time."
return
jump .after_init
screen shop_dress():

View File

@ -222,3 +222,6 @@ init python early:
def __len__(self):
return len(self._callable())
def execute_callbacks(callbacks):
[callback() for callback in callbacks]