; Made by KanouSakura
; 本mod由狩野樱制作 

; My sponsorship method:
; 我的赞助方式：
; https://www.patreon.com/KanouSakura
; https://afdian.com/a/baka5

; thanks for your support!
; 感谢您的支持！

; (修改或搬运mod请勿删除我的作者信息 感谢理解)
; (Please do not delete my author information if you modify or move the mod. Thank you for your understanding)


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

[Constants]
global $active = 0
global $creditinfo = 0

global persist $hair = 0
global persist $coat = 0
global persist $down = 0
global persist $shoe = 0
global persist $ear = 0
global persist $tail = 0

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

[Keycoat]
condition = $active == 1
key = VK_LEFT
type = cycle
$coat = 0,1,2

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

[Keydown]
condition = $active == 1
key = VK_RIGHT
type = cycle
$down = 0,1,2,3

[Keyear]
condition = $active == 1
key = .
type = cycle
$ear = 0,1

[Keytail]
condition = $active == 1
key = /
type = cycle
$tail = 0,1

[Present]
post $active = 0
run = CommandListCreditInfo

; Overrides -------------------------
[TextureOverride.Active.Mark]
hash = 321768df
$active = 1

[TextureOverrideFace]
hash = 321768df
match_first_index = 0
run = CommandListSkinTexture
Resource\ZZMI\Diffuse = ref ResourceFace
run = CommandList\ZZMI\SetTextures

[ResourceFace]
filename = Face.dds

[TextureOverride0Jufufu0Blend]
hash = c06c0417
handling = skip
vb2 = Resource0Jufufu0Blend
if DRAW_TYPE == 1
	vb0 = Resource0Jufufu0Position
	draw = 73340, 0

	$active = 1
endif

[TextureOverride0Jufufu0Texcoord]
hash = 2e086db7
vb1 = Resource0Jufufu0Texcoord

[TextureOverride0Jufufu0VertexLimitRaise]
hash = 5c076ce8
override_vertex_count = 73340
override_byte_stride = 40

[TextureOverride0Jufufu1Blend]
hash = c9c19a97
handling = skip
vb2 = Resource0Jufufu1Blend
if DRAW_TYPE == 1
	vb0 = Resource0Jufufu1Position
	draw = 16868, 0

	$active = 1
endif

[TextureOverride0Jufufu1Texcoord]
hash = fbca830d
vb1 = Resource0Jufufu1Texcoord

[TextureOverride0Jufufu1VertexLimitRaise]
hash = 77d02cb1
override_vertex_count = 16868
override_byte_stride = 40

[TextureOverride0Jufufu2Blend]
hash = c8fa66e3
handling = skip
vb2 = Resource0Jufufu2Blend
if DRAW_TYPE == 1
	vb0 = Resource0Jufufu2Position
	draw = 1186, 0

	$active = 1
endif

[TextureOverride0Jufufu2Texcoord]
hash = 9a198bcf
vb1 = Resource0Jufufu2Texcoord

[TextureOverride0Jufufu2VertexLimitRaise]
hash = c84e77d4
override_vertex_count = 1186
override_byte_stride = 40

[TextureOverride0Jufufu0IB]
hash = de303163
handling = skip

[TextureOverride0Jufufu0A]
hash = de303163
match_first_index = 0
run = CommandListSkinTexture
ib = Resource0Jufufu0AIB
run = CommandList\ZZMI\SetTextures
; 0Jufufu0A (3)
drawindexed = 3, 0, 0
; 0Jufufu0A
; body (10234)
drawindexed = 46704, 3, 0
; feet (3002)
if $shoe == 2
drawindexed = 15720, 46707, 0
endif
; 外套 (8362)
if $coat == 0 || $coat == 1
drawindexed = 31989, 62427, 0
endif
; 帽子 (954)
if $hair == 0
drawindexed = 1620, 94416, 0
endif
; 绳子 (615)
if $down == 0
drawindexed = 2334, 96036, 0
endif
; 腰带 (1720)
if $down == 0 || $down == 1
drawindexed = 6678, 98370, 0
endif
; 袖子 (2415)
if $coat == 0
drawindexed = 8568, 105048, 0
endif
; 袜子 (32162)
if $shoe == 0 || $shoe == 1
drawindexed = 159108, 113616, 0
endif
; 裤子 (3862)
if $down == 0 || $down == 1 || $down == 2
drawindexed = 15579, 272724, 0
endif
; 网袜 (10011)
if $shoe == 0
drawindexed = 10023, 288303, 0
endif

