## Well, this turned into a much bigger thing than expected.

init 3:

    $ coxSlutteryMod = Mod(mod_name="coxSluttery", version_number=13.0108, mod_label="coxSlut", mod_load_order=5, cleanup_label="coxSlutteryUnload", menu_name="CoxSluttery", mod_author="CarinaCox", mod_description="Adds a closet to.. the closet and a store to the mall.\n\nSeparates the game's outfits into individual clothing items, which you can then use to construct your own outfits in the closet (the clothes that correspond to the base game's outfits unlock as those outfits do).\n\nAdds functionality centred on the texture swap system, so additional clothes, accessories, hair colours, skin tones, nipples, etc. can be added to the closet/store.")

    if persistent.active_mods.get("coxSluttery", False):
        ##### Options    codeBlc
        
        ## These can be changed
        
        # Corruption requirement for going topless(no bra, no top, but clothed bottom), for different outfit types. Checks when saving outfit.
        $ nToplessSwimwear    = 6
        $ nToplessWork        = 8
        $ nToplessCasual      = 7
        $ nToplessWorkout     = 7
                
        # Corruption requirement for going bottomless(no panties, no pants/skirt, but clothed top, but not a dress), for different outfit types.
        $ nBottomlessSwimwear = 6
        $ nBottomlessWork     = 9
        $ nBottomlessCasual   = 7
        $ nBottomlessWorkout  = 7
        
        # Corruption requirement for full nudity (other than socks, shoes, etc. No bra, no top, no panties, no bottom)
        $ nNudeSwimwear       = 7
        $ nNudeWork           = 10
        $ nNudeCasual         = 8
        $ nNudeWorkout        = 8
        
        # endBlc
        
        
        ##### Clothing lists                codeBlc
        ##
        ## There are indeed a lot of lists. This is future proofing, so they don't get cluttered as clothes increase, and make it easier to find what you want.
        ## These are the categories in store/closet.
        ## The categories will show the amount of clothing available to wear or purchase, so you will know if there's a point in looking at the category beforehand.
        ## When entering the categories in the store or closet, the clothes will show the corruption requirement and price (if in store), but you can still click on the clothes to try them on.
        ## These are defined in init so other mods can add clothes to them in their mod label, in case theirs loads before mine, and mine erases what they add to the lists. I don't know if
        ## that would actually happen, but... again, better safe than sorry.
    
        ## ############## class coxClothing()
        
        ## These use bra_set_num
        default lListBras           = []    # For bras
        default lListHalfCupBras    = []    # The top half of these bras are gone, to give support while still showing the nipples.
        default lListExoticBras     = []    # The ones with peculiar design, like cross-laced cups, or the whole thing's just a bunch of strings, etc.
        default lListBikiniTops     = []    # Bikinis that cover a decent amount
        default lListMicroBikiniTops= []    # Pretty much only cover the nipples, if that.
        
        
        ## These use panties_set_num 
        default lListPanties        = []    # For panties that cover quite a bit and give stupid imprints on your butt.
        default lListThongs         = []    # Thongs. Whale tails.
        default lListFloss          = []    # The seam IS the fabric. It doesn't actually cover anything, it's literally just there to grind into your cavities.
        default lListBikiniBottoms  = []    # For bikini bottoms. Same as with tops.
        default lListMicroBikiniBottoms=[]  # Bikini bottoms that arely cover your pussy.
            
        ## These can use bra_set_num, shirt_set_num, panties_set_num, and/or pants_set_num
        default lListNegligees      = []    # Night gowns, usually sheer. Babydolls and other similar things can also be lumped in here.
        default lListCorsets        = []    # Corsets, bustiers, and waist cinchers. Few people know the difference, anyway.
        default lListSwimsuits      = []    # For one-piece swimsuits.
        default lListMonokinis      = []    # Swimsuits so skimpy people felt more like they were bikinis in a single shape, and named them monokinis.
            
        ## Tops, use shirt_set_num
        default lListSleevedTops    = []    # For tops with sleeves, and sweaters
        default lListTankTops       = []    # For tops with shoulder straps
        default lListTubeTops       = []    # For tube tops and off-shoulder tops. Tube tops have no straps or sleeves, and are just held up by your boobs, wishes, and constant adjustments. Off-shoulder tops are similar, but have sleeves or straps that go horizontally out to your arms, leaving collar and shoulders showing.
        default lListHalterTops     = []    # For tops with straps that are held up by the neck, rather than the shoulders.
        default lListCropTops       = []    # Tops short enough to show underboob. Generally only used if it ONLY shows underboob, and very little or no cleavage otherwise.
        default lListShirts         = []    # Professional shirts and blouses, as well as T-shirts.
        default lListAsymmetricTops = []    # For tops that that.. are asymmetric. Sleeve on one side, tapering off into a tubetop on the other, for instance.
            
        ## Uses pants_set_num
        default lListPants          = []    # Pants.
        default lListShorts         = []    # For shorter ones.
        default lListHotpants       = []    # For MUCH shorter ones.
        default lListLeggings       = []    # Kind of like pants, but thinner and stretchy, yet tight.
            
        ## Uses pants_set_num
        default lListSkirtsLong     = []    # For skirts that don't fit into the other lengths
        default lListSkirtsMini     = []    # Skirt hem at least covers butt completely, to a maximum of mid-thigh.
        default lListSkirtsMicro    = []    # From butt hanging out, to might as well not be there.
            
        ## Uses shirt_set_num and pants_set_num
        default lListSkirtsUnderBust= []    # For high-waist and under-bust skirts that require more than just pants_set_num
            
        ## This will take any set_num type and apply them appropriately.
        default lListSets           = []    # This is for when you, for instance, have a skirt-and-top set that both require you to use pants_set_num and shirt_set_num, or any other cases of sets where it won't work to use them on their own.
            
        ## Uses shirt_set_num and pants_set_num
        default lListDressesLong    = []    # From full length gowns, to barely revealing knees
        default lListDressesMini    = []    # Same as lListSkirtsMini
        default lListDressesMicro   = []    # Same as lListSkirtsMicro
            
        ## Uses socks_set_num
        default lListHoisery        = []    # Socks, pantyhoses, stockings, and any accompanying garters.
            
        ## Uses shoes_set_num
        default lListShoes          = []    # Shoes.
            
        ## Uses shoes_set_num and socks_set_num, or only shoes_set_num, in case Mira makes boots that use only shoes_set_num in the future.
        default lListBoots          = []    # Boots.
            
        ## These will take any set_num type, and apply it appropriately. It will not apply set_num types that are set to None
        default lListMMO            = []    # Anything in this list will show up as an option of clothes to wear when playing CoG.
        default lListCosplay        = []    # Anything in this list will show up in cosplay options, in store and closet.
            
        ## These will take any set_num and/or texture type, and apply it appropriately. Technically all of them will do this, but it's a guideline.
        default lListAccessories    = []    # Not necessarily anything to do with accessory_set_num, though it can have. Anything like belts, the headband, etc.
        default lListMisc           = []    # Stuff that somehow doesn't fall under other categories?
        
        ## neck_texture, neck_boob_texture, neck_blowjob_texture
        default lListNecklaces      = []
        
        ## piercings_face_texture, piercings_face_blowjob_texture
        default lListFacePiercings  = []
        ## piercings_nipples_texture, piercings_nipples_boob_texture
        default lListNipplePiercings= []
        ## piercings_other_texture, piercings_other_boob_texture, piercings_other_butt_texture, piercings_other_blowjob_texture, piercings_other_handjob_texture
        default lListOtherPiercings = []
        
        
        ############## class coxBody()
        
        ## skin_texture, skin_boob_texture, skin_butt_texture, skin_blowjob_texture, skin_handjob_texture
        default lListSkins          = []    # Full skin replacement
        
        ## pubes_texture, pubes_pussy texture
        default lListPubes          = []    # Pube colouring
        
        ## This will be getting basically its own class in the future, probably
        #default lListTattoos        = []    # Tattoo additions
        
        
        ## lips_texture, lips_blowjob_texture
        default lListLipstick       = []    #
        ## eyeshadow_texture, eyeshadow_blowjob_texture
        default lListEyeshadow      = []    # 
        ## blush_texture, blush_blowjob_texture
        default lListBlush          = []
        ## nipple_texture, nipple_boob_texture
        default lListNipples        = []
        ## eye_texture, eye_blowjob_texture
        default lListEyes           = []    # Eye textures
            
        ## Uses force_hair_num
        default lListHair           = []    # Hairstyles.
        
        ## water_hair_texture
        default lListWaterHair      = []    # Replacement for the coloured part of the water textures, specifically for the hair, as it will need different colours than the skin
        
        ## water_texture, water_boob_texture, water_butt_texture, water_upskirt_texture, water_blowjob_texture
        default lListWater          = []    # Replacement for the coloured part of the skin's water textures.
        
        ############### Ignore these, it's just used for saving the custom outfit and the nudity options/the ability to take off applied clothes.
        default lListCurrent        = []
        default lListRemoval        = []
        
        
        ##### NPC lists.... that are obsolete. Don't bother adding to them, I'll be making new ones for when I add them into the system. They're just currently required to not cause an exception in the store.
        default lListFirebrand      = []
        default lListBusty          = []
        
        ############### cheerleader (Candy) lists
        default lListCheerHair      = []
        default lListCheerSkin      = []
        default lListCheerNipples   = []
        default lListCheerEyes      = []
        default lListCheerBras      = []
        default lListCheerPanties   = []
        default lListCheerTops      = []
        default lListCheerSkirts    = []
        default lListCheerHoisery   = []
        default lListCheerFootwear  = []
        default lListCheerAccessories=[]
        default lListCheerMakeup    = []
        
        #### These lists are for actual Outfit()s, like the base game ones. As there aren't any for NPCs originally, I'll add my own. Can be used to add outfits for to the game that don't make use of my clothing system, too.
        default lListCheerHomeOutfits   = []
        default lListCheerSchoolOutfits = []
        default lListCheerUnderwear     = []
            
        #endBlc
        
            ###### Constants ... don't edit  codeBlc
        
        ##  Giving numbers to the type of outfit you want to save. Not something you need to assign yourself.
        define CONST_OUTFIT_CASUAL      = 0
        define CONST_OUTFIT_WORK        = 1
        define CONST_OUTFIT_SWIMWEAR    = 2
        define CONST_OUTFIT_GYM         = 3
        define CONST_OUTFIT_CHEER_HOME  = 4
        define CONST_OUTFIT_CHEER_SCHOOL= 5
        define CONST_OUTFIT_FIRE        = 6
        define CONST_OUTFIT_BUSTY       = 7
    
        
        ##  Using binary to make life easier for when the different clothes are put together into one outfit... though I removed most of the tags from using constants, because it was largely pointless. Only these are useful, for the time being.
        define CONST_COVERS_NIPPLES        = 0b00000001  # Used for bras and tops. If one of them covers, it will not add "Showing Nipple" tag.
        define CONST_COVERS_PUSSY          = 0b00000010  # Used for panties and skirts/pants. If one of them covers, it will not add "Showing Pussy" tag.
        
        
        ## These are used internally, no point assigning them.
        define CONST_NUDITY_NONE           = 0b00000100  # Used internally in coxNudeCheck()
        define CONST_NUDITY_TOPLESS        = 0b00001000
        define CONST_NUDITY_BOTTOMLESS     = 0b00010000
        define CONST_NUDITY_NUDE           = 0b00100000
        
        
        ## Constants to be used for any texture replacement that deals with the named slot, as a texture_id attribute.
        define TEXTURE_BRA              = 1
        define TEXTURE_PANTIES          = 2
        define TEXTURE_SHIRT            = 3
        define TEXTURE_PANTS            = 4
        define TEXTURE_SOCKS            = 5
        define TEXTURE_SHOES            = 6
        define TEXTURE_ACCESSORY        = 7
        define TEXTURE_HAIR             = 8
        define TEXTURE_SKIN             = 9
        define TEXTURE_NIPPLES          = 10
        define TEXTURE_EYES             = 11
        define TEXTURE_EYESHADOW        = 12
        define TEXTURE_BLUSH            = 13
        define TEXTURE_NECK             = 14
        define TEXTURE_LIPS             = 15
        define TEXTURE_PIERCINGS_FACE   = 16
        define TEXTURE_PIERCINGS_NIPPLES= 17
        define TEXTURE_PIERCINGS_OTHER  = 18
        define TEXTURE_PUBES            = 19
        define TEXTURE_WATER            = 20
        define TEXTURE_WATER_HAIR       = 21
        
        # endBlc
        
        image coxDisplayableCarina = Image("images/Cox/CoxSluttery/CarinaCox.png")
        
        
        ## Just making sure they're around for some functions.
        default coxNoBra                = None
        default coxNoShirt              = None
        default coxNoPanties            = None
        default coxNoPants              = None
        default coxNoSocks              = None
        default coxNoShoes              = None
        default coxNoAccessory          = None
        default coxCurrentBra           = None
        default coxCurrentPanties       = None
        default coxCurrentShirt         = None
        default coxCurrentPants         = None
        default coxCurrentSocks         = None
        default coxCurrentShoes         = None
        default coxCurrentAccessory     = None
        default coxCurrentHair          = None
        default coxCurrentSkin          = None
        default coxCurrentNipples       = None
        default coxCurrentEyes          = None
        default coxCurrentEyeshadow     = None
        default coxCurrentNeck          = None
        default coxCurrentLipstick      = None
        default coxCurrentBlush         = None
        default coxCurrentFacePiercing  = None
        default coxCurrentNipplePiercing= None
        default coxCurrentOtherPiercing = None
        default coxCurrentWater         = None
        default coxCurrentWaterHair     = None
        default coxBoobLift             = 0
        default coxThighPinch           = 0
        default coxCurrentOutfit        = None
        
        default coxSetDefaultShoes      = None
        default coxSetDefaultHair       = None
        default coxSetDefaultSkin       = None
        default coxSetDefaultNipples    = None
        default coxSetDefaultEyes       = None
        default coxSetDefaultEyeshadow  = None
        default coxSetDefaultNeck       = None
        default coxSetDefaultBlush      = None
        default coxSetDefaultLipstick   = None
        default coxSetDefaultFacePiercing= None
        default coxSetDefaultNipplePiercing= None
        default coxSetDefaultOtherPiercing= None
        default coxSetDefaultWater      = None
        default coxSetDefaultWaterHair  = None
        
        default coxBaseHair             = None
        default coxBaseSkin             = None
        default coxBaseNipples          = None
        default coxBaseEyes             = None
        
        # And these...
        default coxExtendCasual         = False # Changed with in-game setting, ignore it.
        default coxCasualFridayEnabled  = True # Automatically on, but only relevant if coxExtendCasual is also True. Changed with in-game setting.
        default coxPlusOneChurch        = True # Changed with in-game setting, ignore it.
        default coxPiercingsUnlocked    = False # In-game event, spoilers ffs.
        default coxTattoosUnlocked      = False
        default coxKeepSettings         = False
        default coxKeptMomTags          = []
        
        default coxCasualHomeEarly      = None
        default coxCasualHomeMorning    = None
        default coxCasualHomeNoon       = None
        default coxCasualHomeEvening    = None
        default coxCasualHomeNight      = None
        default coxCasualShopping       = None
        default coxCasualChurch         = None
        default coxCasualFriday         = None
        default lListExtendedCasual     = []
        
        default coxVisitedEmporium      = False
        default coxCoxTutorial          = False
        default coxEmporiumPurchases    = 0
        default coxSeenBody             = False
        default coxSeenBimbo            = False
        default coxSeenEdgelady         = False
        default coxSeenTopHeavy         = False
        default coxImaginative          = False
        
        default coxLocationDick = { "Previous"              : "Your Bedroom",
                                    "Current"               : "Your Bedroom",
                                    "Backyard"              : "Home",
                                    "Basement"              : "Home",
                                    "Upstairs Bathroom"     : "Home",
                                    "Cheerleader Bedroom"   : "Home",
                                    "Firebrand Bedroom"     : "Home",
                                    "Off Map"               : "Off Map",
                                    "Upstairs Hallway"      : "Home",
                                    "Jock Bedroom"          : "Home",
                                    "Kitchen"               : "Home",
                                    "Livingroom"            : "Home",
                                    "Your Bedroom"          : "Home",
                                    "Nerd Bedroom"          : "Home",
                                    "Slacker Bedroom"       : "Home",
                                    "Mall"                  : "Shopping",
                                    "Pharmacy"              : "Shopping",
                                    "Church"                : "Church",
                                    "Grocery Store"         : "Shopping",
                                    "Caves of Grothnar"     : "MMO",
                                    "Boys Bathroom"         : "School",
                                    "Boys Changingroom"     : "School",
                                    "History Class"         : "School",
                                    "Girls Bathroom"        : "School",
                                    "Girls Changingroom"    : "School",
                                    "Gym"                   : "School",
                                    "Principal's Office"    : "School",
                                    "Girls Gloryhole"       : "School",
                                    "School Hall 1"         : "School",
                                    "School Hall 2"         : "School",
                                    "Cox Beauty Emporium"   : "Shopping"}
                                    
        $ mom_corruption_points.extend(["coxExtendCasual", "coxSecretsToNudity", "coxSewedSkirtAgain"])
        
        python:
        
            def coxClothingConst(ClothesList): # Adding all the constants of a list of clothing into one, while ignoring the ones that are not in the relevant slots        codeBlc
                if ClothesList is None:
                    return
                binary = 0
                count = 0
                for i in ClothesList:
                    if isinstance(i, (coxClothing, coxBody)):
                        if count == (0 or 2 or 8) and i.constants & CONST_COVERS_NIPPLES:       # If checking anything but bra, shirt, or skin, and they have tags that only those slots should have
                            binary = binary | CONST_COVERS_NIPPLES                             # remove those tags from those slots, before adding the constants to the return binary
                        elif count == (1 or 3 or 8) and i.constants & CONST_COVERS_PUSSY:
                            binary = binary | CONST_COVERS_PUSSY
                        if count == (8):
                            binary = binary | i.constants
                        count += 1
                return binary       #endBlc
            
            def coxNudeCheck(ClothesList):  # Returns constant CONST_NUDITY_* codeBlc
                
                hasbra = None
                hastop = None
                haspanties = None
                haspants = None
                
                const = coxClothingConst(ClothesList)
                count = 0
                
                for i in ClothesList:
                    if  isinstance(i, (coxClothing, coxBody)):
                        if count == 0:
                            if i.bra_set_num is not None and i.bra_set_num >= 0:
                                if "NoBra" in i.tags:
                                    hasbra = False
                                else: hasbra = True
                            else:
                                hasbra = False
                        elif count == 2:
                            if i.shirt_set_num is not None and i.shirt_set_num >= 0:
                                if "NoShirt" in i.tags:
                                    hastop = False
                                else: hastop = True
                            else:
                                hastop = False
                        elif count == 1:
                            if i.panties_set_num is not None and i.panties_set_num >= 0:
                                if "NoPanties" in i.tags:
                                    haspanties = False
                                else: haspanties = True
                            else:
                                haspanties = False
                        elif count == 3:
                            if i.pants_set_num is not None and i.pants_set_num >= 0:
                                if "NoPants" in i.tags:
                                    haspants = False
                                else: haspants = True
                            else:
                                haspants = False
                        elif count == 8:
                            if i.is_bra: hasbra = True 
                            if i.is_shirt: hastop = True
                            if i.is_panties : haspanties = True
                            if i.is_pants: haspants = True
                    count += 1
                
                
                if not hasbra and not hastop and not haspanties and not haspants: 
                    return CONST_NUDITY_NUDE
                    
                elif (not hasbra and not hastop) and (haspanties or haspants):
                    return CONST_NUDITY_TOPLESS
                        
                elif (hasbra or hastop) and (not haspanties and not haspants):
                    return CONST_NUDITY_BOTTOMLESS
                return CONST_NUDITY_NONE        #endBlc
            
            def coxEligibleListLen(listClothing, inStore=False): # Just a simple thing to count the list length when using conditions needed for it to show up in store or closet        codeBlc
                count = 0
                
                for the_clothing in listClothing:
                    if inStore and the_clothing.in_store():
                        count += 1
                    elif not inStore and the_clothing.in_closet():
                        count += 1
                return count        #endBlc
                
            def coxCalcCorruption(ClothesList, OutfitType=CONST_OUTFIT_CASUAL):# Decides the corruption requirement when saving outfit         codeBlc
                templist = []
                nudity = coxNudeCheck(ClothesList)  # Check to see if not wearing stuff
                            
                for i in ClothesList:
                    templist.append(i.corruption_requirement)
                
                if nudity != CONST_NUDITY_NONE: # Only needs to be complicated if there's nudity
                    if OutfitType == CONST_OUTFIT_CASUAL:
                        switch={CONST_NUDITY_TOPLESS: nToplessCasual,  # A dictionary pretending to be a poor imitation of a switch case. Not having switch is just rude. WTF python?
                                CONST_NUDITY_BOTTOMLESS: nBottomlessCasual,
                                CONST_NUDITY_NUDE: nNudeCasual}
                    elif OutfitType == CONST_OUTFIT_WORK:
                        switch={CONST_NUDITY_TOPLESS: nToplessWork,
                                CONST_NUDITY_BOTTOMLESS: nBottomlessWork,
                                CONST_NUDITY_NUDE: nNudeWork}
                    elif OutfitType == CONST_OUTFIT_SWIMWEAR:
                        switch={CONST_NUDITY_TOPLESS: nToplessSwimwear,
                                CONST_NUDITY_BOTTOMLESS: nBottomlessSwimwear,
                                CONST_NUDITY_NUDE: nNudeSwimwear}
                    elif OutfitType == CONST_OUTFIT_GYM:
                        switch={CONST_NUDITY_TOPLESS: nToplessWorkout,
                                CONST_NUDITY_BOTTOMLESS: nBottomlessWorkout,
                                CONST_NUDITY_NUDE: nNudeWorkout}
                    elif OutfitType == CONST_OUTFIT_CHEER_HOME:
                        switch={CONST_NUDITY_TOPLESS: nToplessSwimwear-2,
                                CONST_NUDITY_BOTTOMLESS: nBottomlessSwimwear-2,
                                CONST_NUDITY_NUDE: nNudeSwimwear-2}
                    elif OutfitType == CONST_OUTFIT_CHEER_SCHOOL:
                        switch={CONST_NUDITY_TOPLESS: nToplessSwimwear-1,
                                CONST_NUDITY_BOTTOMLESS: nBottomlessSwimwear-1,
                                CONST_NUDITY_NUDE: nNudeSwimwear-1}
                    elif OutfitType == CONST_OUTFIT_FIRE:
                        switch={CONST_NUDITY_TOPLESS: nToplessCasual-1,
                                CONST_NUDITY_BOTTOMLESS: nBottomlessCasual-1,
                                CONST_NUDITY_NUDE: nNudeCasual-1}
                    elif OutfitType == CONST_OUTFIT_BUSTY:
                        switch={CONST_NUDITY_TOPLESS: nToplessWork,
                                CONST_NUDITY_BOTTOMLESS: nBottomlessWork,
                                CONST_NUDITY_NUDE: nNudeWork}
                    
                    if switch.get(nudity, nNudeWork) > max(templist):  # Only make the corruption_requirement into the nudity settings if it's actually greater than the highest clothing setting
                        return switch.get(nudity, nNudeWork)
                return max(templist)    #endBlc
            
            def coxCalcTags(ClothesList, Type=CONST_OUTFIT_CASUAL): # Adding up the tags of all the clothing, and adding ones that should be there.     codeBlc
                taglist = []
                nudity = coxNudeCheck(ClothesList)
                const = coxClothingConst(ClothesList)
                bra = ClothesList[0]
                shirt = ClothesList[2]
                panties = ClothesList[1]
                pants = ClothesList[3]
                skin = ClothesList[8]
                
                for clothing in ClothesList:
                    [taglist.append(tag) for tag in clothing.tags if tag not in taglist] # Only add unique tags. One-liners are fun.
                
                if "Slutty" in taglist:
                    tags=["Very Revealing", "Revealing"]
                    [taglist.append(tag) for tag in tags if tag not in taglist]
                elif "Very Revealing" in taglist:
                    tags="Revealing"
                    if tags not in taglist: taglist.append(tags)
                
                if not ((bra.constants | shirt.constants | skin.constants) & CONST_COVERS_NIPPLES):
                    tags=["Showing Nipple", "Revealing Underwear", "Slutty", "Very Revealing", "Revealing"]
                    [taglist.append(tag) for tag in tags if tag not in taglist]
                if not ((panties.constants | pants.constants | skin.constants) & CONST_COVERS_PUSSY):
                    tags=["Showing Pussy", "Revealing Underwear", "Slutty", "Very Revealing", "Revealing"]
                    [taglist.append(tag) for tag in tags if tag not in taglist]
                
                if bra.bra_set_num == -3 and shirt.shirt_set_num >= 0:
                    tags=["NoBra", "Revealing Underwear"]
                    [taglist.append(tag) for tag in tags if tag not in taglist]
                if panties.panties_set_num == -3 and pants.pants_set_num >= 0:
                    tags=["NoPanties", "Revealing Underwear"]
                    [taglist.append(tag) for tag in tags if tag not in taglist]
                
                if ("Revealing Underwear" in bra.tags or ("Revealing Underwear" in skin.tags and skin.is_bra)) or ("NoShirt" in taglist or shirt.shirt_set_num == -3):
                    tags="Revealing"
                    if tags not in taglist: taglist.append(tags)
                if ("Revealing Underwear" in panties.tags or ("Revealing Underwear" in skin.tags and skin.is_panties)) or ("NoPants" in taglist or pants.pants_set_num == -3):
                    tags=["Revealing", "Very Revealing"]
                    [taglist.append(tag) for tag in tags if tag not in taglist]
                
                if Type == CONST_OUTFIT_CASUAL or Type == CONST_OUTFIT_CHEER_HOME:
                    tags="Casual"
                    if tags not in taglist: taglist.append(tags)
                elif Type == CONST_OUTFIT_WORK:
                    tags="Work"
                    if tags not in taglist: taglist.append(tags)
                elif Type == CONST_OUTFIT_SWIMWEAR:
                    tags="Swimwear"
                    if tags not in taglist: taglist.append(tags)
                elif Type == CONST_OUTFIT_GYM:
                    tags="Workout"
                    if tags not in taglist: taglist.append(tags)
                elif Type == CONST_OUTFIT_CHEER_SCHOOL:
                    tags=["Casual", "School"]
                    [taglist.append(tag) for tag in tags if tag not in taglist]
                    
                if nudity != CONST_NUDITY_NONE:
                    if nudity == CONST_NUDITY_NUDE:
                        tags="Nude"
                        if tags not in taglist: taglist.append(tags)
                    elif nudity == CONST_NUDITY_TOPLESS:
                        tags="Topless"
                        if tags not in taglist: taglist.append(tags)
                    elif nudity == CONST_NUDITY_BOTTOMLESS:
                        tags="Bottomless"
                        if tags not in taglist: taglist.append(tags)
                return taglist      #endBlc
            
            def coxSlotHasSwap(nSlot, oOutfit): # Check if an outfit's slot is swapped. Basically, to see if the character is wearing the base clothing, or a texture-swapped version of it.
                if hasattr(oOutfit, "texture_swaps"):
                    for swap in oOutfit.texture_swaps:
                        if hasattr(swap, "texture_id"):
                            if swap.texture_id == nSlot:
                                return True
                return False
            
            def coxOutfitHasSwap(oOutfit, oSwap): # Check if outfit contains a specific texture swap
                if hasattr(oOutfit, "texture_swaps"):
                    for swap in oOutfit.texture_swaps:
                        if swap is oSwap:
                            return True
                return False
            
            def coxChangeClothing(oClothing, oOutfit=None, oPerson=mom, isSaving=False): # Takes a single clothing, or a list of them, and updates a given outfit with it. If no outfit is specified, starts off of coxCurrentOutfit        codeBlc
                
                global coxCurrentBra
                global coxCurrentPanties
                global coxCurrentShirt
                global coxCurrentPants
                global coxCurrentSocks
                global coxCurrentShoes
                global coxCurrentAccessory
                global coxCurrentHair
                global coxCurrentSkin
                global coxCurrentNipples
                global coxCurrentEyes
                global coxCurrentEyeshadow
                global coxCurrentNeck
                global coxCurrentLipstick
                global coxCurrentBlush
                global coxCurrentFacePiercing
                global coxCurrentNipplePiercing
                global coxCurrentOtherPiercing
                global coxCurrentWater
                global coxCurrentWaterHair
                
                global coxBoobLift
                global coxThighPinch
                global lListCurrent
                
                if oClothing is None:
                    lClothing = []
                elif isinstance(oClothing, list):
                    lClothing = oClothing
                else:
                    lClothing = [oClothing]
                
                if oOutfit is None:
                    returnOutfit = coxCurrentOutfit
                else: returnOutfit = oOutfit
                
                if returnOutfit.texture_swaps is None:
                    tempswaps = []
                    returnOutfit.texture_swaps = []
                else:
                    tempswaps = returnOutfit.texture_swaps[:]
                
                count = 0
                for theClothing in lClothing:
                    if isinstance(theClothing, coxBody):        #codeBlc
                    
                        if theClothing.force_hair_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_HAIR and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.hair_texture is not None:
                                swaps = [theClothing.hair_texture, theClothing.hair_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentHair = theClothing
                            lListCurrent[7] = coxCurrentHair
                            returnOutfit.force_hair_num = theClothing.force_hair_num
                            
                        if theClothing.skin_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_SKIN and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.skin_texture is not None:
                                swaps = [theClothing.skin_texture, theClothing.skin_boob_texture, theClothing.skin_butt_texture, theClothing.skin_upskirt_texture, theClothing.skin_masturbation_texture, theClothing.skin_blowjob_texture, theClothing.skin_handjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentSkin = theClothing
                            lListCurrent[8] = coxCurrentSkin
                            
                        if theClothing.nipple_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_NIPPLES and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.nipple_texture is not None:
                                swaps = [theClothing.nipple_texture, theClothing.nipple_boob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentNipples = theClothing
                            lListCurrent[9] = coxCurrentNipples
                            
                        if theClothing.eye_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_EYES and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.eye_texture is not None:
                                swaps = [theClothing.eye_texture, theClothing.eye_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentEyes = theClothing
                            lListCurrent[10] = coxCurrentEyes
                            
                        if theClothing.eyeshadow_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_EYESHADOW and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.eyeshadow_texture is not None:
                                swaps = [theClothing.eyeshadow_texture, theClothing.eyeshadow_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentEyeshadow = theClothing
                            lListCurrent[11] = coxCurrentEyeshadow
                            
                        if theClothing.lips_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_LIPS and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.lips_texture is not None:
                                swaps = [theClothing.lips_texture, theClothing.lips_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentLipstick = theClothing
                            lListCurrent[13] = coxCurrentLipstick
                            
                        if theClothing.blush_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_BLUSH and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.blush_texture is not None:
                                swaps = [theClothing.blush_texture, theClothing.blush_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentBlush = theClothing
                            lListCurrent[14] = coxCurrentBlush
                            
                        if theClothing.water_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_WATER and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.water_texture is not None:
                                swaps = [theClothing.water_texture, theClothing.water_boob_texture, theClothing.water_butt_texture, theClothing.water_upskirt_texture, theClothing.water_masturbation_texture, theClothing.water_blowjob_texture, theClothing.water_handjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentWater = theClothing
                            lListCurrent[18] = coxCurrentWater
                            
                        if theClothing.water_hair_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_WATER_HAIR and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.water_hair_texture is not None:
                                swaps = [theClothing.water_hair_texture, theClothing.water_hair_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentWaterHair = theClothing
                            lListCurrent[19] = coxCurrentWaterHair
                        
                        if theClothing.force_breast_lift is not None and not isSaving:
                            coxBoobLift = theClothing.force_breast_lift
                            returnOutfit.force_breast_lift = theClothing.force_breast_lift
                        
                        if theClothing.force_pinch_thighs is not None and not isSaving:
                            coxThighPinch = theClothing.force_pinch_thighs
                            returnOutfit.force_pinch_thighs = theClothing.force_pinch_thighs
                            
                            # endBlc
                            
                    elif isinstance(theClothing, coxClothing):  #codeBlc
                        if theClothing.bra_set_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_BRA and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.bra_texture is not None:
                                swaps = [theClothing.bra_texture, theClothing.bra_boob_texture, theClothing.bra_skindentation_texture, theClothing.bra_skindentation_boob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentBra = theClothing
                            lListCurrent[0] = coxCurrentBra
                            returnOutfit.bra_set_num = theClothing.bra_set_num
                            
                        if theClothing.panties_set_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_PANTIES and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.panties_texture is not None:
                                swaps = [theClothing.panties_texture, theClothing.panties_butt_texture, theClothing.panties_upskirt_texture, theClothing.panties_masturbation_texture, theClothing.panties_skindentation_texture, theClothing.panties_skindentation_butt_texture, theClothing.panties_skindentation_upskirt_texture, theClothing.panties_skindentation_masturbation_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentPanties = theClothing
                            lListCurrent[1] = coxCurrentPanties
                            returnOutfit.panties_set_num = theClothing.panties_set_num
                            
                        if theClothing.shirt_set_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_SHIRT and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.shirt_texture is not None:
                                swaps = [theClothing.shirt_texture, theClothing.shirt_boob_texture, theClothing.shirt_skindentation_texture, theClothing.shirt_skindentation_boob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentShirt = theClothing
                            lListCurrent[2] = coxCurrentShirt
                            returnOutfit.shirt_set_num = theClothing.shirt_set_num
                            
                        if theClothing.pants_set_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_PANTS and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.pants_texture is not None:
                                swaps = [theClothing.pants_texture, theClothing.pants_butt_texture, theClothing.pants_skindentation_texture, theClothing.pants_skindentation_butt_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentPants = theClothing
                            lListCurrent[3] = coxCurrentPants
                            returnOutfit.pants_set_num = theClothing.pants_set_num
                            
                        if theClothing.socks_set_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_SOCKS and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.socks_texture is not None:
                                swaps = [theClothing.socks_texture, theClothing.socks_butt_texture, theClothing.socks_upskirt_texture, theClothing.socks_masturbation_texture, theClothing.socks_skindentation_texture, theClothing.socks_skindentation_butt_texture, theClothing.socks_skindentation_upskirt_texture, theClothing.socks_skindentation_masturbation_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentSocks = theClothing
                            lListCurrent[4] = coxCurrentSocks
                            returnOutfit.socks_set_num = theClothing.socks_set_num
                            
                        if theClothing.shoes_set_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_SHOES and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.shoes_texture is not None:
                                swaps = [theClothing.shoes_texture, theClothing.shoes_skindentation_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentPanties = theClothing
                            lListCurrent[5] = coxCurrentPanties
                            returnOutfit.shoes_set_num = theClothing.shoes_set_num
                            
                        if theClothing.accessory_set_num is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_ACCESSORY and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.accessory_texture is not None:
                                swaps = [theClothing.accessory_texture, theClothing.accessory_skindentation_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentAccessory = theClothing
                            lListCurrent[6] = coxCurrentAccessory
                            returnOutfit.accessory_set_num = theClothing.accessory_set_num
                            
                        if theClothing.neck_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_NECK and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.neck_texture is not None:
                                swaps = [theClothing.neck_texture, theClothing.neck_boob_texture, theClothing.neck_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentNeck = theClothing
                            lListCurrent[12] = coxCurrentNeck
                            
                        if theClothing.piercings_face_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_PIERCINGS_FACE and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.piercings_face_texture is not None:
                                swaps = [theClothing.piercings_face_texture, theClothing.piercings_face_blowjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentFacePiercing = theClothing
                            lListCurrent[15] = coxCurrentFacePiercing
                            
                        if theClothing.piercings_nipples_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_PIERCINGS_NIPPLES and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.piercings_nipples_texture is not None:
                                swaps = [theClothing.piercings_nipples_texture, theClothing.piercings_nipples_boob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentNipplePiercing = theClothing
                            lListCurrent[16] = coxCurrentNipplePiercing
                            
                        if theClothing.piercings_other_texture is not None:
                            for theswaps in returnOutfit.texture_swaps:
                                if theswaps.texture_id == TEXTURE_PIERCINGS_OTHER and theswaps in tempswaps:
                                    tempswaps.remove(theswaps)
                            if theClothing.piercings_other_texture is not None:
                                swaps = [theClothing.piercings_other_texture, theClothing.piercings_other_boob_texture, theClothing.piercings_other_butt_texture, theClothing.piercings_other_upskirt_texture, theClothing.piercings_other_masturbation_texture, theClothing.piercings_other_blowjob_texture, theClothing.piercings_other_handjob_texture]
                                [tempswaps.append(swap) for swap in swaps if swap not in tempswaps and swap is not None and swap != "default"]
                            coxCurrentOtherPiercing = theClothing
                            lListCurrent[17] = coxCurrentOtherPiercing
                        
                        if theClothing.force_breast_lift is not None and not isSaving:
                            coxBoobLift = theClothing.force_breast_lift
                            returnOutfit.force_breast_lift = theClothing.force_breast_lift
                        
                        if theClothing.force_pinch_thighs is not None and not isSaving:
                            coxThighPinch = theClothing.force_pinch_thighs
                            returnOutfit.force_pinch_thighs = theClothing.force_pinch_thighs
                        #endBlc
                    
                    count += 1
                    
                
                for swap in returnOutfit.texture_swaps:
                    if not swap in tempswaps:
                        oPerson.outfit_manager.remove_active_texture_swap(swap)
                
                returnOutfit.texture_swaps = tempswaps[:]
                returnOutfit.unlocked=True
                return returnOutfit
            
            #endBlc
            
            def coxRemoveAllPersistent(oPerson): #codeBlc
                
                templist = []
                
                templist.extend(oPerson.outfit_manager.persistent_texture_swaps)
                
                for swap in templist:
                    oPerson.outfit_manager.remove_persistent_texture_swap(swap)
                
                oPerson.outfit_manager.refresh_texture_swaps()
                return      #endBlc
            
            def coxAssignPersistentSwap(nID, oPerson, oBody): # Applying nID (TEXTURE_*) to oPerson (mom) from oBody (coxBody or coxClothing object) after removing any of that texture type from oPerson     codeBlc
                templist = []
                
                for swap in oPerson.outfit_manager.persistent_texture_swaps:
                    if hasattr(swap, "texture_id"):
                        if swap.texture_id == nID:
                            templist.append(swap)
                
                for swap in templist:
                    oPerson.outfit_manager.remove_persistent_texture_swap(swap)
                
                templist = []
                
                if isinstance(oBody, (coxClothing, coxBody)):
                    if nID == TEXTURE_HAIR:
                        swaps = [oBody.hair_texture, oBody.hair_blowjob_texture]
                        [templist.append(swap) for swap in swaps if swap not in templist and swap is not None and swap != "default"]
                        
                    if nID == TEXTURE_EYES:
                        swaps = [oBody.eye_texture, oBody.eye_blowjob_texture]
                        [templist.append(swap) for swap in swaps if swap not in templist and swap is not None and swap != "default"]
                        
                    if nID == TEXTURE_SKIN:
                        swaps = [oBody.skin_texture, oBody.skin_boob_texture, oBody.skin_butt_texture, oBody.skin_upskirt_texture, oBody.skin_masturbation_texture, oBody.skin_blowjob_texture, oBody.skin_handjob_texture]
                        [templist.append(swap) for swap in swaps if swap not in templist and swap is not None and swap != "default"]
                        
                    if nID == TEXTURE_NIPPLES:
                        swaps = [oBody.nipple_texture, oBody.nipple_boob_texture]
                        [templist.append(swap) for swap in swaps if swap not in templist and swap is not None and swap != "default"]
                        
                    if nID == TEXTURE_WATER:
                        swaps = [oBody.water_texture, oBody.water_boob_texture, oBody.water_butt_texture, oBody.water_upskirt_texture, oBody.water_masturbation_texture, oBody.water_blowjob_texture, oBody.water_handjob_texture]
                        [templist.append(swap) for swap in swaps if swap not in templist and swap is not None and swap != "default"]
                        
                    if nID == TEXTURE_WATER_HAIR:
                        swaps = [oBody.water_hair_texture, oBody.water_hair_blowjob_texture]
                        [templist.append(swap) for swap in swaps if swap not in templist and swap is not None and swap != "default"]
                        
                    if nID == TEXTURE_PUBES:
                        swaps = [oBody.pubes_texture, oBody.pubes_upskirt_texture, oBody.pubes_masturbation_texture]
                        [templist.append(swap) for swap in swaps if swap not in templist and swap is not None and swap != "default"]
                    
                #oPerson.outfit_manager.persistent_texture_swaps = templist[:]
                
                for swap in templist:
                    oPerson.outfit_manager.add_persistent_texture_swap(the_texture_swap=swap, refresh_after=False)
                    
                oPerson.outfit_manager.refresh_texture_swaps()
                return      #endBlc
            
            def coxSetNudeCurrent(oPerson=mom):    #codeBlc
                
                global coxCurrentBra            # codeBlc
                global coxCurrentPanties
                global coxCurrentShirt
                global coxCurrentPants
                global coxCurrentSocks
                global coxCurrentShoes
                global coxCurrentAccessory
                global coxCurrentHair
                global coxCurrentSkin
                global coxCurrentNipples
                global coxCurrentEyes
                global coxCurrentEyeshadow
                global coxCurrentNeck
                global coxCurrentLipstick
                global coxCurrentBlush
                global coxCurrentFacePiercing
                global coxCurrentNipplePiercing
                global coxCurrentOtherPiercing
                global coxCurrentWater
                global coxCurrentWaterHair
                global coxBoobLift
                global coxThighPinch
                global coxCurrentOutfit         #endBlc
                
                if oPerson is mom:        #codeBlc
                    coxCurrentBra       = coxNoBra if coxNoBra.is_unlocked() else coxDailyBra
                    coxCurrentPanties   = coxNoPanties if coxNoPanties.is_unlocked() else coxDailyPanties
                    coxCurrentShirt     = coxNoShirt if coxNoShirt.is_unlocked() else coxDailyTop
                    coxCurrentPants     = coxNoPants if coxNoPants.is_unlocked() else coxTeacherSkirt
                    coxCurrentSocks     = coxNoSocks
                    coxCurrentShoes     = coxSetDefaultShoes
                    coxCurrentAccessory = coxNoAccessory
                    coxCurrentHair      = coxSetDefaultHair
                    coxCurrentSkin      = coxSetDefaultSkin
                    coxCurrentNipples   = coxSetDefaultNipples
                    coxCurrentEyes      = coxSetDefaultEyes
                    coxCurrentEyeshadow = coxSetDefaultEyeshadow
                    coxCurrentNeck      = coxSetDefaultNeck
                    coxCurrentLipstick       = coxSetDefaultLipstick
                    coxCurrentBlush          = coxSetDefaultBlush
                    coxCurrentFacePiercing   = coxSetDefaultFacePiercing
                    coxCurrentNipplePiercing = coxSetDefaultNipplePiercing
                    coxCurrentOtherPiercing  = coxSetDefaultOtherPiercing
                    coxCurrentWater          = coxSetDefaultWater
                    coxCurrentWaterHair      = coxSetDefaultWaterHair       #endBlc
                    
                elif oPerson is cheerleader:      # codeBlc
                    if coxNoBra.is_unlocked():
                        coxCurrentBra = coxNoBra
                    elif cheerleader_base_underwear.bra_set_num >= 1:
                        coxCurrentBra = coxCheerLuckyBraCutdown
                    else:
                        coxCurrentBra = coxCheerLuckyBra
                    
                    if coxNoPanties.is_unlocked():
                        coxCurrentPanties = coxNoPanties
                    elif cheerleader_base_underwear.panties_set_num >= 1:
                        coxCurrentPanties = coxCheerLuckyPantiesCutdown
                    else:
                        coxCurrentPanties = coxCheerLuckyPanties
                    
                    if coxNoShirt.is_unlocked():
                        coxCurrentShirt = coxNoShirt
                    elif cheerleader_base_outfit.shirt_set_num >= 2:
                        coxCurrentShirt = coxCheerLuckyTopMini
                    elif cheerleader_base_outfit.shirt_set_num == 1:
                        coxCurrentShirt = coxCheerLuckyTopCutdown
                    else:
                        coxCurrentShirt = coxCheerLuckyTop
                    
                    if coxNoPants.is_unlocked():
                        coxCurrentPants = coxNoPants
                    elif cheerleader_base_outfit.pants_set_num >= 2:
                        coxCurrentPants = coxCheerLuckySkirtMini
                    elif cheerleader_base_outfit.pants_set_num == 1:
                        coxCurrentPants = coxCheerLuckySkirtCutdown
                    else:
                        coxCurrentPants = coxCheerLuckySkirt
                    
                    coxCurrentSocks     = coxNoSocks
                    coxCurrentShoes     = coxCheerShoes
                    coxCurrentAccessory = coxNoAccessory
                    coxCurrentHair      = coxCheerHair
                    coxCurrentSkin      = coxMiraSkin
                    coxCurrentNipples   = coxMiraNipples
                    coxCurrentEyes      = coxMiraEyes
                    coxCurrentEyeshadow = coxMiraMakeUp
                    coxCurrentNeck      = coxMiraNeck
                    coxCurrentLipstick       = coxMiraLips
                    coxCurrentBlush          = coxMiraMakeUp
                    coxCurrentFacePiercing   = coxNoFacePiercings
                    coxCurrentNipplePiercing = coxNoNipplePiercings
                    coxCurrentOtherPiercing  = coxNoOtherPiercings
                    coxCurrentWater          = coxMiraWater
                    coxCurrentWaterHair      = coxMiraWaterHair               #endBlc
                
                
                lListCurrent[0] = coxCurrentBra
                lListCurrent[1] = coxCurrentPanties
                lListCurrent[2] = coxCurrentShirt
                lListCurrent[3] = coxCurrentPants
                lListCurrent[4] = coxCurrentSocks
                lListCurrent[5] = coxCurrentShoes
                lListCurrent[6] = coxCurrentAccessory
                lListCurrent[7] = coxCurrentHair
                lListCurrent[8] = coxCurrentSkin
                lListCurrent[9] = coxCurrentNipples
                lListCurrent[10]= coxCurrentEyes
                lListCurrent[11]= coxCurrentEyeshadow
                lListCurrent[12]= coxCurrentNeck
                lListCurrent[13]= coxCurrentLipstick
                lListCurrent[14]= coxCurrentBlush
                lListCurrent[15]= coxCurrentFacePiercing  
                lListCurrent[16]= coxCurrentNipplePiercing
                lListCurrent[17]= coxCurrentOtherPiercing
                lListCurrent[18]= coxCurrentWater
                lListCurrent[19]= coxCurrentWaterHair
                
                coxCurrentOutfit    = Outfit(set_name="Current", starts_unlocked=True, texture_swaps=[])
                coxCurrentOutfit    = coxChangeClothing(oClothing=lListCurrent, oOutfit=coxCurrentOutfit)
                coxBoobLift         = 0
                coxThighPinch       = 0
                return  #endBlc
            
            def coxSaveCurrentToOutfit(oOutfit=None, lSlotList=None, lListofSlotLists=None, sName=None, nType=CONST_OUTFIT_CASUAL): #lSlotList is a list of outfits that essentially are the save slots. lListofSlotLists is a list of lists that correspond to the save slots in lSlotList, for saving the actual clothes used.       codeBlc
                
                if oOutfit is None:
                    return
                if sName is None:
                    sName = oOutfit.set_name
                if lSlotList is not None and isinstance(lSlotList, list):
                    if oOutfit in lSlotList:
                        idx = lSlotList.index(oOutfit)
                        lListofSlotLists[idx] = lListCurrent[:]         # clone the list of current clothes into a list that corresponds to the save slots, to make loading work properly for planning and saving outfits.
                
                oOutfit = coxChangeClothing(oClothing=lListCurrent, oOutfit=oOutfit, isSaving=True)
                oOutfit.set_name = sName
                oOutfit.outfit_tags = coxCalcTags(ClothesList=lListCurrent, Type=nType)
                oOutfit.corruption_requirement = coxCalcCorruption(ClothesList=lListCurrent, OutfitType=nType)
                oOutfit.force_breast_lift = coxBoobLift
                oOutfit.unlocked = True
                
                return  #endBlc
            
            def coxLoadOutfitToCurrent(oOutfit=None, lSlotList=None, lListofSlotLists=None): # oOutfit is the outfit to load. lSlotList is the list of save slot outfits you can find oOutfit in. lListofSlotLists is a list of lists. The list in the same index as oOutfit is in lSlotList has a saved clone of the list of current clothes, at the time the outfit was saved.    codeBlc
                
                global lListCurrent
                global coxCurrentOutfit
                global coxBoobLift
                global coxThighPinch
                
                if oOutfit is None: # If you didn't specify an outfit to load, you're doing it wrong
                    return
                
                if lSlotList is not None and isinstance(lSlotList, list): 
                    if oOutfit in lSlotList:            
                        idx = lSlotList.index(oOutfit)      # Find out which slot in lSlotList that oOutfit was saved to
                        lListCurrent = lListofSlotLists[idx][:]             # Use that index to find the cloned current list in lListofSlotLists, and clone it back onto the current clothes list.
                        coxCurrentOutfit = coxChangeClothing(oClothing=lListCurrent)    # Apply all the clothing in the current clothes list to the current outfit. It's not a perfect way to load, as the order it's applied will not necessarily be the same you did it in, and that may cause issues, depending on choices. It's better than nothing, though.
                        coxBoobLift = oOutfit.force_breast_lift
                        coxThighPinch = oOutfit.force_pinch_thighs
                        coxCurrentOutfit.force_breast_lift = oOutfit.force_breast_lift
                return  #endBlc
            
            coxBeautyEmporium = Location("Cox Beauty Emporium", "coxEmporiumScreen", "Cox/coxSluttery/CoxBeautyEmporium.png")
            
    python: # These have to be defined to not break loading with the mod turned off, so they're outside of the conditional that checks if the mod is loaded
        def coxDisdress(oPerson, oNewOutfit):    # simple function to set a new current outfit to a Person() while only dressing according to their current state of undress. Used in my time event.         codeBlc
            braoff = 0b1
            pantiesoff = 0b10       # create a mini bitwise check to save the undressed clothes
            shirtoff=0b100
            pantsoff=0b1000
            disdress = 0
            if oPerson.outfit_manager.bra_off:              # find out what clothes have been undressed
                disdress = disdress | braoff
            if oPerson.outfit_manager.panties_off:
                disdress = disdress | pantiesoff
            if oPerson.outfit_manager.shirt_off:
                disdress = disdress | shirtoff
            if oPerson.outfit_manager.pants_off:
                disdress = disdress | pantsoff
            
            oPerson.set_current_outfit(oNewOutfit)    # set current outfit to the new outfit. This resets the undressed state, which is why we had to save the state earlier
            if disdress & braoff:                           # reapply any undressed state from earlier
                oPerson.set_bra_off(True)                       # When an event decides to redress, it will be as the time-appropriate outfit
            if disdress & pantiesoff:
                oPerson.set_panties_off(True)
            if disdress & shirtoff:
                oPerson.set_shirt_off(True)
            if disdress & pantsoff:
                oPerson.set_pants_off(True)
            return      #endBlc
        
        def coxTimeEvents(theTime):     #codeBlc
            if coxExtendCasual:                            # Only run if enabled
                sLoc = mom.current_location.name           # the location name is used as dictionary key to check the category of the location
                
                if coxLocationDick[sLoc] != "Shopping" and coxLocationDick[sLoc] != "Church": # If we're not shopping or at church
                    mom.default_homewear = lListExtendedCasual[theTime]                       # set the home outfit to the appropriate time-based one
                
                if coxLocationDick[sLoc] == "Home":     # If we're at home
                    if not mom.outfit_manager.shirt_off and not mom.outfit_manager.pants_off and not mom.outfit_manager.bra_off and not mom.outfit_manager.panties_off:  # if we're not currently in an event that nudens us
                        renpy.call("dress_daily")                                                                                                                        # call dress_daily directly. Replaced by coxDressDaily further down.
                    else:  # if we're in an event that has undressed something
                        coxDisdress(oPerson=mom, oNewOutfit=mom.default_homewear)
            
            if cheerleader.schedule.is_school(the_day=day, the_time=theTime) and cheerleader.current_outfit is not coxCheerDefaultSchool:
                if not cheerleader.outfit_manager.shirt_off and not cheerleader.outfit_manager.pants_off and not cheerleader.outfit_manager.bra_off and not cheerleader.outfit_manager.panties_off:
                    cheerleader.set_current_outfit(coxCheerDefaultSchool)
                else:
                    coxDisdress(oPerson=cheerleader, oNewOutfit=coxCheerDefaultSchool)
            else:
                if cheerleader.current_outfit is not coxCheerDefaultHome:
                    if not cheerleader.outfit_manager.shirt_off and not cheerleader.outfit_manager.pants_off and not cheerleader.outfit_manager.bra_off and not cheerleader.outfit_manager.panties_off:
                        cheerleader.set_current_outfit(coxCheerDefaultHome)
                    else:
                        coxDisdress(oPerson=cheerleader, oNewOutfit=coxCheerDefaultHome)
            return  #endBlc
        
        def coxDayEvents(theDay):
            if theDay == 4 and coxCasualFridayEnabled and coxExtendCasual:
                mom.default_workwear = coxCasualFriday
            elif theDay == 5 and coxCasualFridayEnabled and coxExtendCasual:
                mom.default_workwear = coxWorkSave
            return
            
            

screen coxEmporiumScreen():
    tag bg
    layer "master"
    zorder 1

    use Location_Image(coxBeautyEmporium)

