; WWMI ALPHA-2 INI

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

[Constants]
global $required_wwmi_version = 0.70
global $object_guid = 120096
global $mesh_vertex_count = 130581
global $shapekey_vertex_count = 24891
global $mod_id = -1000
global $state_id = 0
global $mod_enabled = 0
global $object_detected = 0
global persist $key0=0
global persist $key1=0
global persist $key2=0
global persist $key3=0
global persist $key4=0
global persist $key5=0
[key0]
condition= $object_detected
key=5
type = cycle
$key0=0,1
[key1]
condition= $object_detected
key=6
type = cycle
$key1=0,1
[key2]
condition= $object_detected
key=7
type = cycle
$key2=0,1,2,3,4,5
[key3]
condition= $object_detected
key=8
type = cycle
$key3=0,1,2
[key4]
condition= $object_detected
key=9
type = cycle
$key4=0,1
[key5]
condition= $object_detected
key=0
type = cycle
$key5=0,1


if $key5 == 1
$key1=0
$key2=0
$key3=0
$key4=0
$key0=0
endif
[Present]
if $object_detected
	if $mod_enabled
		post $object_detected = 0
		run = CommandListUpdateMergedSkeleton
	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

[CommandListUpdateMergedSkeleton]
if $state_id
	$state_id = 0
else
	$state_id = 1
endif
ResourceMergedSkeleton = copy ResourceMergedSkeletonRW
ResourceExtraMergedSkeleton = copy ResourceExtraMergedSkeletonRW

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

[ResourceModName]
type = Buffer
data = "Unnamed Mod"

[ResourceModAuthor]
type = Buffer
data = "if可否"

[ResourceModDesc]
; type = Buffer
; data = "Empty Mod Description"

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

[ResourceModLogo]
; filename = Textures/Logo.dds

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

[TextureOverrideMarkBoneDataCB]
hash = f02baf77
match_priority = 0
filter_index = 3381.7777

[CommandListMergeSkeleton]
$\WWMIv1\custom_mesh_scale = 1.0
cs-cb8 = ref vs-cb4
cs-u6 = ResourceMergedSkeletonRW
run = CustomShader\WWMIv1\SkeletonMerger
cs-cb8 = ref vs-cb3
cs-u6 = ResourceExtraMergedSkeletonRW
run = CustomShader\WWMIv1\SkeletonMerger

[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
CheckTextureOverride = vs-cb3
CheckTextureOverride = vs-cb4

[CommandListOverrideSharedResources]
ResourceBypassVB0 = ref vb0
ib = ResourceIndexBuffer
vb0 = ResourcePositionBuffer
vb1 = ResourceVectorBuffer
vb2 = ResourceTexcoordBuffer
vb3 = ResourceColorBuffer
vb4 = ResourceBlendBuffer
if vs-cb3 == 3381.7777
	vs-cb3 = ResourceExtraMergedSkeleton
endif
if vs-cb4 == 3381.7777
	vs-cb4 = ResourceMergedSkeleton
endif

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

[TextureOverrideComponent0]
hash = 249200ff
match_first_index = 0
match_index_count = 9546
$object_detected = 1
if $mod_enabled
	local $state_id_0
	if $state_id_0 != $state_id
		$state_id_0 = $state_id
		$\WWMIv1\vg_offset = 0
		$\WWMIv1\vg_count = 13
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 0
		drawindexed = 9546, 0, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent1]
hash = 249200ff
match_first_index = 9546
match_index_count = 17544
if $mod_enabled
	local $state_id_1
	if $state_id_1 != $state_id
		$state_id_1 = $state_id
		$\WWMIv1\vg_offset = 13
		$\WWMIv1\vg_count = 19
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 1
		drawindexed = 17544, 9546, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent2]
hash = 249200ff
match_first_index = 27090
match_index_count = 11328
if $mod_enabled
	local $state_id_2
	if $state_id_2 != $state_id
		$state_id_2 = $state_id
		$\WWMIv1\vg_offset = 32
		$\WWMIv1\vg_count = 1
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 2
		drawindexed = 11328, 27090, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent3]
