; WWMI BETA-8 INI

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

[KeySwapShoes]
condition = $object_detected == 1
key = NO_ALT NO_SHIFT VK_DOWN
type = cycle
$swapvar_shoes = -1, 0, 1

[KeySwapThigh]
condition = $object_detected == 1
key = ALT NO_SHIFT VK_DOWN
type = cycle
$swapvar_thigh = -1, 0

[KeySwapPanties]
condition = $object_detected == 1
key = ALT SHIFT VK_DOWN
type = cycle
$swapvar_panties = -1, 0

[Constants]
global $required_wwmi_version = 1.00
global $object_guid = 94470
global $mesh_vertex_count = 27556
global $shapekey_vertex_count = 102148
global $shapekey_vertex_offset_batch0 = 0
global $shapekey_vertex_count_batch0 = 77758
global $shapekey_vertex_offset_batch1 = 77758
global $shapekey_vertex_count_batch1 = 24390
global $mod_id = -1000
global $mod_enabled = 0
global $object_detected = 0
; Swap vars aka toggles defaults
global persist $swapvar_shoes = -1
global persist $swapvar_thigh = -1
global persist $swapvar_panties = -1
; Per-object state vars
global $draw_component_0_001 = 1
global $draw_component_1_001 = 1
global $draw_component_2_001 = 1
global $draw_component_3_002 = 1
global $draw_component_3_nd = 1
global $draw_component_3_pants = 1
global $draw_component_3_s_shoes = 1
global $draw_component_3_s_barefootflat = 1
global $draw_component_3_s_barefoottiptoe = 1
global $draw_component_3_thighring = 1
global $draw_component_4_001 = 1

[Present]
if $object_detected
    if $mod_enabled
        post $object_detected = 0
        run = CommandListProcessToggles
    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

[CommandListProcessToggles]
; Set display of each object according to toggles logic
$draw_component_3_s_barefootflat = ($swapvar_shoes == -1) || ($swapvar_shoes == 1)
$draw_component_3_s_barefoottiptoe = ($swapvar_shoes == 0)
$draw_component_3_s_shoes = ($swapvar_shoes == 1)
$draw_component_3_thighring = ($swapvar_thigh == 0)
$draw_component_3_pants = ($swapvar_panties == 0)

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

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

[ResourceModAuthor]
type = Buffer
data = "Jelly"

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

[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
CheckTextureOverride = ps-t8

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

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

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

[TextureOverrideComponent1]
hash = e082ca87
match_first_index = 11133
match_index_count = 34119
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 1.001
	if $draw_component_1_001
		drawindexed = 34119, 11133, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent2]
hash = e082ca87
match_first_index = 45252
match_index_count = 16116
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 2.001
	if $draw_component_2_001
		drawindexed = 16116, 45252, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent3]
hash = e082ca87
match_first_index = 61368
match_index_count = 31812
$object_detected = 1
if $mod_enabled
    handling = skip
    ps-t0 = ResourceTexture4
    ps-t1 = ResourceTexture1
    ps-t2 = ResourceTexture3
    ps-t3 = ResourceTexture0
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 3.002
	if $draw_component_3_002
		drawindexed = 1068, 61368, 0
	endif
	; Draw Component 3.ND
	if $draw_component_3_nd
		drawindexed = 19554, 62436, 0
	endif
	; Draw Component 3.Pants
	if $draw_component_3_pants
		drawindexed = 3054, 81990, 0
	endif
	; Draw Component 3.S_Shoes
	if $draw_component_3_s_shoes
		drawindexed = 12540, 85044, 0
	endif
	; Draw Component 3.S_barefootflat
	if $draw_component_3_s_barefootflat
		drawindexed = 14544, 97584, 0
	endif
	; Draw Component 3.S_barefoottiptoe
	if $draw_component_3_s_barefoottiptoe
		drawindexed = 14544, 112128, 0
	endif
	; Draw Component 3.thighring
	if $draw_component_3_thighring
		drawindexed = 480, 126672, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent4]
