; WWMI BETA-2 INI

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

[KeySwapToggle0]
condition = $object_detected == 1
key = VK_UP
type = cycle
$swapvar_toggle_0 = -1, 0, 1, 2, 3

[KeySwapToggle1]
condition = $object_detected == 1
key = VK_DOWN
type = cycle
$swapvar_toggle_1 = -1, 0

[Constants]
global $required_wwmi_version = 0.91
global $object_guid = 287358
global $mesh_vertex_count = 212595
global $shapekey_vertex_count = 102664
global $mod_id = -1000
global $mod_enabled = 0
global $object_detected = 0
; Swap vars aka toggles defaults
global persist $swapvar_toggle_0 = 0
global persist $swapvar_toggle_1 = 0
; Per-object state vars
global $draw_component_0 = 1
global $draw_component_1 = 1
global $draw_component_2 = 1
global $draw_component_3 = 1
global $draw_component_3_booba = 1
global $draw_component_3_booba_2 = 1
global $draw_component_3_booba_3 = 1
global $draw_component_3_booba_4 = 1
global $draw_component_3_bra = 1
global $draw_component_3_bra_002 = 1
global $draw_component_3_2 = 1
global $draw_component_3_3 = 1
global $draw_component_3_4 = 1
global $draw_component_4 = 1
global $draw_component_4_legs = 1
global $draw_component_4_legs_panty = 1
global $draw_component_4_legs_004 = 1
global $draw_component_4_skirt = 1
global $draw_component_5 = 1
global $draw_component_6 = 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_2 = ($swapvar_toggle_0 == -1)
$draw_component_3_booba_2 = ($swapvar_toggle_0 == -1) || ($swapvar_toggle_0 == 3)
$draw_component_3 = ($swapvar_toggle_0 == 0)
$draw_component_3_booba = ($swapvar_toggle_0 == 0)
$draw_component_3_booba_3 = ($swapvar_toggle_0 == 1)
$draw_component_3_3 = ($swapvar_toggle_0 == 1) || ($swapvar_toggle_0 == 3)
$draw_component_3_bra = ($swapvar_toggle_0 == 1)
$draw_component_3_4 = ($swapvar_toggle_0 == 2)
$draw_component_3_booba_4 = ($swapvar_toggle_0 == 2)
$draw_component_3_bra_002 = ($swapvar_toggle_0 == 2)
$draw_component_4_legs_004 = ($swapvar_toggle_1 == 0)

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

[ResourceModName]
type = Buffer
data = "ChisaThiccMod"

[ResourceModAuthor]
type = Buffer
data = "Melodic"

[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

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

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

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

[TextureOverrideComponent1]
hash = afa1587c
match_first_index = 13566
match_index_count = 36834
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 1
	if $draw_component_1
		drawindexed = 36834, 13566, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent2]
hash = afa1587c
match_first_index = 50400
match_index_count = 13494
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 2
	if $draw_component_2
		drawindexed = 13494, 50400, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent3]
hash = afa1587c
match_first_index = 63894
match_index_count = 108702
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 3
	if $draw_component_3
		drawindexed = 107016, 63894, 0
	endif
	; Draw Component 3 Booba
	if $draw_component_3_booba
		drawindexed = 32808, 170910, 0
	endif
	; Draw Component 3 Booba.2
	if $draw_component_3_booba_2
		drawindexed = 32808, 203718, 0
	endif
	; Draw Component 3 Booba.3
	if $draw_component_3_booba_3
		drawindexed = 32808, 236526, 0
	endif
	; Draw Component 3 Booba.4
	if $draw_component_3_booba_4
		drawindexed = 131232, 269334, 0
	endif
	; Draw Component 3 Bra
	if $draw_component_3_bra
		drawindexed = 8976, 400566, 0
	endif
	; Draw Component 3 Bra.002
	if $draw_component_3_bra_002
		drawindexed = 8976, 409542, 0
	endif
	; Draw Component 3.2
	if $draw_component_3_2
		drawindexed = 102240, 418518, 0
	endif
	; Draw Component 3.3
	if $draw_component_3_3
		drawindexed = 102240, 520758, 0
	endif
	; Draw Component 3.4
	if $draw_component_3_4
		drawindexed = 102240, 622998, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent4]