hash = 249200ff
match_first_index = 38418
match_index_count = 14595
if $mod_enabled
	local $state_id_3
	if $state_id_3 != $state_id
		$state_id_3 = $state_id
		$\WWMIv1\vg_offset = 33
		$\WWMIv1\vg_count = 46
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 3
		drawindexed = 240513, 38418, 0
		; Draw Component 3.003
		;高跟鞋
		if $key0 == 0
		drawindexed = 295278, 278931, 0
		endif
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent4]
hash = 249200ff
match_first_index = 53013
match_index_count = 35373
if $mod_enabled
	local $state_id_4
	if $state_id_4 != $state_id
		$state_id_4 = $state_id
		$\WWMIv1\vg_offset = 79
		$\WWMIv1\vg_count = 61
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources

        ;【项圈】
        if $key1 ==0 && $key2!=1
		; Draw Component 4.001
		drawindexed = 3660, 574209, 0
        else if $key1 == 1
        ; Draw Component 4.008
		drawindexed = 9540, 620157, 0
		else 
		drawindexed = 9540, 620157, 0
        endif
        ;【胸罩】
        if $key2 ==0
		; Draw Component 4.004
		drawindexed = 3450, 588378, 0
        else if $key2==1
		; Draw Component 4.005
		drawindexed = 12501, 591828, 0
        else if $key2 ==2
		; Draw Component 4.006
		drawindexed = 11484, 604329, 0
		else if $key2 == 3
		drawindexed = 11022, 629697, 0
        endif

		;【裤子】
        if $key3==1
		; Draw Component 4.007
		drawindexed = 4344, 615813, 0
        endif



		;【手掌】
		; Draw Component 4.002
		drawindexed = 5037, 577869, 0

		 ;【臂圈】
        if $key2!= 1
		; Draw Component 4.003
		drawindexed = 5472, 582906, 0
		endif
		
		
		
		
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent5]
hash = 249200ff
match_first_index = 88386
match_index_count = 29547
if $mod_enabled
	local $state_id_5
	if $state_id_5 != $state_id
		$state_id_5 = $state_id
		$\WWMIv1\vg_offset = 140
		$\WWMIv1\vg_count = 42
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 5
		drawindexed = 14799, 640719, 0

		;【肛塞】
		if $key4==1 && $key3!=1
		drawindexed = 1512, 655518, 0
		endif
		
		;【乳坠】
		if $key2 ==4
		drawindexed = 3024, 657030, 0
		endif
		;【裤子】
		; Draw Component 5.004
		if $key3 ==0
		drawindexed = 14748, 660054, 0
		endif
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent6]
hash = 249200ff
match_first_index = 117933
match_index_count = 2085
if $mod_enabled
	local $state_id_6
	if $state_id_6 != $state_id
		$state_id_6 = $state_id
		$\WWMIv1\vg_offset = 182
		$\WWMIv1\vg_count = 1
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 6
		drawindexed = 2085, 674802, 0
		run = CommandListCleanupSharedResources
	endif
endif

[TextureOverrideComponent7]
hash = 249200ff
match_first_index = 120018
match_index_count = 78
if $mod_enabled
	local $state_id_7
	if $state_id_7 != $state_id
		$state_id_7 = $state_id
		$\WWMIv1\vg_offset = 183
		$\WWMIv1\vg_count = 1
		run = CommandListMergeSkeleton
	endif
	if ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListTriggerResourceOverrides
		run = CommandListOverrideSharedResources
		; Draw Component 7
		drawindexed = 78, 676887, 0
		run = CommandListCleanupSharedResources
	endif
endif

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

[ResourceTexture0]
filename = Textures/Components-0 t=123bcc8e.dds

[TextureOverrideTexture0]
hash = fba3de34
match_priority = 0
this = ResourceTexture0

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

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

[ResourceTexture2]
filename = Textures/Components-0-1-2-6 t=cc7a443c.dds

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

[ResourceTexture3]
filename = Textures/Components-1 t=bd8fff82.dds

[TextureOverrideTexture3]
hash = c3b2a42e
match_priority = 0
this = ResourceTexture3

[ResourceTexture4]
filename = Textures/Components-1 t=f42c4870.dds

[TextureOverrideTexture4]
hash = 8e27c9a2
match_priority = 0
this = ResourceTexture4

[ResourceTexture5]
filename = Textures/Components-2 t=1e9a1fb8.dds

[TextureOverrideTexture5]
hash = 1e9a1fb8
match_priority = 0
this = ResourceTexture5

[ResourceTexture6]
filename = Textures/Components-3 t=69c48be0.dds

[TextureOverrideTexture6]
hash = 1a9b9391
match_priority = 0
this = ResourceTexture6

[ResourceTexture7]
filename = Textures/Components-3 t=edf438d9.dds

[TextureOverrideTexture7]
hash = 3bd37212
match_priority = 0
this = ResourceTexture7

[ResourceTexture8]
filename = Textures/Components-4 t=16f9802d.dds

[TextureOverrideTexture8]
hash = ae886086
match_priority = 0
this = ResourceTexture8

[ResourceTexture9]
filename = Textures/Components-4 t=fc40048f.dds

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

[ResourceTexture10]
filename = Textures/Components-5 t=1607589b.dds

[TextureOverrideTexture10]
hash = 1607589b
match_priority = 0
this = ResourceTexture10

[ResourceTexture11]
filename = Textures/Components-5 t=92d4ad47.dds

[TextureOverrideTexture11]
hash = 49b790e0
match_priority = 0
this = ResourceTexture11

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

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

[TextureOverrideShapeKeyScale]
hash = 1b1ed7be
match_priority = 0
override_byte_stride = 4
override_vertex_count = $mesh_vertex_count

[CommandListSetupShapeKeys]
$\WWMIv1\shapekey_checksum = 1338
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 = d70fa623
match_priority = 0
if $mod_enabled
	if cs == 3381.3333 && ResourceMergedSkeleton !== null
		handling = skip
		run = CommandListSetupShapeKeys
		run = CommandListLoadShapeKeys
	endif
endif

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

[TextureOverrideShapeKeyMultiplierCallback]
hash = d70fa623
match_priority = 0
if $mod_enabled
	if cs == 3381.4444 && ResourceMergedSkeleton !== null
		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: Skeleton Override -------------------------

[ResourceMergedSkeleton]

[ResourceMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 768

[ResourceExtraMergedSkeleton]

[ResourceExtraMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 768

; 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: 9e6d317a0657c54dee7d6545a39fd980ac4b585af0d5fe082fd0149e5f41d726
