; WWMI BETA-2 INI

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

[Constants]
global persist $crown = 1
global persist $bracelet = 1
global persist $anklet = 1
global persist $cape = 1

[KeySwap1]
condition = $object_detected
key = ctrl up
type = cycle
$crown = 0,1

[KeySwap2]
condition = $object_detected
key = ctrl left
type = cycle
$bracelet = 0,1,0,1
$anklet = 0,0,1,1

[KeySwap3]
condition = $object_detected
key = ctrl right
type = cycle
$cape = 0,0,1


[Constants]
global $required_wwmi_version = 0.91
global $object_guid = 211575
global $mesh_vertex_count = 7504
global $shapekey_vertex_count = 0
global $mod_id = -1000
global $mod_enabled = 0
global $object_detected = 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 = "monsoon-CartethyiaMod"

[ResourceModAuthor]
type = Buffer
data = "monsoon"

[ResourceModDesc]
type = Buffer
data = "https://monsoon.fanbox.cc/"

[ResourceModLink]
type = Buffer
data = "https://monsoon.fanbox.cc/"

[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 = a48fddd1
match_first_index = 0
match_index_count = 12870
$object_detected = 1
if $mod_enabled
    handling = skip
    ; run = CommandListTriggerResourceOverrides
    ; run = CommandListOverrideSharedResources
    ; Draw skipped: No matching custom components found
    ; run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent1]
hash = a48fddd1
match_first_index = 12870
match_index_count = 36372
$object_detected = 1
if $mod_enabled
    handling = skip
    ; run = CommandListTriggerResourceOverrides
    ; run = CommandListOverrideSharedResources
    ; Draw skipped: No matching custom components found
    ; run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent2]
hash = a48fddd1
match_first_index = 49242
match_index_count = 12750
$object_detected = 1
if $mod_enabled
    handling = skip
    ; run = CommandListTriggerResourceOverrides
    ; run = CommandListOverrideSharedResources
    ; Draw skipped: No matching custom components found
    ; run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent3]
hash = a48fddd1
match_first_index = 61992
match_index_count = 69000
$object_detected = 1
if $mod_enabled
    handling = skip
    ; run = CommandListTriggerResourceOverrides
    ; run = CommandListOverrideSharedResources
    ; Draw skipped: No matching custom components found
    ; run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent4]
hash = a48fddd1
match_first_index = 130992
match_index_count = 48579
$object_detected = 1
if $mod_enabled
    handling = skip
    ; run = CommandListTriggerResourceOverrides
    ; run = CommandListOverrideSharedResources
    ; Draw skipped: No matching custom components found
    ; run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent5]
hash = a48fddd1
match_first_index = 179571
match_index_count = 14418
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
if $cape == 1
	; Draw Component 5 披风 
	drawindexed = 14418, 0, 0
endif
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent6]
hash = a48fddd1
match_first_index = 193989
match_index_count = 2028
$object_detected = 1
if $mod_enabled
    handling = skip
    ; run = CommandListTriggerResourceOverrides
    ; run = CommandListOverrideSharedResources
    ; Draw skipped: No matching custom components found
    ; run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent7]
hash = a48fddd1
match_first_index = 196017
match_index_count = 15558
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
if $crown == 1
	; Draw Component 7 冠
	drawindexed = 5772, 14418, 0
endif
if $bracelet == 1
	; Draw Component 7 手环
	drawindexed = 3408, 20190, 0
endif
if $cape == 1
	; Draw Component 7 披风
	drawindexed = 4506, 23598, 0
endif
if $anklet == 1
	; Draw Component 7 脚环
	drawindexed = 1872, 28104, 0
endif
    run = CommandListCleanupSharedResources
endif

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

[ResourceTexture0]
filename = Textures/Components-0 t=64cd06f9.dds

[TextureOverrideTexture0]
hash = 64cd06f9
match_priority = 0
if $object_detected
    this = ResourceTexture0
endif

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

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

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

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

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

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

[ResourceTexture4]
filename = Textures/Components-0-1-2-6-7 t=037e710d.dds

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

[ResourceTexture5]
filename = Textures/Components-0-7 t=1f426e73.dds

[TextureOverrideTexture5]
hash = 1f426e73
match_priority = 0
if $object_detected
    this = ResourceTexture5
endif

[ResourceTexture6]
filename = Textures/Components-0-7 t=c5b7aee2.dds

[TextureOverrideTexture6]
hash = c5b7aee2
match_priority = 0
if $object_detected
    this = ResourceTexture6
endif

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

[TextureOverrideTexture7]
hash = 3ff8b56e
match_priority = 0
if $object_detected
    this = ResourceTexture7
endif

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

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

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

[TextureOverrideTexture9]
hash = 2d14e92d
match_priority = 0
if $object_detected
    this = ResourceTexture9
endif

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

[TextureOverrideTexture10]
hash = 8e7433fa
match_priority = 0
if $object_detected
    this = ResourceTexture10
endif

[ResourceTexture11]
filename = Textures/Components-2-6 t=8383cbbf.dds

[TextureOverrideTexture11]
hash = 8383cbbf
match_priority = 0
if $object_detected
    this = ResourceTexture11
endif

[ResourceTexture12]
filename = Textures/Components-3 t=423ec9ce.dds

[TextureOverrideTexture12]
hash = 423ec9ce
match_priority = 0
if $object_detected
    this = ResourceTexture12
endif

[ResourceTexture13]
filename = Textures/Components-3 t=7ef7dba9.dds

[TextureOverrideTexture13]
hash = 7ef7dba9
match_priority = 0
if $object_detected
    this = ResourceTexture13
endif

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

[TextureOverrideTexture14]
hash = 7f08cd4f
match_priority = 0
if $object_detected
    this = ResourceTexture14
endif

[ResourceTexture15]
filename = Textures/Components-4 t=052142b5.dds

[TextureOverrideTexture15]
hash = 052142b5
match_priority = 0
if $object_detected
    this = ResourceTexture15
endif

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

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

[ResourceTexture17]
filename = Textures/Components-6 t=241a6fbe.dds

[TextureOverrideTexture17]
hash = 241a6fbe
match_priority = 0
if $object_detected
    this = ResourceTexture17
endif



; 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

; 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: 469fe577fe0339c563d074d3a04c47d38e7809c740458f69fc898b74c0a9c602

[TextureOverrideTexture4_injured]
hash = f12ebf02
match_priority = 0
if $object_detected
this = ResourceTexture4
endif

[TextureOverrideTexture5_injured]
hash = e08e17b5
match_priority = 0
if $object_detected
this = ResourceTexture5
endif

[TextureOverrideTexture12_injured]
hash = 58037f6f
match_priority = 0
if $object_detected
this = ResourceTexture12
endif

[TextureOverrideTexture2_injured]
hash = beef40ba
match_priority = 0
if $object_detected
this = ResourceTexture2
endif

[TextureOverrideTexture7_injured]
hash = bfd19633
match_priority = 0
if $object_detected
this = ResourceTexture7
endif
