; WWMI BETA-2 INI

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

[Constants]
global $required_wwmi_version = 1.00
global $object_guid = 347325
global $mesh_vertex_count = 1000000
global $shapekey_vertex_count = 1000000
global $mod_id = -1000
global $mod_enabled = 0
global $object_detected = 0
global $body
global persist $face = 1
global persist $Dress = 2
global persist $Flap = 2
global persist $Shoes = 1
global persist $BackCape = 1
global persist $sleeves = 0
global persist $pant = 1
global persist $Pubic = 1
global $shapekey_vertex_offset_batch0 = 0
global $shapekey_vertex_count_batch0 = 52582
global $shapekey_vertex_offset_batch1 = 52582
global $shapekey_vertex_count_batch1 = 8659

[KeySwap-Dress]
condition = $object_detected == 1
key = alt 1
type = cycle
$Dress = 2,1,0

[KeySwap-Flap]
condition = $object_detected == 1 && $Dress == 2
key = alt 2
type = cycle
$Flap = 2,0

[KeySwap-Shoes]
condition = $object_detected == 1
key = alt 3
type = cycle
$Shoes = 1,0

[KeySwap-Sleeves]
condition = $object_detected == 1
key = alt 4
type = cycle
$Sleeves = 1,0

[KeySwap-Pant]
condition = $object_detected == 1
key = alt 5
type = cycle
$pant = 1,0

[KeySwap-BackCape]
condition = $object_detected == 1
key = alt 6
type = cycle
$BackCape = 1,0

[KeySwap-Pubic]
condition = $object_detected == 1
key = alt 7
type = cycle
$Pubic = 1,0

[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 = "THICC Augusta"

[ResourceModAuthor]
type = Buffer
data = "NAHCYOR"

[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 = 91cff509
match_first_index = 0
match_index_count = 31245
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListOverrideSharedResources
	; Draw Component 0
	drawindexed = 31245, 0, 0
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent1]
hash = 91cff509
match_first_index = 31245
match_index_count = 30837
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListOverrideSharedResources
	; Draw Component 1
	drawindexed = 30837, 31245, 0
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent2]
hash = 91cff509
match_first_index = 62082
match_index_count = 13404
$object_detected = 1
if $mod_enabled
    handling = skip
	if $body == 0
	ps-t1 = ResourceFace
	else
	ps-t1 = ResourceFace
	endif
	
    run = CommandListOverrideSharedResources
	; Draw Component 2.001
	drawindexed = 13404, 62082, 0
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent3]
hash = 91cff509
match_first_index = 75486
match_index_count = 115707
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListOverrideSharedResources

	; Draw Component 3.Flower
	if $Dress != 0
	drawindexed = 7680, 171348, 0
	endif
	
	; Draw Component 3.Hand
	drawindexed = 17058, 179028, 0
	
	; Draw Component 3.Sleeves
	if $sleeves == 1
	if $Dress != 0
	drawindexed = 28992, 196086, 0
	endif
	endif
	
	; Draw Component 3.Top
	if $Dress != 0 
	drawindexed = 157728, 225078, 0
	endif
	
	; Draw Component 3.WaistArmor
	if $Dress == 2
	drawindexed = 15273, 382806, 0
    endif
	
	run = CommandListCleanupSharedResources
	run = CommandListDrawComponent3
endif

[CommandListDrawComponent3]
hash = 91cff509
match_first_index = 75486
match_index_count = 115707
$object_detected = 1
if $mod_enabled
    handling = skip
        if $body == 1
        ps-t1 = ResourceC3L
        ps-t2 = ResourceC3L
        ps-t3 = ResourceC3D
        ps-t6 = ResourceC6
        else
        ps-t0 = ResourceC3N
        ps-t1 = ResourceC3L
        ps-t2 = ResourceC3L
        ps-t3 = ResourceC3D
        endif
        ps-t7 = ResourceC7
    run = CommandListOverrideSharedResources

	
	; Draw Component 3.BodyExpo
	drawindexed = 78474, 91950, 0
	
	; Draw Component 3.BodyArm
	if $Dress != 0
	if $sleeves == 0
	drawindexed = 16464, 75486, 0
	endif
	endif
	if $Dress == 0
	drawindexed = 16464, 75486, 0
	endif


    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent4]
hash = 91cff509
match_first_index = 191193
match_index_count = 98136
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListOverrideSharedResources
	; Draw Component 4.FrontBack
	if $Dress == 2
	if $Flap == 1 || $Flap == 3
	drawindexed = 9720, 461868, 0
	endif
	endif
	; Draw Component 4.LeftRight
	if $Dress == 2
	if $Flap == 2 || $Flap == 3
	drawindexed = 15174, 471588, 0
	endif
	endif
	; Draw Component 4.LegRing
	drawindexed = 3339, 486762, 0
	
	; Draw Component 4.Pant
	if $pant == 1
	drawindexed = 13584, 490101, 0
	endif
	
	; Draw Component 4.Shoes
	if $Shoes == 1
	drawindexed = 24792, 503685, 0
    endif
	

	
	run = CommandListCleanupSharedResources
	run = CommandListDrawComponent4