[TextureOverride0Jufufu1IB]
hash = a4fd9113
handling = skip

[TextureOverride0Jufufu1A]
hash = a4fd9113
match_first_index = 0
run = CommandListSkinTexture
ib = Resource0Jufufu1AIB
run = CommandList\ZZMI\SetTextures
; 0Jufufu1A (3)
drawindexed = 3, 0, 0
; 0Jufufu1A
; hair0 (6447)
if $hair == 2
drawindexed = 26055, 3, 0
endif
; hair1 (10019)
if $hair == 0 ||  $hair == 1
drawindexed = 36291, 26058, 0
endif
; 耳朵 (399)
if $ear == 0
drawindexed = 1500, 62349, 0
endif

[TextureOverride0Jufufu2IB]
hash = f8ab3141
handling = skip

[TextureOverride0Jufufu2A]
hash = f8ab3141
match_first_index = 0
run = CommandListSkinTexture
ib = Resource0Jufufu2AIB
run = CommandList\ZZMI\SetTextures
; 0Jufufu2A (3)
drawindexed = 3, 0, 0
; 0Jufufu2A
; 尾巴 (886)
if $tail == 0
drawindexed = 3036, 3, 0
endif
; 腰带1 (297)
if $down == 0
drawindexed = 786, 3039, 0
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 = 1
endif

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


[Resource0Jufufu0Position]
type = Buffer
stride = 40
filename = 0Jufufu0Position.buf

[Resource0Jufufu0Blend]
type = Buffer
stride = 32
filename = 0Jufufu0Blend.buf

[Resource0Jufufu0Texcoord]
type = Buffer
stride = 20
filename = 0Jufufu0Texcoord.buf

[Resource0Jufufu0AIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = 0Jufufu0A.ib

[Resource0Jufufu1Position]
type = Buffer
stride = 40
filename = 0Jufufu1Position.buf

[Resource0Jufufu1Blend]
type = Buffer
stride = 32
filename = 0Jufufu1Blend.buf

[Resource0Jufufu1Texcoord]
type = Buffer
stride = 20
filename = 0Jufufu1Texcoord.buf

[Resource0Jufufu1AIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = 0Jufufu1A.ib

[Resource0Jufufu2Position]
type = Buffer
stride = 40
filename = 0Jufufu2Position.buf

[Resource0Jufufu2Blend]
type = Buffer
stride = 32
filename = 0Jufufu2Blend.buf

[Resource0Jufufu2Texcoord]
type = Buffer
stride = 20
filename = 0Jufufu2Texcoord.buf

[Resource0Jufufu2AIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = 0Jufufu2A.ib

[KeyHelp]
condition = $active == 1
key = 0
type = cycle
$help = 0,1

[ResourceImageToRender]
filename = 0Jufufu.png

[Constants]
global $x = 800
global $y = 3080
global $z = 0
global $w = 0

[Constants]
global $active
global $help
[Present]
post $active = 0
if $help == 1 && $active == 1
ps-t100 = ResourceImageToRender
run = CustomShaderDraw
endif

[CustomShaderDraw]
hs = null
ds = null
gs = null
cs = null
vs = Draw_2D.hlsl
ps = Draw_2D.hlsl
x87 = $x/res_width
y87 = $y/res_height
z87 = $z
w87 = $w
blend = ADD SRC_ALPHA INV_SRC_ALPHA
cull = none
topology = triangle_strip
o0 = set_viewport bb
Draw = 4,0
clear = ps-t100

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

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