Simplify that call

(cherry picked from commit b21e179df0)
This commit is contained in:
Gouvernathor 2023-11-14 22:55:30 +01:00 committed by LoafyLemon
parent 200760471f
commit 36578fdd67

View File

@ -25,7 +25,7 @@ label shop_dress_menu:
category_items = {"hermione": hermione.outfits, "tonks": tonks.outfits, "cho": cho.outfits, "luna": luna.outfits, "astoria": astoria.outfits, "susan": susan.outfits}
current_category = "hermione"
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)
menu_items = shop_dress_sortfilter((x for x in category_items.get(current_category, []) if (x.unlocked == False and x.price > 0 and x not in store_cart)), current_sorting)
current_item = next(iter(menu_items), None)
parcel_callbacks = []
@ -37,7 +37,7 @@ label shop_dress_menu:
if _choice[0] == "category":
$ current_category = _choice[1]
$ 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)
$ menu_items = shop_dress_sortfilter((x for x in category_items.get(current_category, []) if (x.unlocked == False and x.price > 0 and x not in store_cart)), current_sorting)
$ current_item = next(iter(menu_items), None)
elif _choice[0] == "buy":
show screen blktone
@ -51,7 +51,7 @@ label shop_dress_menu:
play sound "sounds/money.ogg"
$ game.gold -= _choice[1].price
$ store_cart.add(_choice[1])
$ 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)
$ menu_items = shop_dress_sortfilter((x for x in category_items.get(current_category, []) if (x.unlocked == False and x.price > 0 and x not in store_cart)), current_sorting)
$ current_item = next(iter(menu_items), None)
if len(store_cart) < 5: