[Constants]
global persist $pinchos_bra = 0
global persist $pinchos_panty = 0
global persist $pinchos_apron = 0
global persist $pinchos_collar = 0
global $mod_active = 0
global $slot_active = 0
global $id = 3729004
post run = CommandListLoadDefault

[Present]
post $mod_active = 0

[KeySwitchSlot1]
condition = $\mods\_id\id.ini\swimsuit1 == $id && $mod_active == 1
key = ctrl no_shift no_alt 1
type = cycle
$slot_active = 1, 0
run = CommandListSlot1, CommandListSlot0
[KeySwitchSlot2]
condition = $\mods\_id\id.ini\swimsuit2 == $id && $mod_active == 1
key = ctrl no_shift no_alt 2
type = cycle
$slot_active = 1, 0
run = CommandListSlot1, CommandListSlot0

[CommandListSlot1]
Resource\ShaderFixes\help.ini\Notification = ref ResourceSlot1
run = CustomShader\ShaderFixes\help.ini\FormatText
$\ShaderFixes\help.ini\notification_timeout = time + 2.0
[CommandListSlot0]
Resource\ShaderFixes\help.ini\Notification = ref ResourceSlot0
run = CustomShader\ShaderFixes\help.ini\FormatText
$\ShaderFixes\help.ini\notification_timeout = time + 2.0

[ResourceSlot1]
type = Buffer
data = "Appetizer Pinchos (Misaki/Tamaki/Fiona) Variation: On"
[ResourceSlot0]
type = Buffer
data = "Appetizer Pinchos (Misaki/Tamaki/Fiona) Variation: Off"

[CommandListID]
$\mods\_id\id.ini\swimsuit2 = $\mods\_id\id.ini\swimsuit1
$\mods\_id\id.ini\swimsuit1 = $id

;Swap Body
[TextureOverride Body]
if $\mods\_id\id.ini\swimsuit1 != $id && $\mods\_id\id.ini\swimsuit2 != $id
	run = CommandListID
endif
hash = d7a4eb46
match_first_index = 0
vb0 = ResourceBodyV
ib = ResourceBodyI
handling = skip
drawindexed = auto
$mod_active = 1


;Override & Lock Default Top
;run = CommandList1
;Override & Lock Default Panty
;run = CommandList1P
;Override & Lock Default Apron
;run = CommandList1B
;Override & Lock Default Collar
;run = CommandList1N


[CommandListLoadDefault]
if $pinchos_bra == 0
	run = CommandList0
elif $pinchos_bra == 1
	run = CommandList1
elif $pinchos_bra == 2
	run = CommandList2
elif $pinchos_bra == 3
	run = CommandList3
endif
if $pinchos_panty == 0
	run = CommandList0P
elif $pinchos_panty == 1
	run = CommandList1P
endif

if $pinchos_apron == 0
	run = CommandList0B
elif $pinchos_apron == 1
	run = CommandList1B
endif

if $pinchos_collar == 0
	run = CommandList0N
elif $pinchos_collar == 1
	run = CommandList1N
endif

[ShaderOverridePS]
hash = 7afeeb590579796f
allow_duplicate_hash = overrule
if $costume_mods && $mod_active == 1
	ResourceBakVB = ref vb0
	ResourceBakIB = ref ib
	checktextureoverride = vb0
	checktextureoverride = ib
	vb0 = ref ResourceBakVB
	ib = ref ResourceBakIB
endif

;Key to change Top
[KeyCycle1]
condition = $mod_active == 1 && $slot_active == 1
Key = shift no_ctrl no_alt x
type = cycle
run = CommandList1, CommandList2, CommandList3, CommandList0
[CommandList0]
$pinchos_bra = 0
ResourceBraV = ref ResourceBraV1
ResourceBraI = ref ResourceBraI1
ResourceBraTopLaceV = ref ResourceBraTopLaceV1
ResourceBraTopLaceI = ref ResourceBraTopLaceI1
ResourceBraBottomLaceV = ref ResourceBraBottomLaceV1
ResourceBraBottomLaceI = ref ResourceBraBottomLaceI1
ResourceBraAccsV = ref ResourceBraAccsV1
ResourceBraAccsI = ref ResourceBraAccsI1
[CommandList1]
$pinchos_bra = 1
ResourceBraV = ref ResourceBraV2
ResourceBraI = ref ResourceBraI2
ResourceBraTopLaceV = ref ResourceBraTopLaceV2
ResourceBraTopLaceI = ref ResourceBraTopLaceI2
ResourceBraBottomLaceV = ref ResourceBraBottomLaceV2
ResourceBraBottomLaceI = ref ResourceBraBottomLaceI2
ResourceBraAccsV = ref ResourceBraAccsV2
ResourceBraAccsI = ref ResourceBraAccsI2
[CommandList2]
$pinchos_bra = 2
ResourceBraV = ref ResourceBraV3
ResourceBraI = ref ResourceBraI3
ResourceBraTopLaceV = ref ResourceBraTopLaceV2
ResourceBraTopLaceI = ref ResourceBraTopLaceI2
ResourceBraBottomLaceV = ref ResourceBraBottomLaceV2
ResourceBraBottomLaceI = ref ResourceBraBottomLaceI2
ResourceBraAccsV = ref ResourceBraAccsV3
ResourceBraAccsI = ref ResourceBraAccsI3
[CommandList3]
$pinchos_bra = 3

;Key to change Panty
[KeyCycle2]
condition = $mod_active == 1 && $slot_active == 1
Key = no_shift ctrl no_alt x
type = cycle
run = CommandList1P, CommandList0P
[CommandList0P]
$pinchos_panty = 0
ResourcePantyV = ref ResourcePantyV1
ResourcePantyI = ref ResourcePantyI1
ResourcePantyLaceV = ref ResourcePantyLaceV1
ResourcePantyLaceI = ref ResourcePantyLaceI1
[CommandList1P]
$pinchos_panty = 1

;Key to change Apron
[KeyCycle3]
condition = $mod_active == 1 && $slot_active == 1
Key = no_shift ctrl no_alt z
type = cycle
run = CommandList1B, CommandList0B
[CommandList0B]
$pinchos_apron = 0
ResourceBeltV = ref ResourceBeltV1
ResourceBeltI = ref ResourceBeltI1
ResourceApronV = ref ResourceApronV1
ResourceApronI = ref ResourceApronI1
[CommandList1B]
$pinchos_apron = 1

;Key to change Collar
[KeyCycle4]
condition = $mod_active == 1 && $slot_active == 1
Key = shift no_ctrl no_alt z
type = cycle
run = CommandList1N, CommandList0N
[CommandList0N]
$pinchos_collar = 0
ResourceCollarV = ref ResourceCollarV1
ResourceCollarI1 = ref ResourceCollarI1
[CommandList1N]
$pinchos_collar = 1

;Swap Top
[TextureOverride Bra1]
hash = d1dfaef7
handling = skip
match_first_index = 2004
if $pinchos_bra < 3
	vb0 = ResourceBraV
	ib = ResourceBraI
	drawindexed = auto
endif
[TextureOverride Bra2]
hash = d1dfaef7
match_first_index = 0
handling = skip
if $pinchos_bra < 3
	vb0 = ResourceBraTopLaceV unless_null
	ib = ResourceBraTopLaceI unless_null
	drawindexed = auto
endif
[TextureOverride Bra3]
hash = d1dfaef7
match_first_index = 21693
handling = skip
if $pinchos_bra < 3
	vb0 = ResourceBraBottomLaceV unless_null
	ib = ResourceBraBottomLaceI unless_null
	drawindexed = auto
endif
[TextureOverride Bra4]
hash = d1dfaef7
match_first_index = 16311
handling = skip
if $pinchos_bra < 3
	vb0 = ResourceBraAccsV
	ib = ResourceBraAccsI
	drawindexed = auto
endif

;Remove Bra Accs
[TextureOverride Bra5]
hash = d1dfaef7
match_first_index = 19767
if $pinchos_bra >= 2
	handling = skip
endif

;Swap Panty
[TextureOverride Panty1]
hash = d1dfaef7
handling = skip
match_first_index = 2004
if $pinchos_panty == 0
	vb0 = ResourcePantyV unless_null
	ib = ResourcePantyI unless_null
	drawindexed = auto
endif
[TextureOverride Panty2]
hash = d1dfaef7
match_first_index = 0
handling = skip
if $pinchos_panty == 0
	vb0 = ResourcePantyLaceV unless_null
	ib = ResourcePantyLaceI unless_null
	drawindexed = auto
endif
[TextureOverride Panty3]
hash = d1dfaef7
match_first_index = 21495
if $pinchos_panty == 1
	handling = skip
endif
[TextureOverride Panty4]
hash = d1dfaef7
match_first_index = 1524
if $pinchos_panty == 1
	handling = skip
endif
[TextureOverride Panty5]
hash = d1dfaef7
match_first_index = 16071
if $pinchos_panty == 1
	handling = skip
endif

;Swap Belt
[TextureOverride Belt]
hash = fa67fb60
match_first_index = 0
handling = skip
if $pinchos_apron == 0
	vb0 = ResourceBeltV unless_null
	ib = ResourceBeltI unless_null
	drawindexed = auto
endif
[TextureOverride Belt Ribbon]
hash = fa67fb60
match_first_index = 2208
if $pinchos_apron == 1
	handling = skip
endif

[TextureOverride Belt Ribbon2]
hash = fa67fb60
match_first_index = 1824
if $pinchos_apron == 1
	handling = skip
endif

;Swap Apron
[TextureOverride Apron]
hash = fa67fb60
match_first_index = 5628
handling = skip
if $pinchos_apron == 0
	vb0 = ResourceApronV unless_null
	ib = ResourceApronI unless_null
	drawindexed = auto
