
label coxClothingOptions(listClothing, mom_say="What to wear?", isStore=False, isBase=False, thePerson=mom): # If isStore is False, returns what the closet, or any other similar cloth choice needs. If True, returns what the store needs. codeBlc
                                                                                              # If isBase is true, it skips over hair styles other than the standard down ones, as when deciding base hair, we only care about the texture swap, the style has no impact
    python:
        renpy.dynamic("formatted_options", "the_choice", "choice_instance") # makes named variables local to the label
        formatted_options = []
        
        for the_clothing in listClothing:
            if isStore and the_clothing.in_store():
                if the_clothing.corruption_requirement > 0:
                    # Manually writing in the requirements, so you can try it on anyway. Only way to actually see products, after all. 
                    formatted_options.append((the_clothing.name+" {image=UI/UIHeart.png}"+str(the_clothing.corruption_requirement)+" $"+str(the_clothing.price), the_clothing))
                else:
                    formatted_options.append((the_clothing.name+" $"+str(the_clothing.price), the_clothing))
                    
            elif not isStore and the_clothing.in_closet() and isBase:
                if the_clothing.force_hair_num is None or the_clothing.force_hair_num == 0:
                    if the_clothing.corruption_requirement > 0:
                        formatted_options.append((the_clothing.name+" {image=UI/UIHeart.png}[the_clothing.corruption_requirement]", the_clothing))
                    else:
                        formatted_options.append((the_clothing.name, the_clothing))
                    
            elif not isStore and the_clothing.in_closet():
                if the_clothing.corruption_requirement > 0:
                    formatted_options.append((the_clothing.name+" {image=UI/UIHeart.png}[the_clothing.corruption_requirement]", the_clothing))
                else:
                    formatted_options.append((the_clothing.name, the_clothing))
        
        if listClothing is lListRemoval:
            if thePerson is mom:
                formatted_options.append(("Toggle Breast Lift", "BoobLift"))
            elif thePerson is cheerleader:
                formatted_options.append(("Toggle Thigh Pinch", "ThighPinch"))
        
        formatted_options.append(("{b}*Back*{/b}", "Back"))
        
        if mom_say:
            mom(mom_say, interact=False)
            
        the_choice = renpy.display_menu(formatted_options)
    return the_choice   #endBlc


label coxDefaultShoesMenu():
    python:
        renpy.dynamic("formatted_options", "the_choice", "footwearlist")
        formatted_options = []
        
        footwearlist = lListShoes + lListBoots
        
        formatted_options.append((coxNoShoes.name, coxNoShoes))
        for theshoes in footwearlist:
            formatted_options.append((theshoes.name, theshoes))
        
        formatted_options.append(("{b}*Back*{/b}", "Back"))
        mom("Perhaps I should should just wear some shoes by default?", interact=False)
        the_choice = renpy.display_menu(formatted_options)
    return the_choice

label coxClothingCategoryMenu(sCategory="", mom_say="What should I wear?", isStore=False):      #codeBlc
    
    python:
        renpy.dynamic("formatted_options", "the_choice")
        
        if sCategory == "Bras":
            formatted_options = [   ("Bras ("+str(coxEligibleListLen(listClothing=lListBras, inStore=isStore))+")", "Bras"),
                                    ("Half-cup Bras ("+str(coxEligibleListLen(listClothing=lListHalfCupBras, inStore=isStore))+")", "HalfCupBras"),
                                    ("Exotic Bras ("+str(coxEligibleListLen(listClothing=lListExoticBras, inStore=isStore))+")", "ExoticBras"),
                                    ("Négligées, Babydolls, etc. ("+str(coxEligibleListLen(listClothing=lListNegligees, inStore=isStore))+")", "Negligees"),
                                    ("Corsets, Bustiers, and Waist Cinchers ("+str(coxEligibleListLen(listClothing=lListCorsets, inStore=isStore))+")", "Corsets")]
            
        elif sCategory == "Panties":
            formatted_options = [   ("Panties ("+str(coxEligibleListLen(listClothing=lListPanties, inStore=isStore))+")", "Panties"),
                                    ("Thongs ("+str(coxEligibleListLen(listClothing=lListThongs, inStore=isStore))+")", "Thongs"),
                                    ("Floss ("+str(coxEligibleListLen(listClothing=lListFloss, inStore=isStore))+")", "Floss")]
            
        elif sCategory == "Swimwear":
            formatted_options = [   ("Bikini Tops ("+str(coxEligibleListLen(listClothing=lListBikiniTops, inStore=isStore))+")", "BikiniTops"),
                                    ("Micro Bikini Tops ("+str(coxEligibleListLen(listClothing=lListMicroBikiniTops, inStore=isStore))+")", "MicroBikiniTops"),
                                    ("Bikini Bottoms ("+str(coxEligibleListLen(listClothing=lListBikiniBottoms, inStore=isStore))+")", "BikiniBottoms"),
                                    ("Micro Bikini Bottoms ("+str(coxEligibleListLen(listClothing=lListMicroBikiniBottoms, inStore=isStore))+")", "MicroBikiniBottoms"),
                                    ("One-piece Swimsuits ("+str(coxEligibleListLen(listClothing=lListSwimsuits, inStore=isStore))+")", "Swimsuits"),
                                    ("Monokinis and Slingshot Bikinis ("+str(coxEligibleListLen(listClothing=lListMonokinis, inStore=isStore))+")", "Monokinis")]
            
        elif sCategory == "Tops":
            formatted_options = [   ("Sweaters and Sleeved Tops ("+str(coxEligibleListLen(listClothing=lListSleevedTops, inStore=isStore))+")", "SleevedTops"),
                                    ("Tank Tops ("+str(coxEligibleListLen(listClothing=lListTankTops, inStore=isStore))+")", "TankTops"),
                                    ("Off-shoulder and Tube Tops ("+str(coxEligibleListLen(listClothing=lListTubeTops, inStore=isStore))+")", "TubeTops"),
                                    ("Halter-neck Tops ("+str(coxEligibleListLen(listClothing=lListHalterTops, inStore=isStore))+")", "HalterTops"),
                                    ("Crop Tops ("+str(coxEligibleListLen(listClothing=lListCropTops, inStore=isStore))+")", "CropTops"),
                                    ("Blouses and Shirts ("+str(coxEligibleListLen(listClothing=lListShirts, inStore=isStore))+")", "Shirts"),
                                    ("Asymmetric Tops ("+str(coxEligibleListLen(listClothing=lListAsymmetricTops, inStore=isStore))+")", "AsymmetricTops")]
            
        elif sCategory == "Pants":
            formatted_options = [   ("Pants ("+str(coxEligibleListLen(listClothing=lListPants, inStore=isStore))+")", "Pants"),
                                    ("Leggings ("+str(coxEligibleListLen(listClothing=lListLeggings, inStore=isStore))+")", "Leggings"),
                                    ("Shorts ("+str(coxEligibleListLen(listClothing=lListShorts, inStore=isStore))+")", "Shorts"),
                                    ("Hotpants ("+str(coxEligibleListLen(listClothing=lListHotpants, inStore=isStore))+")", "Hotpants")]
            
        elif sCategory == "Skirts":
            formatted_options = [   ("Long Skirts ("+str(coxEligibleListLen(listClothing=lListSkirtsLong, inStore=isStore))+")", "LongSkirts"),
                                    ("Miniskirts ("+str(coxEligibleListLen(listClothing=lListSkirtsMini, inStore=isStore))+")", "MiniSkirts"),
                                    ("Microskirts ("+str(coxEligibleListLen(listClothing=lListSkirtsMicro, inStore=isStore))+")", "MicroSkirts"),
                                    ("High-waist and Under-bust Skirts ("+str(coxEligibleListLen(listClothing=lListSkirtsUnderBust, inStore=isStore))+")", "UnderBustSkirts")]
        
        elif sCategory == "Dresses":
            formatted_options = [   ("Long Dresses and Gowns ("+str(coxEligibleListLen(listClothing=lListDressesLong, inStore=isStore))+")", "LongDresses"),
                                    ("Miniresses ("+str(coxEligibleListLen(listClothing=lListDressesMini, inStore=isStore))+")", "MiniDresses"),
                                    ("Microdresses ("+str(coxEligibleListLen(listClothing=lListDressesMicro, inStore=isStore))+")", "MicroDresses")]
            
        elif sCategory == "Footwear":
            formatted_options = [   ("Hoisery ("+str(coxEligibleListLen(listClothing=lListHoisery, inStore=isStore))+")", "Hoisery"),
                                    ("Shoes ("+str(coxEligibleListLen(listClothing=lListShoes, inStore=isStore))+")", "Shoes"),
                                    ("Boots ("+str(coxEligibleListLen(listClothing=lListBoots, inStore=isStore))+")", "Boots")]
            
        elif sCategory == "Accessories":
            formatted_options = [   ("Accessories ("+str(coxEligibleListLen(listClothing=lListAccessories, inStore=isStore))+")", "Accessories"),
                                    ("Chokers, Collars, and Necklaces ("+str(coxEligibleListLen(listClothing=lListNecklaces, inStore=isStore))+")", "Necklaces"),
                                    ("Eyeshadow ("+str(coxEligibleListLen(listClothing=lListEyeshadow, inStore=isStore))+")", "Eyeshadow"),
                                    ("Blush ("+str(coxEligibleListLen(listClothing=lListBlush, inStore=isStore))+")", "Blush"),
                                    ("Lipstick ("+str(coxEligibleListLen(listClothing=lListLipstick, inStore=isStore))+")", "Lipstick"),
                                    ("Miscellaneous ("+str(coxEligibleListLen(listClothing=lListMisc, inStore=isStore))+")", "Misc")]
            
        elif sCategory == "Body":
            formatted_options = [   ("Hairstyles and Dye ("+str(coxEligibleListLen(listClothing=lListHair, inStore=isStore))+")", "Hair"),
                                    ("Coloured Eye Contacts ("+str(coxEligibleListLen(listClothing=lListEyes, inStore=isStore))+")", "Eyes")]
            if coxPiercingsUnlocked:
                formatted_options.append(("Piercings ("+str(coxEligibleListLen(listClothing=lListFacePiercings+lListNipplePiercings+lListOtherPiercings, inStore=isStore))+")", "Piercings"))
            if coxTattoosUnlocked:
                formatted_options.append(("Tattoos ("+str(coxEligibleListLen(listClothing=lListTattoos, inStore=isStore))+")", "Tattoos"))
            formatted_options.extend([("Skins ("+str(coxEligibleListLen(listClothing=lListSkins, inStore=isStore))+")", "Skins"),
                                      ("Nipple Surgery ("+str(coxEligibleListLen(listClothing=lListNipples, inStore=isStore))+")", "Nipples")])
            if not isStore:
                formatted_options.append(("Water ("+str(coxEligibleListLen(listClothing=lListWater+lListWaterHair, inStore=isStore))+")", "Water"))
        
        elif sCategory == "Piercings":
            formatted_options = [   ("Facial Piercings ("+str(coxEligibleListLen(listClothing=lListFacePiercings, inStore=isStore))+")", "FacePiercings"),
                                    ("Nipple Piercings ("+str(coxEligibleListLen(listClothing=lListNipplePiercings, inStore=isStore))+")", "NipplePiercings"),
                                    ("Other Piercings ("+str(coxEligibleListLen(listClothing=lListOtherPiercings, inStore=isStore))+")", "OtherPiercings")]
        
        elif sCategory == "Water":
            formatted_options = [   ("Water(Skin) ("+str(coxEligibleListLen(listClothing=lListWater, inStore=isStore))+")", "WaterSkin"),
                                    ("Water(Hair) ("+str(coxEligibleListLen(listClothing=lListWaterHair, inStore=isStore))+")", "WaterHair")]
                                    
        elif sCategory == "CheerClothes":
            formatted_options = [   ("Bras ("+str(coxEligibleListLen(listClothing=lListCheerBras, inStore=isStore))+")", lListCheerBras),
                                    ("Panties ("+str(coxEligibleListLen(listClothing=lListCheerPanties, inStore=isStore))+")", lListCheerPanties),
                                    ("Tops ("+str(coxEligibleListLen(listClothing=lListCheerTops, inStore=isStore))+")", lListCheerTops),
                                    ("Skirts ("+str(coxEligibleListLen(listClothing=lListCheerSkirts, inStore=isStore))+")", lListCheerSkirts),
                                    ("Hoisery ("+str(coxEligibleListLen(listClothing=lListCheerHoisery, inStore=isStore))+")", lListCheerHoisery),
                                    ("Footwear ("+str(coxEligibleListLen(listClothing=lListCheerFootwear, inStore=isStore))+")", lListCheerFootwear),
                                    ("Accessories ("+str(coxEligibleListLen(listClothing=lListCheerAccessories, inStore=isStore))+")", lListCheerAccessories)]
                                    
        elif sCategory == "CheerBody":
            formatted_options = [   ("Hairstyles ("+str(coxEligibleListLen(listClothing=lListCheerHair, inStore=isStore))+")", lListCheerHair),
                                    ("Coloured Eye Contacts ("+str(coxEligibleListLen(listClothing=lListCheerEyes, inStore=isStore))+")", lListCheerEyes),
                                    ("Make-up ("+str(coxEligibleListLen(listClothing=lListCheerMakeup, inStore=isStore))+")", lListCheerMakeup),
                                    ("Skins ("+str(coxEligibleListLen(listClothing=lListCheerSkin, inStore=isStore))+")", lListCheerSkin),
                                    ("Nipples ("+str(coxEligibleListLen(listClothing=lListCheerNipples, inStore=isStore))+")", lListCheerNipples)]
            
        formatted_options.append(("{b}*Back*{/b}", "Back"))
        
        if mom_say:
            mom(mom_say, interact=False)
        the_choice = renpy.display_menu(formatted_options)
    return the_choice

