From 66f8f5ab2880399faf40e0c1157c7ef9be75b7d9 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Tue, 26 Mar 2024 21:58:59 +0100 Subject: [PATCH] Avoid code duplication and using throwaway variables --- game/scripts/wardrobe/wardrobe.rpy | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/game/scripts/wardrobe/wardrobe.rpy b/game/scripts/wardrobe/wardrobe.rpy index 46002df2..04161228 100644 --- a/game/scripts/wardrobe/wardrobe.rpy +++ b/game/scripts/wardrobe/wardrobe.rpy @@ -638,22 +638,16 @@ screen wardrobe_menu(xx, yy): yspacing 18 for i, category in enumerate(wardrobe_categories): - if wardrobe_check_category(category): - $ icon = Fixed(icon_bg, Transform("interface/wardrobe/icons/categories/{}/{}.webp".format(states.active_girl, category), zoom=0.45, anchor=(0.5, 0.5), align=(0.5, 0.5)), icon_frame) - else: - $ icon = Fixed(icon_bg, Transform("interface/wardrobe/icons/categories/{}/{}.webp".format(states.active_girl, category), zoom=0.45, anchor=(0.5, 0.5), align=(0.5, 0.5), matrixcolor=SaturationMatrix(0.0)), icon_frame) - $ icon_xoffset = -18 if (i % 2) == 0 else 18 - button: focus_mask None xysize (72, 72) - background lock_wardrobe_icon(icon) + background lock_wardrobe_icon(Fixed(icon_bg, Transform(f"interface/wardrobe/icons/categories/{states.active_girl}/{category}.webp", zoom=0.45, anchor=(0.5, 0.5), align=(0.5, 0.5), matrixcolor=(IdentityMatrix() if wardrobe_check_category(category) else SaturationMatrix(0.0))), icon_frame)) activate_sound "sounds/scroll.ogg" tooltip category sensitive (not bool(DollThread._count)) action Return(["category", category]) if current_category == category: - xoffset icon_xoffset + xoffset -18 if (i % 2) == 0 else 18 # Outfits and Studio hbox: