; WWMI ALPHA-2 INI

; Mod State -------------------------

[Constants]
global $required_wwmi_version = 0.70
global $object_guid = 260355
global $mesh_vertex_count = 88924
global $shapekey_vertex_count = 59359
global $mod_id = -1000
global $mod_enabled = 0
global $object_detected = 0

global persist $top
global persist $bottom
global persist $sleeves
global persist $glasses
global persist $gloves
global persist $belt
global persist $color

[KeyReset]
condition = $object_detected
key = VK_Backspace
$top = 0
$bottom = 0
$sleeves = 0
$glasses = 1
$belt = 0
$color = 1
$gloves = 0

[KeyDress]
condition = $object_detected
key = no_shift VK_UP
type = cycle
$top = 0,1,2,3

[KeyBottom]
condition = $object_detected
key = no_shift VK_DOWN
type = cycle
$bottom = 0,1,2,3,4                    

[KeyBelt]
condition = $object_detected
key = shift VK_DOWN
key = ]
type = cycle
$belt = 0,1

[KeyGlasses]
condition = $object_detected
key = VK_RIGHT
type = cycle
$glasses = 0,1

[KeySleeves]
condition = $object_detected
key = shift VK_LEFT
key = [
type = cycle
$sleeves = 0,1,2

[KeyGloves]
condition = $object_detected
key = no_shift VK_LEFT
type = cycle
$gloves = 0,1

[KeyColor]
condition = $object_detected
key = \
type = cycle
$color = 0,1


[Present]
if $object_detected
	if $mod_enabled
		post $object_detected = 0
	else
		if $mod_id == -1000
			run = CommandListRegisterMod
		endif
	endif
endif

[CommandListRegisterMod]
$\WWMIv1\required_wwmi_version = $required_wwmi_version
$\WWMIv1\object_guid = $object_guid
Resource\WWMIv1\ModName = ref ResourceModName
Resource\WWMIv1\ModAuthor = ref ResourceModAuthor
Resource\WWMIv1\ModDesc = ref ResourceModDesc
Resource\WWMIv1\ModLink = ref ResourceModLink
Resource\WWMIv1\ModLogo = ref ResourceModLogo
run = CommandList\WWMIv1\RegisterMod
$mod_id = $\WWMIv1\mod_id
if $mod_id >= 0
	$mod_enabled = 1
endif

; Resources: Mod Info -------------------------

[ResourceModName]
type = Buffer
data = "ZheZhi OG Toggle"

[ResourceModAuthor]
type = Buffer
data = "LewdLad"

[ResourceModDesc]
type = Buffer
data = "ZheZhi with Full OG Outfit Toggles"

[ResourceModLink]
; type = Buffer
; data = "Empty Mod Link"

[ResourceModLogo]
; filename = Textures/Logo.dds

; Shading: Draw Call Stacks Processing -------------------------

[CommandListTriggerResourceOverrides]
CheckTextureOverride = ps-t0
CheckTextureOverride = ps-t1
CheckTextureOverride = ps-t2
CheckTextureOverride = ps-t3
CheckTextureOverride = ps-t4
CheckTextureOverride = ps-t5
CheckTextureOverride = ps-t6
CheckTextureOverride = ps-t7

[CommandListOverrideSharedResources]
ResourceBypassVB0 = ref vb0
ib = ResourceIndexBuffer
vb0 = ResourcePositionBuffer
vb1 = ResourceVectorBuffer
vb2 = ResourceTexcoordBuffer
vb3 = ResourceColorBuffer
vb4 = ResourceBlendBuffer

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

[TextureOverrideComponent0]
hash = c8b08afd
match_first_index = 0
match_index_count = 15498
$object_detected = 1
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 0
	drawindexed = 15498, 0, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent1]
hash = c8b08afd
match_first_index = 15498
match_index_count = 35877
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 1
	drawindexed = 35877, 15498, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent2]
hash = c8b08afd
match_first_index = 51375
match_index_count = 14727
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 2
	drawindexed = 14727, 51375, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent3]
hash = c8b08afd
match_first_index = 66102
match_index_count = 90996
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources

	; Draw Component 3 Earrings
	drawindexed = 11904, 66102, 0
	; Draw Component 3.Collar
	drawindexed = 1011, 104916, 0

if $gloves == 0
	; Draw Component 3.Gloves
	drawindexed = 23766, 129753, 0
else
	;Draw Component 3.Upper Torso Arms
	drawindexed = 12378, 178389, 0
endif

