local TABAS_Sprites = require("TABAS_Sprites")

local TABAS_Compat = {}
TABAS_Compat.Tiles = {}
TABAS_Compat.Exclude = {}

function TABAS_Compat.Tiles.AddBathTubTiles(bathTable)
    TABAS_Sprites.Bathtub[bathTable.groupName] = {}
    for dir, bathSprites in pairs(bathTable.sprites) do
        TABAS_Sprites.Bathtub[bathTable.groupName][dir] = bathSprites
    end
end

function TABAS_Compat.Tiles.AddShowerTiles(showerTable)
    TABAS_Sprites.Shower[showerTable.groupName] = {}
    for dir, sprite in pairs(showerTable.sprites) do
        TABAS_Sprites.Shower[showerTable.groupName][dir] = sprite
    end
end

-- function TABAS_Compat.Tiles.AddBathWaterSprite(name, dir, bFaucet, low, halfLow, half, full, bDirty, d_low, d_halfLow, d_half, d_full)
--     if TABAS_Sprites[name] then
--         print("Water sprite name already exists! :"  .. name)
--         return
--     end
--     if not (dir == "S" or dir == "E" or dir == "N" or dir == "W") then
--         print("Invalid sprite direction!")
--         return
--     end
--     local direction = "sprite" .. dir
--     local key = bFaucet and "faucet" or "tub"
--     TABAS_Sprites[name] = {}
--     TABAS_Sprites[name][direction] = {}
--     TABAS_Sprites[name][direction][key] = {low = low, halfLow=halfLow, half=half, full=full}
--     if bDirty then
--         TABAS_Sprites[name][direction][key].dirty = {low = d_low, halfLow=d_halfLow, half=d_half, full=d_full}
--     end
-- end


-- ** If you want your mod's bath and shower tiles to work with this mod. **
local cleanbath = {
    groupName = "Large Deluxe Clean",
    sprites = {
        spriteS = {faucet="tabas_fixtures_bathroom_01_25", tub="tabas_fixtures_bathroom_01_24"},
        spriteE = {faucet="tabas_fixtures_bathroom_01_26", tub="tabas_fixtures_bathroom_01_27"},
        spriteN = {faucet="tabas_fixtures_bathroom_01_52", tub="tabas_fixtures_bathroom_01_53"},
        spriteW = {faucet="tabas_fixtures_bathroom_01_55", tub="tabas_fixtures_bathroom_01_54"}
    }
}
TABAS_Compat.Tiles.AddBathTubTiles(cleanbath)

-- ** This example for add shower. **
-- local showerExamples = {
    -- groupName = "Examples",
    -- sprites = {
        -- spriteS = "fixtures_bathroom_01_25",
        -- spriteE = "fixtures_bathroom_01_26",
        -- spriteN = "fixtures_bathroom_01_52",
        -- spriteW = "fixtures_bathroom_01_55",
    -- }
-- }
-- TABAS_Compat.Tiles.AddShowerTiles(showerExamples)

-- ** Also you can add it in this format. **
TABAS_Sprites.Shower["Deluxe"] = TABAS_Sprites.Shower["Deluxe"] or {}
TABAS_Sprites.Shower["Deluxe"].spriteN = "fixtures_bathroom_01_70"
TABAS_Sprites.Shower["Deluxe"].spriteW = "fixtures_bathroom_01_71"



TABAS_Compat.Exclude.AccessoryLocations = {
    "BellyButton",
    "EarTop",
    "Ears",
    "LeftWrist",
    "Left_MiddleFinger",
    "Left_RingFinger",
    "Necklace",
    "Necklace_Long",
    "Nose",
    "RightWrist",
    "Right_MiddleFinger",
    "Right_RingFinger",
}

TABAS_Compat.Exclude.BodyLocations = {
    "MakeUp_FullFace",
    "MakeUp_Eyes",
    "MakeUp_EyesShadow",
    "MakeUp_Lips",
    "Bandage",
    "Wound",
    "ZedDmg",
}

TABAS_Compat.Exclude.BathWear = {
    "Base.TowelHat", -- From Bathtowel Overhaul - Wearable Addon
    "Base.TowelBottom",
    "Base.TowelTop",
    "Base.Hat_ShowerCap" -- Base item
}



function TABAS_Compat.Exclude.AddExcludeAccessoryLocations(bodyLocation)
    table.insert(TABAS_Compat.Exclude.AccessoryLocations, bodyLocation)
end

function TABAS_Compat.Exclude.AddExcludeBodyLocations(bodyLocation)
    table.insert(TABAS_Compat.Exclude.BodyLocations, bodyLocation)
end

-- Add bodyLocations to exclude from auto undress when bathing.
-- Note: If you want to exclude a bodyLocation that is not in the list above,
TABAS_Compat.Exclude.AddExcludeBodyLocations("BodyGrime")
TABAS_Compat.Exclude.AddExcludeBodyLocations("BodyShampoo")
-- --There bodyLocations added from this mod, but them patches actually not be necessary because it doesn't have a DisplayName.


return TABAS_Compat