; Ganyu

; Constants -------------------------

[Constants]
global $active = 0
global $creditinfo = 0
global persist $swapvar1 = 0
global persist $swapvar2 = 0
global persist $swapvar3 = 0
global persist $hair = 0
global persist $makeup = 0

[KeySwap1]
condition = $active == 1
key = VK_DOWN
type = cycle
$swapvar1 = 0,1,2,3
$creditinfo = 0

[KeySwap2]
condition = $active == 1
key = VK_left
type = cycle
$swapvar2 = 0,1
$creditinfo = 0

[KeySwap3]
condition = $active == 1
key = VK_right
type = cycle
$swapvar3 = 0,1
$creditinfo = 0

[KeySwapHair]
condition = $active == 1
key = VK_UP
type = cycle
$hair = 0,1,2,3,4,5,6
$creditinfo = 0

[KeySwapMakeup]
condition = $active == 1
key = /
type = cycle
$makeup = 0,1,2
$creditinfo = 0

[Present]
post $active = 0
run = CommandListCreditInfo

; Overrides -------------------------

[TextureOverrideGanyuPosition]
hash = a5169f1d
vb0 = ResourceGanyuPosition
$active = 1

[TextureOverrideGanyuBlend]
hash = 6f47a39d
handling = skip
vb1 = ResourceGanyuBlend
draw = 154585, 0

[TextureOverrideGanyuTexcoord]
hash = cf27251f
vb1 = ResourceGanyuTexcoord

[TextureOverrideGanyuVertexLimitRaise]
hash = fbf98643
override_vertex_count = 154585
override_byte_stride = 40

[TextureOverrideGanyuIB]
hash = 1575ec63
handling = skip

[TextureOverrideGanyuHead]
hash = 1575ec63
match_first_index = 0
ib = ResourceGanyuHeadIB
ps-t0 = ResourceGanyuHeadDiffuse
ps-t1 = ResourceGanyuHeadLightMap
run = CommandList\global\ORFix\NNFix
if $hair == 0
; head (3338)
drawindexed = 12822, 0, 0
else if $hair == 1
ps-t0 = ResourceGanyuHeadDiffuse1
ps-t1 = ResourceGanyuHeadLightMap1
run = CommandList\global\ORFix\NNFix
; head2 (7697)
drawindexed = 25227, 12822, 0
endif
ps-t0 = ResourceGanyuHeadDiffuse2
ps-t1 = ResourceGanyuHeadLightMap2
run = CommandList\global\ORFix\NNFix
if $hair == 2
; head3 (16146)
drawindexed = 64992, 38049, 0
else if $hair == 3
; head4 (23193)
drawindexed = 106239, 103041, 0
endif
ps-t0 = ResourceGanyuHeadDiffuse3
ps-t1 = ResourceGanyuHeadLightMap3
run = CommandList\global\ORFix\NNFix
if $hair == 4
; head5 (15093)
drawindexed = 74139, 209280, 0
else if $hair == 5
; head6 (12995)
drawindexed = 65076, 283419, 0
endif

[TextureOverrideGanyuBody]
hash = 1575ec63
match_first_index = 12822
ib = ResourceGanyuBodyIB
if $swapvar1 == 0
ps-t0 = ResourceGanyuBodyDiffuse
ps-t1 = ResourceGanyuBodyLightMap
run = CommandList\global\ORFix\NNFix
else if $swapvar1 == 1
ps-t0 = ResourceGanyuBodyDiffuse1
ps-t1 = ResourceGanyuBodyLightMap
run = CommandList\global\ORFix\NNFix
else if $swapvar1 == 2
ps-t0 = ResourceGanyuBodyDiffuse2
ps-t1 = ResourceGanyuBodyLightMap
run = CommandList\global\ORFix\NNFix
else if $swapvar1 == 3
ps-t0 = ResourceGanyuBodyDiffuse3
ps-t1 = ResourceGanyuBodyLightMap1
run = CommandList\global\ORFix\NNFix
endif
; bell (1294)
drawindexed = 3930, 0, 0
; body (13778)
drawindexed = 71916, 3930, 0
if $swapvar3 == 0
; dress (1481)
drawindexed = 3882, 75846, 0
endif
; neck (368)
drawindexed = 1272, 79728, 0
; shoes (934)
drawindexed = 2628, 81000, 0