endif



[CommandListDrawComponent4]
hash = 91cff509
match_first_index = 191193
match_index_count = 98136
$object_detected = 1
if $mod_enabled
    handling = skip
        if $body == 1
        ps-t1 = ResourceC3L
        ps-t2 = ResourceC3L
        ps-t3 = ResourceC3D2
        ps-t6 = ResourceC6
        else
        ps-t0 = ResourceC3N
        ps-t1 = ResourceC3L
        ps-t2 = ResourceC3L
        ps-t3 = ResourceC3D2

    run = CommandListOverrideSharedResources
	; Draw Component 4.BodyArm.002
	drawindexed = 63789, 398079, 0
    run = CommandListCleanupSharedResources
endif
[TextureOverrideComponent5]
hash = 91cff509
match_first_index = 289329
match_index_count = 56400
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListOverrideSharedResources
	; Draw Component 5.BackFlap
	if $Dress == 2
	if $BackCape == 1
	drawindexed = 22908, 528477, 0
	endif
	endif
	; Draw Component 5.Head
	drawindexed = 1032, 551385, 0
	; Draw Component 5.Head2
	drawindexed = 18570, 552417, 0
	
	; Draw Component 5.Ring
	drawindexed = 2112, 570987, 0
	
	; Draw Component 5.Sleeves
	if $sleeves == 1
	if $Dress != 0
	drawindexed = 9696, 573099, 0
	endif
	endif
	
	; Draw Component 5.neck
	drawindexed = 2082, 582795, 0
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent6]
hash = 91cff509
match_first_index = 345729
match_index_count = 1596
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListOverrideSharedResources
	; Draw Component 6
	drawindexed = 1596, 584877, 0
    run = CommandListCleanupSharedResources
endif

; Shading: Textures -------------------------
[ResourceC3D]
filename = Textures/C3A.png
[ResourceC3D2]
filename = Textures/C3B.png
[ResourceC3N]
filename = Textures/C3N.dds
[ResourceC3L]
filename = Textures/C3L.dds
[ResourceC6]
filename = Textures/C6.dds
[ResourceC7]
filename = Textures/C7.dds
[ResourceFace]
filename = Textures/Face.dds
[ResourceFaceF]
filename = Textures/FaceF.dds
[TextureOverrideSkin]
$body = 1
hash = 750c7901
match_priority = 0

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

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

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

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

[CommandListSetupShapeKeysBatch]
$\WWMIv1\shapekey_checksum_batch0 = 926
$\WWMIv1\shapekey_vertex_offset_original_batch0 = 0
$\WWMIv1\shapekey_vertex_offset_custom_batch0 = $shapekey_vertex_offset_batch0
$\WWMIv1\shapekey_checksum_batch1 = 825
$\WWMIv1\shapekey_vertex_offset_original_batch1 = 52582
$\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 = 1644
$\WWMIv1\shapekey_vertex_count_batch0 = $shapekey_vertex_count_batch0
$\WWMIv1\shapekey_dispatch_size_y_original_batch1 = 542
$\WWMIv1\shapekey_vertex_count_batch1 = $shapekey_vertex_count_batch1
cs-t0 = ResourceShapeKeyVertexIdBuffer
cs-t1 = ResourceShapeKeyVertexOffsetBuffer
cs-u6 = ResourceShapeKeyCBRW
run = CommandList\WWMIv1\LoadShapeKeysBatch

[TextureOverrideShapeKeyLoaderCallback]
hash = 4e9230aa
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

[CommandListApplyShapeKeys]
cs-t6 = ResourcePositionBuffer
cs-u6 = ResourcePositionRW
run = CustomShader\WWMIv1\ShapeKeyApplier
ResourceShapeKeyedPosition = copy ResourcePositionRW

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

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

[ResourceShapeKeyedPosition]

[ResourcePositionRW]
type = RWBuffer
format = R32_FLOAT
stride = 12
array = 1214580

[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

[ResourceBlendBufferNoStride]
type = Buffer
format = DXGI_FORMAT_R8_UINT
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

[ResourceBlendRemapVertexVGBuffer]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = Meshes/BlendRemapVertexVG.buf

[ResourceBlendRemapForwardBuffer]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = Meshes/BlendRemapForward.buf

[ResourceBlendRemapReverseBuffer]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = Meshes/BlendRemapReverse.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: b2f66aed0590e9cc80751e71679cda18ce86852ea68d97d2918fe14feb68d116
