; 0Dialyn

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

[Constants]
global $active = 0
global $creditinfo = 0
global persist $mask = 0
global persist $skirt = 0
global persist $leg = 0
global persist $shoe = 0
global persist $hu = 0
global persist $dai = 0
global persist $hair = 1

[Keymask]
condition = $active == 1
key = VK_UP
type = cycle
$mask = 0,1

[Keyleg]
condition = $active == 1
key = VK_LEFT
type = cycle
$leg = 0,1

[Keyshoe]
condition = $active == 1
key = VK_DOWN
type = cycle
$shoe = 0,1

[Keyskirt]
condition = $active == 1
key = VK_RIGHT
type = cycle
$skirt = 0,1

[Keyhu]
condition = $active == 1
key = 8
type = cycle
$hu = 0,1,2

[Keydai]
condition = $active == 1
key = 9
type = cycle
$dai = 0,1

[Keyhair]
condition = $active == 1
key = .
type = cycle
$hair = 0,1

[Present]
post $active = 0
run = CommandListCreditInfo

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

[TextureOverride0Dialyn0HBlend]
hash = 339f41eb
handling = skip
vb2 = Resource0Dialyn0HBlend
if DRAW_TYPE == 1
	vb0 = Resource0Dialyn0HPosition
	draw = 29039, 0

	$active = 1
endif

[TextureOverride0Dialyn0HTexcoord]
hash = 46019c5e
vb1 = Resource0Dialyn0HTexcoord

[TextureOverride0Dialyn0HVertexLimitRaise]
hash = 00e453e9
override_vertex_count = 29039
override_byte_stride = 40

[TextureOverride0Dialyn00Blend]
hash = ff36809b
handling = skip
vb2 = Resource0Dialyn00Blend
if DRAW_TYPE == 1
	vb0 = Resource0Dialyn00Position
	draw = 134133, 0

	$active = 1
endif

[TextureOverride0Dialyn00Texcoord]
hash = 3f2079bc
vb1 = Resource0Dialyn00Texcoord

[TextureOverride0Dialyn00VertexLimitRaise]
hash = 2e77bd1d
override_vertex_count = 134133
override_byte_stride = 40

[TextureOverride0Dialyn01Blend]
hash = 312b6e12
handling = skip
vb2 = Resource0Dialyn01Blend
if DRAW_TYPE == 1
	vb0 = Resource0Dialyn01Position
	draw = 3, 0

	$active = 1
endif

[TextureOverride0Dialyn01Texcoord]
hash = 2e6484db
vb1 = Resource0Dialyn01Texcoord

[TextureOverride0Dialyn01VertexLimitRaise]
hash = 38ce65ff
override_vertex_count = 3
override_byte_stride = 40

[TextureOverride0Dialyn0HIB]
hash = 68f00074
handling = skip

[TextureOverride0Dialyn0HA]
hash = 68f00074
match_first_index = 0
ib = Resource0Dialyn0HAIB
run = CommandList\ZZMI\SetTextures
; 0Dialyn0HA-vb0=a486f1bb.txt.001 (3)
drawindexed = 3, 0, 0
; 0Dialyn0HA-vb0=a486f1bb.txt
; 2 (2047)
drawindexed = 6555, 3, 0
; 3 (311)
drawindexed = 1500, 6558, 0
; 发带 (556)
drawindexed = 2370, 8058, 0
; 头发 (7984)
if $hair == 0
drawindexed = 32706, 10428, 0
endif


[TextureOverride0Dialyn0HB]
hash = 68f00074
match_first_index = 6630
ib = Resource0Dialyn0HBIB
run = CommandList\ZZMI\SetTextures
; 0Dialyn0HB-vb0=a486f1bb.txt.001 (3)
drawindexed = 3, 0, 0
; 0Dialyn0HB-vb0=a486f1bb.txt
; 3.001 (59)
drawindexed = 198, 3, 0
; 双马尾 (6558)
if $hair == 1
drawindexed = 25512, 201, 0
endif

; 耳环.001 (11518)
drawindexed = 15240, 25713, 0

[TextureOverride0Dialyn00IB]
hash = af39a873
handling = skip

