; Grace

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

[Constants]
global persist $swapvarup = 0
global persist $swapvarlow = 0
global persist $swapvard = 0
global persist $swapvarg = 0
global persist $swapvarn = 0
global $active = 0
global $creditinfo = 0

[KeySwapUP]
condition = $active == 1
key = no_alt VK_UP
type = cycle
$swapvarup = 0,1,2

[KeySwapDOWN]
condition = $active == 1
key = no_alt VK_DOWN
type = cycle
$swapvarlow = 0,1,2,3

[KeySwapRIGHT]
condition = $active == 1
key = no_alt VK_RIGHT
type = cycle
$swapvard = 0,1

[KeySwapLEFT]
condition = $active == 1
key = no_alt VK_LEFT
type = cycle
$swapvarg = 0,1

[KeySwapNade]
condition = $active == 1
key = alt VK_RIGHT
type = cycle
$swapvarn = 0,1

[Present]
post $active = 0
run = CommandListCreditInfo

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

[TextureOverrideGraceEffect]
hash = 644ec1fe
handling = skip


[TextureOverrideGraceHairBlend]
hash = 1bed412f
handling = skip
vb2 = ResourceGraceHairBlend
if DRAW_TYPE == 1
	vb0 = ResourceGraceHairPosition
	draw = 4400,0
endif
$active = 1

[TextureOverrideGraceHairTexcoord]
hash = 89d903ba
vb1 = ResourceGraceHairTexcoord

[TextureOverrideGraceHairVertexLimitRaise]
hash = 9e96a54f
override_vertex_count = 4400
override_byte_stride = 92

[TextureOverrideGraceBodyBlend]
hash = 3b80154c
handling = skip
vb2 = ResourceGraceBodyBlend
if DRAW_TYPE == 1
	vb0 = ResourceGraceBodyPosition
	draw = 41130,0
endif
$active = 1

[TextureOverrideGraceBodyTexcoord]
hash = 4bb45448
vb1 = ResourceGraceBodyTexcoord

[TextureOverrideGraceBodyVertexLimitRaise]
hash = f1cba806
override_vertex_count = 41130
override_byte_stride = 96

[TextureOverrideGraceHairIB]
hash = 89299f56
handling = skip

[TextureOverrideGraceHairA]
hash = 89299f56
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceGraceHairAIB
; GraceHairA
	; Details.L (89)
	if $swapvard == 0
	drawindexed = 222, 0, 0
	endif
	; Details.R (138)
	if $swapvard == 0
	drawindexed = 261, 222, 0
	endif
	; Glasses.001 (1180)
	if $swapvarg == 0
	drawindexed = 3000, 483, 0
	endif
	; Hair (2959)
	drawindexed = 12651, 3483, 0

[TextureOverrideGraceHairADiffuse]
hash = a87d2822
this = ResourceGraceHairADiffuse

[TextureOverrideGrace.HairA.Diffuse.1024]
hash = 94d04401
this = ResourceGraceHairADiffuse

[TextureOverrideGraceHairANormalMap]
hash = 846fab9a
this = ResourceGraceHairANormalMap

[TextureOverrideGrace.HairA.NormalMap.1024]
hash = 1c4079f7
this = ResourceGraceHairANormalMap

[TextureOverrideGraceHairALightMap]
hash = 8eddd041
this = ResourceGraceHairALightMap

[TextureOverrideGrace.HairA.LightMap.1024]
hash = 26bf1588
this = ResourceGraceHairALightMap

[TextureOverrideGraceHairAMaterialMap]
hash = 3a38f6f9
this = ResourceGraceHairAMaterialMap

[TextureOverrideGrace.HairA.MaterialMap.1024]
hash = e1cb3739
this = ResourceGraceHairAMaterialMap

[TextureOverrideGraceHairB]
hash = 89299f56
match_first_index = 23127
run = CommandListSkinTexture
ib = ResourceGraceHairBIB
; GraceHairB
	; Glasses (34)
	if $swapvarg == 0
	drawindexed = 90, 0, 0
	endif

[TextureOverrideGraceBodyIB]
hash = 8b240678
handling = skip

[TextureOverrideGraceBodyA]
hash = 8b240678
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceGraceBodyAIB
; GraceBodyA
	; BaseXXBody.Hands (618)
	if $swapvard == 1
	drawindexed = 3072, 0, 0
	endif
	; BaseXXBody.Lower.Covered (8844)
	if $swapvard == 0
	drawindexed = 48258, 3072, 0
	endif
	; BaseXXBody.Lower.Exposed (8844)
	if $swapvard == 1 || $swapvarlow == 3
	drawindexed = 48258, 51330, 0
	endif
	; BaseXXBody.Upper.Covered (4181)
	if $swapvarup == 0
	drawindexed = 22596, 99588, 0
	endif
	; BaseXXBody.Upper.Exposed (4181)
	if $swapvarup != 0
	drawindexed = 22596, 122184, 0
	endif
	; BlackGlove (1039)
	drawindexed = 4428, 144780, 0
	; HandLeft (212)
	if $swapvard == 0
	drawindexed = 1068, 149208, 0
	endif
	; HandR (424)
	if $swapvard == 0
	drawindexed = 1800, 150276, 0
	endif
	; Kneepad (1257)
	if $swapvard == 0
	drawindexed = 3282, 152076, 0
	endif
	; Neck (285)
	drawindexed = 1164, 155358, 0
	; Panties.Covered. (1286)
	if $swapvarlow == 1
	drawindexed = 3186, 156522, 0
	endif
	; Panties.Exposed. (963)
	if $swapvarlow == 2
	drawindexed = 2334, 159708, 0
	endif
	; Shoes (1242)
	drawindexed = 4956, 162042, 0
	; Shorts (1415)
	if $swapvarlow == 0
	drawindexed = 4473, 166998, 0
	endif
	; Shoulder (624)
	drawindexed = 2196, 171471, 0
	; Socks (546)
	if $swapvard == 0
	drawindexed = 2340, 173667, 0
	endif
	; Thigh.Belt (559)
	if $swapvard == 0 && $swapvarlow != 3
	drawindexed = 1344, 176007, 0
	endif
	; Top.Def (1645)
	if $swapvarup == 0
	drawindexed = 4134, 177351, 0
	endif
	; Top_Belt (603)
	if $swapvarup == 1
	drawindexed = 1860, 181485, 0
	endif
	; WhiteClovePart (223)
	if $swapvard == 0
	drawindexed = 708, 183345, 0
	endif
	; WhiteGlove (805)
	drawindexed = 3720, 184053, 0