if $sleeves == 0 || $sleeves == 1
	; Draw Component 3.ShoulderSleeves
	drawindexed = 10422, 162111, 0
endif

if $top == 0
	if $bottom == 0
		; Draw Component 3.Peach InnerSkirt
		drawindexed = 7272, 154839, 0
	endif
	; Draw Component 3.BodySuit
	drawindexed = 6174, 98742, 0
	; Draw Component 3.Dress
	drawindexed = 23826, 105927, 0
	; Draw Component 3.Peach InnerBodySuit
	drawindexed = 1320, 153519, 0
	; Draw Component 3.SideRibbons
	drawindexed = 5856, 172533, 0
	; Draw Component 3 SideButtons
	drawindexed = 20736, 78006, 0
	; Draw Component 3.Upper Torso Nude.FlattenedNipples
	drawindexed = 17550, 208317, 0
else if $top == 1
	if $bottom == 0
		; Draw Component 3.Peach InnerSkirt
		drawindexed = 7272, 154839, 0
	endif
	; Draw Component 3.Dress
	drawindexed = 23826, 105927, 0
	; Draw Component 3.Peach InnerBodySuit
	drawindexed = 1320, 153519, 0
	; Draw Component 3.SideRibbons
	drawindexed = 5856, 172533, 0
	; Draw Component 3 SideButtons
	drawindexed = 20736, 78006, 0
	; Draw Component 3.Upper Torso Nude.FlattenedNipples
	drawindexed = 17550, 208317, 0
else if $top == 2
	if $bottom == 0
		; Draw Component 3.Peach InnerSkirt
		drawindexed = 7272, 154839, 0
	endif
	; Draw Component 3.Dress
	drawindexed = 23826, 105927, 0
	; Draw Component 3.SideRibbons
	drawindexed = 5856, 172533, 0
	; Draw Component 3 SideButtons
	drawindexed = 20736, 78006, 0
	; Draw Component 3.Upper Torso Nude.FlattenedNipples
	drawindexed = 17550, 208317, 0
else if $top == 3
	; Draw Component 3.Upper Torso Nude
	drawindexed = 17550, 190767, 0
endif

	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent4]
hash = c8b08afd
match_first_index = 157098
match_index_count = 97770
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources

	; Draw Component 4.HairRibbons
	drawindexed = 12732, 284277, 0
if $sleeves == 0
	; Draw Component 4.ShoulderSleeves
	drawindexed = 15846, 365973, 0
endif

if $top < 3
	; Draw Component 4 Dress Ribbons
	drawindexed = 11118, 225867, 0
endif

if $belt == 0
	if $top == 3 || $bottom > 0
		; Draw Component 4 Dress Ribbons.Belt.Front
		drawindexed = 288, 239121, 0
	endif
	; Draw Component 4 Dress Ribbons.Belt
	drawindexed = 2136, 236985, 0
	; Draw Component 4.Whetstone
	drawindexed = 5928, 400083, 0
	; Draw Component 4.PaintBrushes
	drawindexed = 28350, 328755, 0
endif

if $bottom == 0
	if $top < 3
		; Draw Component 4.Leggings
		drawindexed = 12012, 303387, 0
	else
		; Draw Component 4.Leggings.Fuller
	drawindexed = 13356, 315399, 0
	endif
else if $bottom == 1
	; Draw Component 4.Leggings.Fuller
	drawindexed = 13356, 315399, 0
else if $bottom == 2
	; Draw Component 4.Panties
	drawindexed = 2268, 357105, 0
	; Draw Component 4 LowerBody Stockings
	drawindexed = 14040, 265923, 0
	; Draw Component 4.Stockings.Shorter
	drawindexed = 9132, 390951, 0
else if $bottom == 3
	; Draw Component 4 LowerBody Stockings
	drawindexed = 14040, 265923, 0
	; Draw Component 4.Stockings.Shorter
	drawindexed = 9132, 390951, 0
else if $bottom == 4
	; Draw Component 4 LowerBody Nude
	drawindexed = 26514, 239409, 0
endif

if $top == 3 && $bottom > 1
	; Draw Component 4 MidTorso Belt
	drawindexed = 942, 279963, 0
endif

if $glasses == 0
	; Draw Component 4.Glasses
	drawindexed = 3372, 280905, 0
endif


	; Draw Component 4.Heels
	drawindexed = 6378, 297009, 0
	; ; Draw Component 4.PlatformHeels
;	drawindexed = 6600, 359373, 0






	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent5]