[TextureOverrideGanyuDress]
hash = 1575ec63
match_first_index = 47160
ib = ResourceGanyuDressIB
ps-t0 = ResourceGanyuDressDiffuse
ps-t1 = ResourceGanyuDressLightMap
run = CommandList\global\ORFix\NNFix
if $swapvar2 == 0
; dress2 (640)
drawindexed = 2844, 0, 0
endif
if $hair == 6
ps-t0 = ResourceGanyuHeadDiffuse3
ps-t1 = ResourceGanyuHeadLightMap3
run = CommandList\global\ORFix\NNFix
; head7.001 (57628)
drawindexed = 324036, 2844, 0
endif

[TextureOverrideGanyuFaceHeadDiffuse]
hash = b2657593
if $makeup == 0
this = ResourceGanyuFaceHeadDiffuse
else if $makeup == 1
this = ResourceGanyuFaceHeadDiffuse1
else if $makeup == 2
this = ResourceGanyuFaceHeadDiffuse2
endif

; CommandList -----------------------

[CommandListCreditInfo]
if $creditinfo == 0 && $active > 0
	pre Resource\ShaderFixes\help.ini\Notification = ResourceCreditInfo
	pre run = CustomShader\ShaderFixes\help.ini\FormatText
	pre $\ShaderFixes\help.ini\notification_timeout = time + 5.0
	$creditinfo = 2
endif

; Resources -------------------------

[ResourceGanyuPosition]
type = Buffer
stride = 40
filename = GanyuPosition.buf

[ResourceGanyuBlend]
type = Buffer
stride = 32
filename = GanyuBlend.buf

[ResourceGanyuTexcoord]
type = Buffer
stride = 20
filename = GanyuTexcoord.buf

[ResourceGanyuHeadIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = GanyuHead.ib

[ResourceGanyuBodyIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = GanyuBody.ib

[ResourceGanyuDressIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = GanyuDress.ib

[ResourceGanyuHeadDiffuse]
filename = GanyuHeadDiffuse.dds

[ResourceGanyuHeadLightMap]
filename = GanyuHeadLightMap.dds

[ResourceGanyuHeadDiffuse1]
filename = GanyuHeadDiffuse1.dds

[ResourceGanyuHeadLightMap1]
filename = GanyuHeadLightMap1.dds

[ResourceGanyuHeadDiffuse2]
filename = GanyuHeadDiffuse2.dds

[ResourceGanyuHeadLightMap2]
filename = GanyuHeadLightMap2.dds

[ResourceGanyuHeadDiffuse3]
filename = GanyuHeadDiffuse3.dds

[ResourceGanyuHeadLightMap3]
filename = GanyuHeadLightMap3.dds

[ResourceGanyuBodyDiffuse]
filename = GanyuBodyDiffuse.dds

[ResourceGanyuBodyLightMap]
filename = GanyuBodyLightMap.dds

[ResourceGanyuBodyDiffuse1]
filename = GanyuBodyDiffuse1.dds

[ResourceGanyuBodyDiffuse2]
filename = GanyuBodyDiffuse2.dds

[ResourceGanyuBodyDiffuse3]
filename = GanyuBodyDiffuse3.dds

[ResourceGanyuBodyLightMap1]
filename = GanyuBodyLightMap1.dds

[ResourceGanyuDressDiffuse]
filename = GanyuDressDiffuse.dds

[ResourceGanyuDressLightMap]
filename = GanyuDressLightMap.dds

[ResourceGanyuFaceHeadDiffuse]
filename = GanyuFaceHeadDiffuse.dds

[ResourceGanyuFaceHeadDiffuse1]
filename = GanyuFaceHeadDiffuse1.dds

[ResourceGanyuFaceHeadDiffuse2]
filename = GanyuFaceHeadDiffuse2.dds

[ResourceCreditInfo]
type = Buffer
data = "Imported by _treef_"

; .ini generated by XXMI (XX-Model-Importer) v1.6.3
; If you have any issues or find any bugs, please open a ticket at https://github.com/leotorrez/XXMI-Tools/issues