hash = e082ca87
match_first_index = 93180
match_index_count = 1290
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 4.001
	if $draw_component_4_001
		drawindexed = 1290, 127152, 0
	endif
    run = CommandListCleanupSharedResources
endif

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

[ResourceTexture0]
filename = Textures/Components-3 t=26075d8a.dds

[TextureOverrideTexture0]
hash = 26075d8a
match_priority = 0
if $object_detected
    this = ResourceTexture0
endif

[ResourceTexture1]
filename = Textures/Components-3 t=6dcfc4fa.dds

[TextureOverrideTexture1]
hash = 6dcfc4fa
match_priority = 0
if $object_detected
    this = ResourceTexture1
endif

[ResourceTexture2]
filename = Textures/Components-3 t=8d22ec96.jpg

[TextureOverrideTexture2]
hash = 8d22ec96
match_priority = 0
if $object_detected
    this = ResourceTexture2
endif

[ResourceTexture3]
filename = Textures/Components-3 t=a54ef129.dds

[TextureOverrideTexture3]
hash = a54ef129
match_priority = 0
if $object_detected
    this = ResourceTexture3
endif

[ResourceTexture4]
filename = Textures/Components-3 t=fcb2aea7.dds

[TextureOverrideTexture4]
hash = fcb2aea7
match_priority = 0
if $object_detected
    this = ResourceTexture4
endif

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

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

[TextureOverrideShapeKeyScale]
hash = 6739bb37
match_priority = 0
override_byte_stride = 4
override_vertex_count = $mesh_vertex_count

[CommandListSetupShapeKeysBatch]
$\WWMIv1\shapekey_checksum_batch0 = 840
$\WWMIv1\shapekey_vertex_offset_original_batch0 = 0
$\WWMIv1\shapekey_vertex_offset_custom_batch0 = $shapekey_vertex_offset_batch0
$\WWMIv1\shapekey_checksum_batch1 = 3267
$\WWMIv1\shapekey_vertex_offset_original_batch1 = 77709
$\WWMIv1\shapekey_vertex_offset_custom_batch1 = $shapekey_vertex_offset_batch1
cs-t33 = ResourceShapeKeyOffsetBuffer
cs-u5 = ResourceCustomShapeKeyValuesRW
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyBatchOverrider

[CommandListLoadShapeKeysBatch]
$\WWMIv1\shapekey_dispatch_size_y_original_batch0 = 2429
$\WWMIv1\shapekey_vertex_count_batch0 = $shapekey_vertex_count_batch0
$\WWMIv1\shapekey_dispatch_size_y_original_batch1 = 762
$\WWMIv1\shapekey_vertex_count_batch1 = $shapekey_vertex_count_batch1
cs-t0 = ResourceShapeKeyVertexIdBuffer
cs-t1 = ResourceShapeKeyVertexOffsetBuffer
cs-u6 = ResourceShapeKeyCBRW
run = CommandList\WWMIv1\LoadShapeKeysBatch

[TextureOverrideShapeKeyLoaderCallback]
hash = ec1ea094
match_priority = 0
if $mod_enabled
    if cs == 3381.3333
        handling = skip
        run = CommandListSetupShapeKeysBatch
        run = CommandListLoadShapeKeysBatch
    endif
endif

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

[TextureOverrideShapeKeyMultiplierCallback]
hash = ec1ea094
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 = 64

; 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 = 16
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 generated by WWMI Tools Blender addon v1.7.3 and requires WWMI v1.0.0+ to function

; XXMI Launcher GameBanana: https://gamebanana.com/tools/17252
; XXMI Launcher GitHub: https://github.com/SpectrumQT/XXMI-Launcher
; WWMI Package GitHub: https://github.com/SpectrumQT/WWMI-Package
; WWMI Tools GameBanana: https://gamebanana.com/tools/17289
; WWMI Tools GitHub: https://github.com/SpectrumQT/WWMI-Tools
; AGMG Modding Community Discord: https://discord.com/invite/agmg
; SHA256 CHECKSUM: fa2fd5646213cb6505d955b5bafd028a8eee434ffeedf24ce9846bd3bada5c45