hash = c8b08afd
match_first_index = 254868
match_index_count = 1938
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 5
	drawindexed = 1938, 406011, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent6]
hash = c8b08afd
match_first_index = 256806
match_index_count = 129
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 6
	drawindexed = 129, 407949, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent7]
hash = c8b08afd
match_first_index = 256935
match_index_count = 3420
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	if $glasses == 0
	; Draw Component 7 Glass.Lenses
	drawindexed = 3420, 408078, 0
	endif

	run = CommandListCleanupSharedResources
endif

; Shading: Textures -------------------------

[ResourceTexture0]
filename = Textures/Components-0 t=16bf75a8.dds

[TextureOverrideTexture0]
hash = 16bf75a8
match_priority = 0
this = ResourceTexture0

[ResourceTexture1]
filename = Textures/Components-0 t=dc383c2f.dds

[TextureOverrideTexture1]
hash = dc383c2f
match_priority = 0
this = ResourceTexture1

[ResourceTexture2]
filename = Textures/Components-0-1-2-3-4 t=ab012b35.dds

[TextureOverrideTexture2]
hash = ab012b35
match_priority = 0
this = ResourceTexture2

[ResourceTexture3]
filename = Textures/Components-0-1-2-3-4-6 t=9f6eaf2e.dds

[TextureOverrideTexture3]
hash = 9f6eaf2e
match_priority = 0
this = ResourceTexture3

[ResourceTexture4]
filename = Textures/Components-0-2-3-4-5 t=5019e88f.dds

[TextureOverrideTexture4]
hash = 5019e88f
match_priority = 0
this = ResourceTexture4

[ResourceTexture5]
filename = Textures/Components-0-2-4-5 t=9122d2f2.dds

[ResourceTexture5B]
filename = Textures/ZheZhiBodyDiffuse.dds

[TextureOverrideTexture5]
hash = 9122d2f2
match_priority = 0
if $color == 1
this = ResourceTexture5
else
this = ResourceTexture5B
endif

[ResourceTexture6]
filename = Textures/Components-0-2-5 t=8383cbbf.dds

[TextureOverrideTexture6]
hash = 8383cbbf
match_priority = 0
this = ResourceTexture6

[ResourceTexture7]
filename = Textures/Components-1 t=2931bfa1.dds

[TextureOverrideTexture7]
hash = 2931bfa1
match_priority = 0
this = ResourceTexture7

[ResourceTexture8]
filename = Textures/Components-1 t=93904edd.dds

[TextureOverrideTexture8]
hash = 93904edd
match_priority = 0
this = ResourceTexture8

[ResourceTexture9]
filename = Textures/Components-1-2 t=a39c7832.dds

[TextureOverrideTexture9]
hash = a39c7832
match_priority = 0
this = ResourceTexture9

[ResourceTexture10]
filename = Textures/Components-2 t=26045936.dds

[TextureOverrideTexture10]
hash = 26045936
match_priority = 0
this = ResourceTexture10

[ResourceTexture11]
filename = Textures/Components-2 t=e5393d0e.dds

[TextureOverrideTexture11]
hash = e5393d0e
match_priority = 0
this = ResourceTexture11

[ResourceTexture12]
filename = Textures/Components-2-5 t=435d999a.dds

[TextureOverrideTexture12]
hash = 435d999a
match_priority = 0
this = ResourceTexture12

[ResourceTexture13]
filename = Textures/Components-3 t=2c9428d3.dds

[TextureOverrideTexture13]
hash = 2c9428d3
match_priority = 0
this = ResourceTexture13

[ResourceTexture14]
filename = Textures/Components-3 t=7c43fcc6.dds

[TextureOverrideTexture14]
hash = 7c43fcc6
match_priority = 0
this = ResourceTexture14

[ResourceTexture15]
filename = Textures/Components-3 t=815d50a9.dds

[TextureOverrideTexture15]
hash = 815d50a9
match_priority = 0
if $color == 1
this = ResourceTexture15
else
this = ResourceTexture5B
endif

[ResourceTexture16]
filename = Textures/Components-3 t=e2ff72ff.dds

[TextureOverrideTexture16]
hash = e2ff72ff
match_priority = 0
if $color == 1
this = ResourceTexture16
else
this = ResourceTexture5B
endif

[ResourceTexture17]
filename = Textures/Components-4 t=019776db.dds

[TextureOverrideTexture17]
hash = 019776db
match_priority = 0
this = ResourceTexture17

[ResourceTexture18]
filename = Textures/Components-4 t=04f24eb9.dds