[TextureOverrideGraceBodyADiffuse]
hash = 6d6ac4f4
this = ResourceGraceBodyADiffuse

[TextureOverrideGrace.BodyA.Diffuse.1024]
hash = 397a8aed
this = ResourceGraceBodyADiffuse

[TextureOverrideGraceBodyANormalMap]
hash = 1e794b69
this = ResourceGraceBodyANormalMap

[TextureOverrideGrace.BodyA.NormalMap.1024]
hash = 9abd7824
this = ResourceGraceBodyANormalMap

[TextureOverrideGraceBodyALightMap]
hash = 993fe3e1
this = ResourceGraceBodyALightMap

[TextureOverrideGrace.BodyA.LightMap.1024]
hash = 59dd8899
this = ResourceGraceBodyALightMap

[TextureOverrideGraceBodyAMaterialMap]
hash = e8345f2c
this = ResourceGraceBodyAMaterialMap

[TextureOverrideGrace.BodyA.MaterialMap.1024]
hash = a6c8c203
this = ResourceGraceBodyAMaterialMap

[TextureOverrideGraceBodyB]
hash = 8b240678
match_first_index = 42927
run = CommandListSkinTexture
ib = ResourceGraceBodyBIB
; GraceBodyB
	; Nade (1334)
	if $swapvarlow == 0 && $swapvarn == 0
	drawindexed = 3312, 0, 0
	endif

[TextureOverrideGraceBodyBDiffuse]
hash = 210b3ebf
this = ResourceGraceBodyBDiffuse

[TextureOverrideGrace.BodyB.Diffuse.1024]
hash = 21794bd6
this = ResourceGraceBodyBDiffuse

[TextureOverrideGraceBodyBNormalMap]
hash = 06cb1413
this = ResourceGraceBodyBNormalMap

[TextureOverrideGrace.BodyB.NormalMap.1024]
hash = c5f703be
this = ResourceGraceBodyBNormalMap

[TextureOverrideGraceBodyBLightMap]
hash = 08082f5f
this = ResourceGraceBodyBLightMap

[TextureOverrideGrace.BodyB.LightMap.1024]
hash = a60162a0
this = ResourceGraceBodyBLightMap

[TextureOverrideGraceBodyBMaterialMap]
hash = f176398a
this = ResourceGraceBodyBMaterialMap

[TextureOverrideGrace.BodyB.MaterialMap.1024]
hash = b5b88a3f
this = ResourceGraceBodyBMaterialMap

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

[CommandListCreditInfo]
if $creditinfo == 0 && $active == 1
    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 -------------------------

[ResourceGraceHairPosition]
type = Buffer
stride = 40
filename = GraceHairPosition.buf

[ResourceGraceHairBlend]
type = Buffer
stride = 32
filename = GraceHairBlend.buf

[ResourceGraceHairTexcoord]
type = Buffer
stride = 20
filename = GraceHairTexcoord.buf

[ResourceGraceBodyPosition]
type = Buffer
stride = 40
filename = GraceBodyPosition.buf

[ResourceGraceBodyBlend]
type = Buffer
stride = 32
filename = GraceBodyBlend.buf

[ResourceGraceBodyTexcoord]
type = Buffer
stride = 24
filename = GraceBodyTexcoord.buf

[ResourceGraceHairAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = GraceHairA.ib

[ResourceGraceHairBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = GraceHairB.ib

[ResourceGraceBodyAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = GraceBodyA.ib

[ResourceGraceBodyBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = GraceBodyB.ib

[ResourceGraceHairADiffuse]
filename = GraceHairADiffuse.dds

[ResourceGraceHairANormalMap]
filename = GraceHairANormalMap.dds

[ResourceGraceHairALightMap]
filename = GraceHairALightMap.dds

[ResourceGraceHairAMaterialMap]
filename = GraceHairAMaterialMap.dds

[ResourceGraceBodyADiffuse]
filename = GraceBodyADiffuse.dds

[ResourceGraceBodyANormalMap]
filename = GraceBodyANormalMap.dds

[ResourceGraceBodyALightMap]
filename = GraceBodyALightMap.dds

[ResourceGraceBodyAMaterialMap]
filename = GraceBodyAMaterialMap.dds

[ResourceGraceBodyBDiffuse]
filename = GraceBodyBDiffuse.dds

[ResourceGraceBodyBNormalMap]
filename = GraceBodyBNormalMap.dds

[ResourceGraceBodyBLightMap]
filename = GraceBodyBLightMap.dds

[ResourceGraceBodyBMaterialMap]
filename = GraceBodyBMaterialMap.dds

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

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