endif
[TextureOverride Apron Ribbon]
hash = fa67fb60
match_first_index = 9651
if $pinchos_apron == 1
	handling = skip
endif
[TextureOverride Apron Accs]
hash = fa67fb60
match_first_index = 11625
if $pinchos_apron == 1
	handling = skip
endif

;Swap Collar
[TextureOverride Collar 1]
hash = 7df46beb
match_first_index = 1530
handling = skip
if $pinchos_collar == 0
	vb0 = ResourceCollarV unless_null
	ib = ResourceCollarI unless_null
	drawindexed = auto
endif
[TextureOverride Collar 2]
hash = 7df46beb
match_first_index = 6435
if $pinchos_collar > 0
	handling = skip
endif
[TextureOverride Collar 3]
hash = 7df46beb
match_first_index = 3660
if $pinchos_collar > 0
	handling = skip
endif
[TextureOverride Collar 4]
hash = 7df46beb
match_first_index = 4902
if $pinchos_collar > 0
	handling = skip
endif

;Resources
[ResourceBodyV]
type = Buffer
stride = 80
filename = resources\body.vb
[ResourceBodyI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\body.ib
[ResourceBraV]
type = Buffer
stride = 76
filename = resources\braMod.vb
[ResourceBraI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braMod.ib
[ResourceBraV1]
type = Buffer
stride = 76
filename = resources\braMod.vb
[ResourceBraI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braMod.ib
[ResourceBraV2]
type = Buffer
stride = 76
filename = resources\braMod2.vb
[ResourceBraI2]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braMod2.ib
[ResourceBraV3]
type = Buffer
stride = 76
filename = resources\braMod3.vb
[ResourceBraI3]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braMod3.ib
[ResourceBraTopLaceV]
type = Buffer
stride = 76
filename = resources\braTopLaceMod.vb
[ResourceBraTopLaceI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braTopLaceMod.ib
[ResourceBraTopLaceV1]
type = Buffer
stride = 76
filename = resources\braTopLaceMod.vb
[ResourceBraTopLaceI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braTopLaceMod.ib
[ResourceBraTopLaceV2]
type = Buffer
stride = 76
filename = resources\braTopLaceMod2.vb
[ResourceBraTopLaceI2]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braTopLaceMod2.ib
[ResourceBraBottomLaceV]
type = Buffer
stride = 76
filename = resources\braBottomLaceMod.vb
[ResourceBraBottomLaceI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braBottomLaceMod.ib
[ResourceBraBottomLaceV1]
type = Buffer
stride = 76
filename = resources\braBottomLaceMod.vb
[ResourceBraBottomLaceI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braBottomLaceMod.ib
[ResourceBraBottomLaceV2]
type = Buffer
stride = 76
filename = resources\braBottomLaceMod2.vb
[ResourceBraBottomLaceI2]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braBottomLaceMod2.ib
[ResourceBraAccsV]
type = Buffer
stride = 76
filename = resources\braAccsMod.vb
[ResourceBraAccsI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braAccsMod.ib
[ResourceBraAccsV1]
type = Buffer
stride = 76
filename = resources\braAccsMod.vb
[ResourceBraAccsI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braAccsMod.ib
[ResourceBraAccsV2]
type = Buffer
stride = 76
filename = resources\braAccsMod2.vb
[ResourceBraAccsI2]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braAccsMod2.ib
[ResourceBraAccsV3]
type = Buffer
stride = 76
filename = resources\braAccsMod3.vb
[ResourceBraAccsI3]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\braAccsMod3.ib
[ResourcePantyV]
type = Buffer
stride = 76
filename = resources\panty.vb
[ResourcePantyI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\panty.ib
[ResourcePantyV1]
type = Buffer
stride = 76
filename = resources\panty.vb
[ResourcePantyI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\panty.ib
[ResourcePantyLaceV]
type = Buffer
stride = 76
filename = resources\pantyLace.vb
[ResourcePantyLaceI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\pantyLace.ib
[ResourcePantyLaceV1]
type = Buffer
stride = 76
filename = resources\pantyLace.vb
[ResourcePantyLaceI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\pantyLace.ib
[ResourceBeltV]
type = Buffer
stride = 76
filename = resources\beltMod.vb
[ResourceBeltI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\beltMod.ib
[ResourceBeltV1]
type = Buffer
stride = 76
filename = resources\beltMod.vb
[ResourceBeltI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\beltMod.ib
[ResourceApronV]
type = Buffer
stride = 76
filename = resources\apronMod.vb
[ResourceApronI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\apronMod.ib
[ResourceApronV1]
type = Buffer
stride = 76
filename = resources\apronMod.vb
[ResourceApronI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\apronMod.ib
[ResourceCollarV]
type = Buffer
stride = 76
filename = resources\collarMod.vb
[ResourceCollarI]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\collarMod.ib
[ResourceCollarV1]
type = Buffer
stride = 76
filename = resources\collarMod.vb
[ResourceCollarI1]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = resources\collarMod.ib