[TextureOverrideTexture18]
hash = 04f24eb9
match_priority = 0
this = ResourceTexture18

[ResourceTexture19]
filename = Textures/Components-4 t=8427b202.dds

[TextureOverrideTexture19]
hash = 8427b202
match_priority = 0
this = ResourceTexture19

[ResourceTexture20]
filename = Textures/Components-5 t=a28f18f6.dds

[TextureOverrideTexture20]
hash = a28f18f6
match_priority = 0
this = ResourceTexture20

[ResourceTexture21]
filename = Textures/Components-6 t=c235c6a7.dds

[TextureOverrideTexture21]
hash = c235c6a7
match_priority = 0
this = ResourceTexture21

[ResourceTexture22]
filename = Textures/Components-7 t=14df60bb.dds

[TextureOverrideTexture22]
hash = 14df60bb
match_priority = 0
this = ResourceTexture22

; Skinning: Shape Keys Override -------------------------

[TextureOverrideShapeKeyOffsets]
hash = 4cdc5987
match_priority = 0
override_byte_stride = 24
override_vertex_count = $mesh_vertex_count

[TextureOverrideShapeKeyScale]
hash = 7ebe61e9
match_priority = 0
override_byte_stride = 4
override_vertex_count = $mesh_vertex_count

[CommandListSetupShapeKeys]
$\WWMIv1\shapekey_checksum = 2453
cs-t33 = ResourceShapeKeyOffsetBuffer
cs-u5 = ResourceCustomShapeKeyValuesRW
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyOverrider

[CommandListLoadShapeKeys]
$\WWMIv1\shapekey_vertex_count = $shapekey_vertex_count
cs-t0 = ResourceShapeKeyVertexIdBuffer
cs-t1 = ResourceShapeKeyVertexOffsetBuffer
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyLoader

[TextureOverrideShapeKeyLoaderCallback]
hash = 4cdc5987
match_priority = 0
if $mod_enabled
	if cs == 3381.3333
		handling = skip
		run = CommandListSetupShapeKeys
		run = CommandListLoadShapeKeys
	endif
endif

[CommandListMultiplyShapeKeys]
$\WWMIv1\custom_vertex_count = $mesh_vertex_count
run = CustomShader\WWMIv1\ShapeKeyMultiplier

[TextureOverrideShapeKeyMultiplierCallback]
hash = 4cdc5987
match_priority = 0
if $mod_enabled
	if cs == 3381.4444
		handling = skip
		run = CommandListMultiplyShapeKeys
	endif
endif

; Resources: Shape Keys Override -------------------------

[ResourceShapeKeyCBRW]
type = RWBuffer
format = R32G32B32A32_UINT
array = 66

[ResourceCustomShapeKeyValuesRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 32

; Resources: Buffers -------------------------

[ResourceBypassVB0]

[ResourceIndexBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 12
filename = Meshes/Index.buf

[ResourcePositionBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32_FLOAT
stride = 12
filename = Meshes/Position.buf

[ResourceBlendBuffer]
type = Buffer
format = DXGI_FORMAT_R8_UINT
stride = 8
filename = Meshes/Blend.buf

[ResourceVectorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_SNORM
stride = 8
filename = Meshes/Vector.buf

[ResourceColorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_UNORM
stride = 4
filename = Meshes/Color.buf

[ResourceTexCoordBuffer]
type = Buffer
format = DXGI_FORMAT_R16G16_FLOAT
stride = 16
filename = Meshes/TexCoord.buf

[ResourceShapeKeyOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32A32_UINT
stride = 16
filename = Meshes/ShapeKeyOffset.buf

[ResourceShapeKeyVertexIdBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 4
filename = Meshes/ShapeKeyVertexId.buf

[ResourceShapeKeyVertexOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R16_FLOAT
stride = 2
filename = Meshes/ShapeKeyVertexOffset.buf

; Autogenerated -------------------------

; This mod.ini was automatically generated by WWMI Tools Blender addon v0.9.0 and requires WWMI v0.7.0+ to function
; WWMI GameBanana: https://gamebanana.com/tools/17252
; WWMI Tools GameBanana: https://gamebanana.com/tools/17289
; WWMI GitHub: https://github.com/SpectrumQT/WWMI
; WWMI Tools GitHub: https://github.com/SpectrumQT/WWMI_Tools
; AGMG Modding Community Discord: https://discord.com/invite/agmg

; SHA256 CHECKSUM: 7b54fd30326631f750413c782b2d9e2701ea54be31aa674103c85d3df5e9fd9b
