; SigridHair

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

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

; --------------------------------------------------耳朵
global persist $ErDuo = 2
; --------------------------------------------------发饰
global persist $TouShi = 3
; --------------------------------------------------头发
global persist $TouFa = 2
; --------------------------------------------------眼镜
global persist $YanJing = 1



[Present]
post $active = 0
run = CommandListCreditInfo


; --------------------------------------------------耳朵
[KeyErDuo]
condition = $active == 1
key = ctrl no_alt no_Shift =
type = cycle
$ErDuo = 0,1,2
; --------------------------------------------------发饰
[KeyTouShi]
condition = $active == 1
key = ctrl no_alt no_Shift _
type = cycle
$TouShi = 0,1,2,3
; --------------------------------------------------头发
[KeyTouFa]
condition = $active == 1
key = no_ctrl no_alt no_Shift =
type = cycle
$TouFa = 1,2
; --------------------------------------------------眼镜
[KeyYanJing]
condition = $active == 1
key = no_ctrl no_alt no_Shift _
type = cycle
$YanJing = 0,1,2



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

[TextureOverrideSigridHairBlend]
hash = 380ee24b
handling = skip
$active = 1
if DRAW_TYPE == 2 || DRAW_TYPE == 4
	vb1 = ResourceSigridHairTexcoord
	vb2 = ResourceSigridHairBlend
	checktextureoverride = ib
elif DRAW_TYPE == 1
	vb0 = ResourceSigridHairPosition
	vb2 = ResourceSigridHairBlend
	Draw = 23739, 0
endif

[TextureOverrideSigridHairTexcoord]
hash = 6b1c911c
vb1 = ResourceSigridHairTexcoord

[TextureOverrideSigridHairVertexLimitRaise]
hash = 840c1713
override_vertex_count = 23739
override_byte_stride = 40

[TextureOverrideSigridHairA]
hash = 84618ee0
match_first_index = 0
match_index_count = 22296
handling = skip
ib = ResourceSigridHairAIB
Resource\ZZMI\Diffuse = ref ResourceA
Resource\ZZMI\NormalMap = ref ResourceNormalMap
Resource\ZZMI\LightMap = ref ResourceLightMap
Resource\ZZMI\MaterialMap = ref ResourceMaterialMap

Resource\ZZMI\GlowMap = ref ResourceGlowMap
run = CommandList\ZZMI\SetTextures
; SigridHairA-vb0=53d5d966.txt (3)
drawindexed = 3, 0, 0

[TextureOverrideSigridHairB]
hash = 84618ee0
match_first_index = 22296
match_index_count = 1164
handling = skip
ib = ResourceSigridHairBIB
Resource\ZZMI\Diffuse = ref ResourceA
Resource\ZZMI\NormalMap = ref ResourceNormalMap
Resource\ZZMI\LightMap = ref ResourceLightMap
Resource\ZZMI\MaterialMap = ref ResourceMaterialMap


Resource\ZZMI\GlowMap = ref ResourceGlowMap
run = CommandList\ZZMI\SetTextures
; SigridHairB-vb0=53d5d966.txt (3)
drawindexed = 3, 0, 0

; 发型
	if $TouFa == 1
; 1原发 (5581)
drawindexed = 22170, 20151, 0
		elif $TouFa == 2
; 2新发型 (12346)
drawindexed = 45084, 42321, 0
endif

; 耳朵
	if $ErDuo == 1
; 1原版耳朵 (305)
drawindexed = 1290, 3, 0
		elif $ErDuo == 2
; 2兔子耳朵 (821)
drawindexed = 3942, 1293, 0
endif

; 眼镜
	if $YanJing == 1
; 1眼镜 (2206)
drawindexed = 6834, 5235, 0
; 1眼镜镜片 (134)
        run = CustomShaderTransparency1
; drawindexed = 624, 12069, 0
		elif $YanJing == 2
; 2太阳镜搁置 (2206)
drawindexed = 6834, 12693, 0
; 2太阳镜搁置镜片 (134)
        run = CustomShaderTransparency2
; drawindexed = 624, 19527, 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

; --------------------------------------------------头饰
[TextureOverride1IB]
hash = 64d7d56f
	if $TouShi == 3
handling = skip
		elif $TouShi == 2
handling = skip	
		elif $TouShi == 1
handling = 
	endif
endif

[TextureOverride2IB]
hash = b51bdd59
	if $TouShi == 3
handling = skip
		elif $TouShi == 2
handling = 
		elif $TouShi == 1
handling = skip
endif

; -------------------------------------------------; 1眼镜镜片 (134)
[CustomShaderTransparency1]
blend = ADD BLEND_FACTOR INV_BLEND_FACTOR
blend_factor[0] = 0.3
blend_factor[1] = 0.3
blend_factor[2] = 0.3
blend_factor[3] = 1
handling = skip
drawindexed = 624, 12069, 0
; -------------------------------------------------; 2太阳镜搁置 (2206)
[CustomShaderTransparency2]
blend = ADD BLEND_FACTOR INV_BLEND_FACTOR
blend_factor[0] = 0.3
blend_factor[1] = 0.3
blend_factor[2] = 0.3
blend_factor[3] = 1
handling = skip
drawindexed = 624, 19527, 0

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

[ResourceSigridHairPosition]
type = Buffer
stride = 40
filename = SigridHairPosition.buf

[ResourceSigridHairBlend]
type = Buffer
stride = 32
filename = SigridHairBlend.buf

[ResourceSigridHairTexcoord]
type = Buffer
stride = 20
filename = SigridHairTexcoord.buf

[ResourceSigridHairAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SigridHairA.ib

[ResourceSigridHairBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SigridHairB.ib
[ResourceA]
filename = ..\Texture\Hair\1.dds

[ResourceB]
filename = ..\Texture\Hair\2.dds

[ResourceC]
filename = ..\Texture\Hair\3.dds

[ResourceD]
filename = ..\Texture\Hair\4.dds

[ResourceE]
filename = ..\Texture\Hair\5.dds

[ResourceF]
filename = ..\Texture\Hair\6.dds

[ResourceG]
filename = ..\Texture\Hair\7.dds

[ResourceH]
filename = ..\Texture\Hair\8.dds

[ResourceNormalMap]
filename = ..\Texture\Hair\N.dds

[ResourceLightMap]
filename = ..\Texture\Hair\L.dds

[ResourceMaterialMap]
filename = ..\Texture\Hair\M.dds

[ResourceGlowMap]
filename = ..\Texture\Hair\G.dds

[ResourceGlowMap2]
filename = ..\Texture\Hair\G2.dds

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

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