[Constants]
global persist $var1 = 0
global persist $var2 = 0
global persist $var3 = 0
global persist $var4 = 0
global persist $var5 = 0
global $active = 0

[Present]
post $active = 0

[KeySwitchVar1]
condition = $active
Key = ctrl no_shift no_alt x
type = cycle
$var1 = 0,1,2,3,4,5
; Bra : Org. -> No Upper Straps -> No Lower Straps -> No Straps -> Minimal -> Topless

[KeySwitchVar2]
condition = $active
Key = ctrl no_shift no_alt z
type = cycle
$var2 = 0,1,2,3
; Cape/Arm : Org. -> Cape Only -> Arm Clothing Only -> None

[KeySwitchVar3]
condition = $active
Key = ctrl no_shift no_alt c
type = cycle
$var3 = 0,1,2,3
; Panty : Org. -> Lesser Strap (2-Step) -> No Panty

[KeySwitchVar4]
condition = $active
Key = ctrl no_shift no_alt v
type = cycle
$var4 = 0,1,2
; Ankle/Shoes : Org. -> No Snow Foams/Balls -> No Shoes

[KeySwitchVar5]
condition = $active
Key = ctrl no_shift no_alt a
type = cycle
$var5 = 0,1
; Tail : On/Off

; Cape/Arm
[TextureOverrideCape99]
hash = 4d349efc
if $var2 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideArms99]
hash = 50e01273
if ($var2 == 1 || $var2 == 3) && ($active || $shader_type == 5)
    handling = skip
endif

; Bra
[TextureOverrideBra01]
hash = f419229d
match_first_index = 4917
if ($active || $shader_type == 5)
    handling = skip
    if $var1 < 4
        if $var1 == 3
            vb0 = ResourceBraA2VB
            ib  = ResourceBraA2IB
        else
            vb0 = ResourceBraAVB
            ib  = ResourceBraAIB
        endif
        drawindexed = auto
    endif
endif

[TextureOverrideBra02]
hash = f419229d
match_first_index = 0
if ($active || $shader_type == 5)
    handling = skip
    if ($var1 == 0 || $var1 == 1 || $var1 == 4)
        vb0 = ResourceBraBVB
        ib  = ResourceBraBIB
        drawindexed = auto
    endif
    if ($var1 == 0 || $var1 == 2 || $var1 == 4)
        vb0 = ResourceBraCVB
        ib  = ResourceBraCIB
        drawindexed = auto
    endif
endif

[TextureOverrideBra03]
hash = 15bff1df
match_first_index = 0
if ($active || $shader_type == 5)
    handling = skip
    if $var1 < 4
        vb0 = ResourceBraDVB
        ib  = ResourceBraDIB
        drawindexed = auto
    endif
endif

; Panty
[TextureOverridePanty01]
hash = 67a92442
match_first_index = 0
if ($active || $shader_type == 5)
    handling = skip
    if $var3 <= 2
        if $var3 == 2
            vb0 = ResourcePantyA3VB
            ib  = ResourcePantyA3IB
        elif $var3 == 1
            vb0 = ResourcePantyA2VB
            ib  = ResourcePantyA2IB
        else
            vb0 = ResourcePantyAVB
            ib  = ResourcePantyAIB
        endif
        drawindexed = auto
    endif
endif

[TextureOverridePanty02]
hash = 67a92442
match_first_index = 7929
if $var3 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverridePanty03]
hash = 67a92442
match_first_index = 6897
if $var3 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideTails99]
hash = 9ee3d689
if ($var5 > 0 || $var3 > 2) && ($active || $shader_type == 5)
    handling = skip
endif

; Ankle/Shoes : f78c9c61 VBH
[TextureOverrideAnkleRing01]
hash = f78c9c61
match_first_index = 2220
if $var4 > 0 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideAnkleRing02]
hash = f78c9c61
match_first_index = 7950
if $var4 > 0 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoesFoam01]
hash = f78c9c61
match_first_index = 5100
if $var4 > 0 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoesFoam02]
hash = f78c9c61
match_first_index = 10830
if $var4 > 0 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoes01]
hash = f78c9c61
match_first_index = 6252
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoes02]
hash = f78c9c61
match_first_index = 12756
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoes03]
hash = f78c9c61
match_first_index = 1110
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoes04]
hash = f78c9c61
match_first_index = 11982
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoes05]
hash = f78c9c61
match_first_index = 0
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideShoes06]
hash = f78c9c61
match_first_index = 13872
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
endif

[TextureOverrideStocking01]
hash = 52228fbf
match_first_index = 5154
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
    if $var4 == 2
        vb0 = ResourceStockingAVB
        ib  = ResourceStockingAIB
        drawindexed = auto
    endif
endif

[TextureOverrideStocking02]
hash = b65bef43
match_first_index = 1590
if $var4 > 1 && ($active || $shader_type == 5)
    handling = skip
    if $var4 == 2
        vb0 = ResourceStockingBVB
        ib  = ResourceStockingBIB
        drawindexed = auto
    endif
endif

; Body
[TextureOverrideBody]
hash = 1acec895
match_first_index = 0
$active = 1
handling = skip
vb0 = ResourceBody1VB
ib  = ResourceBody1IB
drawindexed = auto

; Resources
[ResourceBody1VB]
type = Buffer
stride = 80
filename = resources\body_1.vb
[ResourceBody1IB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\body_1.ib

[ResourcePantyAVB]
type = Buffer
stride = 76
filename = resources\Panty_A.vb
[ResourcePantyAIB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Panty_A.ib

[ResourcePantyA2VB]
type = Buffer
stride = 76
filename = resources\Panty_A_2.vb
[ResourcePantyA2IB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Panty_A_2.ib

[ResourcePantyA3VB]
type = Buffer
stride = 76
filename = resources\Panty_A_3.vb
[ResourcePantyA3IB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Panty_A_3.ib

[ResourceStockingAVB]
type = Buffer
stride = 76
filename = resources\Stocking_A.vb
[ResourceStockingAIB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Stocking_A.ib

[ResourceStockingBVB]
type = Buffer
stride = 76
filename = resources\Stocking_B.vb
[ResourceStockingBIB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Stocking_B.ib

[ResourceBraAVB]
type = Buffer
stride = 76
filename = resources\Bra_A.vb
[ResourceBraAIB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Bra_A.ib

[ResourceBraA2VB]
type = Buffer
stride = 76
filename = resources\Bra_A_2.vb
[ResourceBraA2IB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Bra_A_2.ib

[ResourceBraBVB]
type = Buffer
stride = 76
filename = resources\Bra_B.vb
[ResourceBraBIB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Bra_B.ib

[ResourceBraCVB]
type = Buffer
stride = 76
filename = resources\Bra_C.vb
[ResourceBraCIB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Bra_C.ib

[ResourceBraDVB]
type = Buffer
stride = 76
filename = resources\Bra_D.vb
[ResourceBraDIB]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\Bra_D.ib