#endBlc

label coxTryOn(oClothing=None, thePerson=mom, isStore=False):
    
    if oClothing is None:
        return
    
    if isStore and thePerson is mom and mom.corruption_level >= 7 and not mom.has_corruption_tag("coxStoreNudity") and not mom.has_outfit_tag("Nude"):
        $ mom.make_nude()
        "You get naked to try on the clothing, not caring if Ms. [CarinaCox.last_name] sees you, or the small chance that someone might barge in on you, in this back room."
        "Actually, that might be exciting, instead."
        "[CarinaCox.first_name] whistles at you."
        CarinaCox "You go, girl!"
        "You give an amused smile as you try out your chosen product."
        $ mom.add_corruption_tag("coxStoreNudity")
    elif isStore and thePerson is mom and not mom.has_corruption_tag("coxStoreNudity") and not mom.has_outfit_tag("Nude"):
        "You quickly move behind a folding screen. There's a large mirror for you to inspect yourself."
        $ mom.make_nude()
        "You undress yourself, before trying on the product."
    elif isStore and thePerson is mom:
        $ mom.make_nude()
    elif isStore and thePerson is not mom and not coxImaginative:
        "You imagine [thePerson.first_name], and what she would look like trying this on."
        $ thePerson.make_nude()
        call npc_display(thePerson)
        mom "Okay, let's skip to the part where they're trying on the clothes, imagination..."
    elif isStore and thePerson is not mom and coxImaginative:
        $ thePerson.make_nude()
        call npc_display(thePerson)
    
    if isStore:
        $ coxSetNudeCurrent(oPerson=thePerson)
    $ coxCurrentOutfit = coxChangeClothing(oClothing=oClothing, oOutfit=coxCurrentOutfit, oPerson=thePerson)
    $ thePerson.apply_outfit(coxCurrentOutfit)
    return