hash = afa1587c
match_first_index = 172596
match_index_count = 105798
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 4
	if $draw_component_4
		drawindexed = 50184, 725238, 0
	endif
	; Draw Component 4 Legs
	if $draw_component_4_legs
		drawindexed = 132204, 775422, 0
	endif
	; Draw Component 4 Legs Panty
	if $draw_component_4_legs_panty
		drawindexed = 17040, 907626, 0
	endif
	; Draw Component 4 Legs.004
	if $draw_component_4_legs_004
		drawindexed = 46080, 924666, 0
	endif
	; Draw Component 4 Skirt
	if $draw_component_4_skirt
		drawindexed = 23076, 970746, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent5]
hash = afa1587c
match_first_index = 278394
match_index_count = 7602
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 5
	if $draw_component_5
		drawindexed = 7602, 993822, 0
	endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent6]
hash = afa1587c
match_first_index = 285996
match_index_count = 1362
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 6
	if $draw_component_6
		drawindexed = 1362, 1001424, 0
	endif
    run = CommandListCleanupSharedResources
endif

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

; [ResourceTexture0]
; filename = Textures/Components-0 t=37250244.dds

; [TextureOverrideTexture0]
; hash = 37250244
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture0
; endif

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

; [TextureOverrideTexture1]
; hash = d0d2cc80
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture1
; endif

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

; [TextureOverrideTexture2]
; hash = cd006f06
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture2
; endif

; [ResourceTexture3]
; filename = Textures/Components-0-1-2-3-4-5 t=d8ed7611.dds

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

; [ResourceTexture4]
; filename = Textures/Components-0-1-2-3-4-5-6 t=247f4c84.dds

; [TextureOverrideTexture4]
; hash = 247f4c84
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture4
; endif

; [ResourceTexture5]
; filename = Textures/Components-0-1-2-3-4-5-6 t=f47bc395.dds

; [TextureOverrideTexture5]
; hash = f47bc395
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture5
; endif

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

; [TextureOverrideTexture6]
; hash = 8383cbbf
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture6
; endif

; [ResourceTexture7]
; filename = Textures/Components-1-2 t=fee91ed9.dds

; [TextureOverrideTexture7]
; hash = fee91ed9
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture7
; endif

; [ResourceTexture8]
; filename = Textures/Components-2 t=a620843e.dds

; [TextureOverrideTexture8]
; hash = a620843e
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture8
; endif

; [ResourceTexture9]
; filename = Textures/Components-2 t=f1c2e889.dds

; [TextureOverrideTexture9]
; hash = f1c2e889
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture9
; endif

; [ResourceTexture10]
; filename = Textures/Components-3 t=118a1a1f.dds

; [TextureOverrideTexture10]
; hash = 118a1a1f
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture10
; endif

; [ResourceTexture11]
; filename = Textures/Components-3 t=c7a7ec1b.dds

; [TextureOverrideTexture11]
; hash = c7a7ec1b
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture11
; endif

; [ResourceTexture12]
; filename = Textures/Components-3 t=eca8e09b.dds

; [TextureOverrideTexture12]
; hash = eca8e09b
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture12
; endif

; [ResourceTexture13]
; filename = Textures/Components-4 t=21f813ba.dds

; [TextureOverrideTexture13]
; hash = 21f813ba
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture13
; endif

; [ResourceTexture14]
; filename = Textures/Components-4 t=9b396b0d.dds

; [TextureOverrideTexture14]
; hash = 9b396b0d
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture14
; endif

; [ResourceTexture15]
; filename = Textures/Components-4 t=f869e47c.dds

; [TextureOverrideTexture15]
; hash = f869e47c
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture15
; endif

; [ResourceTexture16]
; filename = Textures/Components-4 t=ffa1f581.dds

; [TextureOverrideTexture16]
; hash = ffa1f581
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture16
; endif

; [ResourceTexture17]
; filename = Textures/Components-5 t=0cc6f756.dds

; [TextureOverrideTexture17]
; hash = 0cc6f756
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture17
; endif

; [ResourceTexture18]
; filename = Textures/Components-6 t=1131e4c1.dds

; [TextureOverrideTexture18]
; hash = 1131e4c1
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture18
; endif

; [ResourceTexture19]
; filename = Textures/Components-6 t=ac45f0a7.dds

; [TextureOverrideTexture19]
; hash = ac45f0a7
; match_priority = 0
; if $object_detected
    ; this = ResourceTexture19
; endif

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

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

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

[CommandListSetupShapeKeys]
$\WWMIv1\shapekey_checksum = 2610
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 = e9b69bed
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 = e9b69bed
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 = 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 -------------------------

; 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: 88cdc3198fd5e6322990c22a4ceb373b03c52cd9717dfb5c10fdaecaa66362e19