[TextureOverride0Dialyn00A]
hash = af39a873
match_first_index = 0
ib = Resource0Dialyn00AIB
run = CommandList\ZZMI\SetTextures
; 0Dialyn00A-vb0=ff36809b.txt.001 (3)
drawindexed = 3, 0, 0
; 0Dialyn00A-vb0=ff36809b.txt
; body (28960)
drawindexed = 134583, 3, 0
; hairB (310)
if $hair == 0
drawindexed = 858, 134586, 0
endif

; leg b (21023)
if $leg == 1
drawindexed = 116478, 135444, 0
endif

; leg p (20312)
if $leg == 0
drawindexed = 112584, 251922, 0
endif

; shoe (11204)
if $shoe == 0
drawindexed = 46590, 364506, 0
endif

; skirt (1624)
if $skirt == 0
drawindexed = 8820, 411096, 0
endif

; 腰饰 (4068)
drawindexed = 18912, 453768, 0
; 蝴蝶结 (1861)
if $hu == 0 || $hu == 1
drawindexed = 9234, 472680, 0
endif

; 蝴蝶结1 (35868)
if $hu == 0
drawindexed = 42882, 481914, 0
endif

; 衣带 (184)
if $dai == 0
drawindexed = 720, 524796, 0
endif

; 面具 (2692)
if $mask == 0
drawindexed = 10686, 525516, 0
endif


; z (5602)
if $leg == 0
run = CustomShaderTransparency
endif

; z1 (422)
if $leg == 0
run = CustomShaderTransparency1
endif


[CustomShaderTransparency]
blend = ADD BLEND_FACTOR INV_BLEND_FACTOR
blend_factor[0] = 0.8
blend_factor[1] = 0.8
blend_factor[2] = 0.8
blend_factor[3] = 1
handling = skip
drawindexed = 32064, 419916, 0


[CustomShaderTransparency1]
blend = ADD BLEND_FACTOR INV_BLEND_FACTOR
blend_factor[0] = 0.25
blend_factor[1] = 0.25
blend_factor[2] = 0.25
blend_factor[3] = 1
depth_write_mask = ZERO
depth_func = GREATER_EQUAL
handling = skip
drawindexed = 1788, 451980, 0

[TextureOverride0Dialyn01IB]
hash = cd519abe
handling = skip

[TextureOverride0Dialyn01A]
hash = cd519abe
match_first_index = 0
ib = Resource0Dialyn01AIB
run = CommandList\ZZMI\SetTextures
; 0Dialyn01A-vb0=d0470351.txt.001 (3)
drawindexed = 3, 0, 0


; 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 = 1
endif

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

[Resource0Dialyn0HPosition]
type = Buffer
stride = 40
filename = 0Dialyn0HPosition.buf

[Resource0Dialyn0HBlend]
type = Buffer
stride = 32
filename = 0Dialyn0HBlend.buf

[Resource0Dialyn0HTexcoord]
type = Buffer
stride = 20
filename = 0Dialyn0HTexcoord.buf

[Resource0Dialyn0HAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = 0Dialyn0HA.ib

[Resource0Dialyn0HBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = 0Dialyn0HB.ib

[Resource0Dialyn00Position]
type = Buffer
stride = 40
filename = 0Dialyn00Position.buf

[Resource0Dialyn00Blend]
type = Buffer
stride = 32
filename = 0Dialyn00Blend.buf

[Resource0Dialyn00Texcoord]
type = Buffer
stride = 24
filename = 0Dialyn00Texcoord.buf

[Resource0Dialyn00AIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = 0Dialyn00A.ib

[Resource0Dialyn01Position]
type = Buffer
stride = 40
filename = 0Dialyn01Position.buf

[Resource0Dialyn01Blend]
type = Buffer
stride = 32
filename = 0Dialyn01Blend.buf

[Resource0Dialyn01Texcoord]
type = Buffer
stride = 20
filename = 0Dialyn01Texcoord.buf

[Resource0Dialyn01AIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = 0Dialyn01A.ib

[ResourceCreditInfo]
type = Buffer
data = "Created by KanouSakura"

; .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