label coxSaveLoadMenu(listSlots=lListSaveSlots, listClothing=lListCurrent, thePerson=mom, mom_say="Let me set these clothes aside somewhere...", toDefault=False, isSaving=True, toExtended=False):
    
    python:
        renpy.dynamic("corr", "formatted_options", "choice_instance", "theCount", "SlotName")
        formatted_options = []
        theCount = 0 # AH, AH, AHHH
        
        if toDefault and isSaving and thePerson is mom and not coxExtendCasual and not toExtended:
            choice_instance = renpy.ui.ChoiceReturn("Default Daily Outfit", "Daily", kwargs = {"corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_CASUAL)})
            formatted_options.append((choice_instance.label, choice_instance))
            
            choice_instance = renpy.ui.ChoiceReturn("Default Work Outfit", "Work", kwargs = {"corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_WORK)})
            formatted_options.append((choice_instance.label, choice_instance))
            
            choice_instance = renpy.ui.ChoiceReturn("Default Swimwear Outfit", "Swimwear", kwargs = {"corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_SWIMWEAR)})
            formatted_options.append((choice_instance.label, choice_instance))
            
            choice_instance = renpy.ui.ChoiceReturn("Default Workout Outfit", "Workout", kwargs = {"corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_GYM)})
            formatted_options.append((choice_instance.label, choice_instance))
        
        elif toDefault and isSaving and thePerson is mom and coxExtendCasual and not toExtended:
            formatted_options.append(("Default Daily Outfit", "ExtendedCasual"))
            
            choice_instance = renpy.ui.ChoiceReturn("Default Work Outfit", "Work", kwargs = {"corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_WORK)})
            formatted_options.append((choice_instance.label, choice_instance))
            
            choice_instance = renpy.ui.ChoiceReturn("Default Swimwear Outfit", "Swimwear", kwargs = {"corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_SWIMWEAR)})
            formatted_options.append((choice_instance.label, choice_instance))
            
            choice_instance = renpy.ui.ChoiceReturn("Default Workout Outfit", "Workout", kwargs = {"corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_GYM)})
            formatted_options.append((choice_instance.label, choice_instance))
        
        elif toDefault and isSaving and thePerson is cheerleader:
            choice_instance = renpy.ui.ChoiceReturn("Default Home Outfit", "Home", kwargs = {"npc_requirement":cheerleader, "npc_corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_CHEER_HOME)})
            formatted_options.append((choice_instance.label, choice_instance))
            
            choice_instance = renpy.ui.ChoiceReturn("Default School Outfit", "School", kwargs = {"npc_requirement":cheerleader, "npc_corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_CHEER_SCHOOL)})
            formatted_options.append((choice_instance.label, choice_instance))
        
        elif toDefault and isSaving and thePerson is firebrand:
            choice_instance = renpy.ui.ChoiceReturn((str(theCount).zfill(2)+": "+OutfitSlot.set_name), OutfitSlot, kwargs={"npc_requirement":firebrand, "npc_corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_FIRE)})
        
        elif toDefault and isSaving and thePerson is busty:
            choice_instance = renpy.ui.ChoiceReturn((str(theCount).zfill(2)+": "+OutfitSlot.set_name), OutfitSlot, kwargs={"npc_requirement":busty, "npc_corruption_requirement":coxCalcCorruption(listClothing, CONST_OUTFIT_BUSTY)})
        
        elif isSaving and not toDefault and not toExtended:
            for OutfitSlot in listSlots:
                theCount += 1
                formatted_options.append((str(theCount).zfill(2)+": "+OutfitSlot.set_name, OutfitSlot))
                
        elif isSaving and toDefault and toExtended and thePerson is mom:
            for OutfitSlot in listSlots:
                corr = coxCalcCorruption(listClothing, CONST_OUTFIT_CASUAL)
                if theCount == 0:
                    SlotName = "Home, Early: "+OutfitSlot.set_name
                    corr = 0 if corr < 1 else corr-1
                if theCount == 1:
                    SlotName = "Home, Morning: "+OutfitSlot.set_name
                if theCount == 2:
                    SlotName = "Home, Noon: "+OutfitSlot.set_name
                if theCount == 3:
                    SlotName = "Home, Evening: "+OutfitSlot.set_name
                if theCount == 4:
                    SlotName = "Home, Night: "+OutfitSlot.set_name
                    corr = 0 if corr < 1 else corr-1
                if theCount == 5:
                    SlotName = "Shopping: "+OutfitSlot.set_name
                if theCount == 6:
                    SlotName = "Church: "+OutfitSlot.set_name
                    if coxPlusOneChurch:
                        corr = corr+1 if corr > 0 else 0
                if theCount == 7:
                    corr = coxCalcCorruption(listClothing, CONST_OUTFIT_WORK)
                    SlotName = "Casual Friday: "+OutfitSlot.set_name
                    corr = 0 if corr < 1 else corr-1
                choice_instance = renpy.ui.ChoiceReturn(SlotName, OutfitSlot, kwargs={"corruption_requirement":corr})
                formatted_options.append((choice_instance.label, choice_instance))
                theCount +=1
        elif not isSaving:
            for OutfitSlot in listSlots:
                theCount += 1
                if OutfitSlot.check_visible():
                    formatted_options.append((str(theCount).zfill(2)+": "+OutfitSlot.set_name, OutfitSlot))
        
        formatted_options.append(("{b}*Back*{/b}", "Back"))
        
        if mom_say:
            mom(mom_say, interact=False)
        the_choice = renpy.display_menu(formatted_options)
    return  the_choice


label coxChooseOutfit(lOutfits, thePerson, mom_say=None):
    python:
        renpy.dynamic("formatted_options", "the_choice", "an_outfit")
        formatted_options = []
        
        for an_outfit in lOutfits:
            if an_outfit.check_visible(the_person=thePerson):
                choice_instance = renpy.ui.ChoiceReturn(an_outfit.set_name, an_outfit, kwargs = {"npc_requirement":thePerson, "npc_corruption_requirement":an_outfit.corruption_requirement})
                formatted_options.append((choice_instance.label, choice_instance))
        
        formatted_options.append(("{b}*Back*{/b}", "Back"))
        
        if mom_say:
            mom(mom_say, interact=False)
            
        the_choice = renpy.display_menu(formatted_options)
    return the_choice

