; Ellen

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

[Constants]
global $active = 0
global $creditinfo = 0
global persist $head = 1
global persist $collar = 6
global persist $top = 3
global persist $bra  = 2
global persist $sleeves = 3
global persist $bottom = 5
global persist $legs = 6
global persist $gloves = 2
global persist $tail = 0

;Toggle Key Maps
[Keyhead]
condition = $active == 1
key = no_modifiers 6
type = cycle
$head = 1,2
$creditinfo = 0

[Keycollar]
condition = $active == 1
key = alt 6
type = cycle
$collar = 6,7,8
$creditinfo = 0

[Keytop]
condition = $active == 1
key = no_modifiers h
type = cycle
$top = 3,4,7
$creditinfo = 0

[Keybra]
condition = $active == 1
key = alt y
type = cycle
$bra = 2,4
$creditinfo = 0

[Keysleeves]
condition = $active == 1
key = no_modifiers y
type = cycle
$sleeves = 2,3,4,5
$creditinfo = 0

[Keybottom]
condition = $active == 1
key = alt h
type = cycle
$bottom = 5,11
$creditinfo = 0

[Keygloves]
condition = $active == 1
key = no_modifiers 7
type = cycle
$gloves = 2,3,0,7
$creditinfo = 0

[Keylegs]
condition = $active == 1
key = no_modifiers n
type = cycle
$legs = 6,7,9
$creditinfo = 0

[Present]
post $active = 0
run = CommandListCreditInfo

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

[TextureOverrideEllenBodyBlend]
hash = ed9cb852
handling = skip
vb2 = ResourceEllenBodyBlend
if DRAW_TYPE == 1
	vb0 = ResourceEllenBodyPosition
	draw = 125845, 0

	$active = 1
endif

[TextureOverrideEllenBodyTexcoord]
hash = 5ac6d5ee
vb1 = ResourceEllenBodyTexcoord

[TextureOverrideEllenBodyVertexLimitRaise]
hash = cdce1fc2
override_vertex_count = 125845
override_byte_stride = 40

[TextureOverrideEllenHairBlend]
hash = e91c93e0
handling = skip
vb2 = ResourceEllenHairBlend
if DRAW_TYPE == 1
	vb0 = ResourceEllenHairPosition
	draw = 123990, 0

	$active = 1
endif

[TextureOverrideEllenHairTexcoord]
hash = a27a8e1a
vb1 = ResourceEllenHairTexcoord

[TextureOverrideEllenHairVertexLimitRaise]
hash = 77ac5f85
override_vertex_count = 123990
override_byte_stride = 40

[TextureOverrideEllenBodyIB]
hash = e30fae03
handling = skip


[ResourceEllenHairTemp1]
[TextureOverrideEllenBodyA]
hash = e30fae03
match_first_index = 0
ib = ResourceEllenBodyAIB
run = CommandListBody

if $collar == 6
; Collar (126)
drawindexed = 276, 0, 0
; Xmas Scarf (1845)
drawindexed = 7665, 7092, 0
; Xmas Scarf.Fluff (2512)
drawindexed = 13680, 14757, 0
elif $collar == 7
; Collar (126)
drawindexed = 276, 0, 0
; Xmas Scarf (1845)
drawindexed = 7665, 7092, 0
elif $collar == 8
;No Collar
endif

; BodyShoulders
if $sleeves == 2
; Ellen Shoulder Sleeves.Frills (999)
drawindexed = 3297, 28437, 0
elif $sleeves == 3
; Xmas Shawl (649)
drawindexed = 3552, 32982, 0
; Xmas Shawl.Fluff (6141)
drawindexed = 32412, 36534, 0
elif $sleeves == 4
; Xmas Shawl (649)
drawindexed = 3552, 32982, 0
elif $sleeves == 5
; No Sleeves
endif

; Body Arms
if $gloves == 0
; Ellen Cuffs (1219)
drawindexed = 2277, 107922, 0
; Ellen.Arms (1687)
drawindexed = 9432, 110613, 0
; Ellen.Hands (6348)
drawindexed = 32352, 163665, 0
elif $gloves == 2
; Ellen.Arms.UnderGloves (570)
drawindexed = 2988, 120045, 0
; Xmas Gloves (6712)
drawindexed = 35232, 123033, 0
; Xmas Gloves.Fluff (1012)
drawindexed = 5400, 158265, 0
elif $gloves == 3
; Ellen.Arms.UnderGloves (570)
drawindexed = 2988, 120045, 0
; Xmas Gloves (6712)
drawindexed = 35232, 123033, 0
elif $gloves == 7
; Ellen.Arms (1687)
drawindexed = 9432, 110613, 0
; Ellen.Hands (6348)
drawindexed = 32352, 163665, 0
endif

; Body Hand
; Body Chest

; Ellen.Chest (4151)
drawindexed = 22392, 210018, 0

if $top == 3
; Xmas Dress.Top (4065)
drawindexed = 20745, 271344, 0
; Xmas Dress.Top.Fluff (4152)
drawindexed = 21168, 292089, 0
elif $top == 4
; Xmas Dress.Top (4065)
drawindexed = 20745, 271344, 0
elif $top == 7
; Topless
endif

if $top == 7
	if $bra == 2
		; Red Bikini Top (4222)
		drawindexed = 20484, 244452, 0
	elif $bra == 4
		; Ellen.Nipples (434)
		drawindexed = 2376, 232410, 0
	endif
endif

; Body Tail
; Ellen Tail (3806)
drawindexed = 10656, 418569, 0



ib = ResourceEllenHairAIB
vb0 = ResourceEllenVirtualHairPosition
vb1 = ResourceEllenHairTexcoord
vb2 = ResourceEllenHairBlend
vb3 = ResourceEllenVirtualHairPosition
ResourceEllenHairTemp1 = ref vs-cb1
vs-cb1 = ResourceEllenHairCaputreCB1

; HairPelvis
if $bottom == 5
; Ellen.Pelvis.NoSpread (9374)
drawindexed = 49620, 283296, 0
; Red Bikini Bottom (1586)
drawindexed = 7458, 382500, 0
elif $bottom == 11
; Ellen.Pelvis.Spreadable (9479)
drawindexed = 49584, 332916, 0
endif

; Hair Legs
if $legs == 6
; Xmas Leggings (3812)
drawindexed = 20172, 488562, 0
; Xmas Leggings.Fluff (1220)
drawindexed = 6480, 508734, 0
; Ellen.Leggings.Thighs (1068)
drawindexed = 5832, 447954, 0
elif $legs == 7
; Ellen.Leggings.Thighs (1068)
drawindexed = 5832, 447954, 0
; Xmas Leggings (3812)
drawindexed = 20172, 488562, 0
elif $legs == 9
; Ellen.Legs (2556)
drawindexed = 14472, 459618, 0
	if $shoes <= 1
	; Ellen.Feet.Shoes (4003)
	drawindexed = 20328, 558393, 0
	else
	; Ellen.Feet.Heels (4003)
	drawindexed = 20328, 538065, 0
	endif
endif

vs-cb1 = ResourceEllenHairTemp1

[TextureOverrideEllenHairIB]
hash = d44a8015
handling = skip

[ResourceEllenVirtualHairPosition]
[ResourceEllenHairCaputreCB1]
[TextureOverrideEllenHairA]
hash = d44a8015
match_first_index = 0
ResourceEllenVirtualHairPosition = copy vb0
ResourceEllenHairCaputreCB1 = copy vs-cb1 unless_null
ib = ResourceEllenHairAIB
run = CommandListBody

if $head == 1
; Xmas Santa Hat (7921)
drawindexed = 45336, 23427, 0
	run = CommandListHair
	; Ellen Hair.NoHeaddress (3277)
	drawindexed = 10440, 10440, 0
	run = CommandListBody
elif $head == 2
	run = CommandListHair
	; Ellen Hair.NoHeaddress (3277)
	drawindexed = 10440, 10440, 0
	run = CommandListBody
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

[CommandListBody]
Resource\ZZMI\Diffuse = ref ResourceEllenBodyADiffuse
Resource\ZZMI\NormalMap = ref ResourceEllenBodyANormalMap
Resource\ZZMI\LightMap = ref ResourceEllenBodyALightMap
Resource\ZZMI\MaterialMap = ref ResourceEllenBodyAMaterialMap
run = CommandList\ZZMI\SetTextures

[CommandListHair]
Resource\ZZMI\Diffuse = ref ResourceEllenHairADiffuse
Resource\ZZMI\NormalMap = ref ResourceEllenHairANormalMap
Resource\ZZMI\LightMap = ref ResourceEllenHairALightMap
Resource\ZZMI\MaterialMap = ref ResourceEllenHairAMaterialMap
run = CommandList\ZZMI\SetTextures
; Resources -------------------------

[ResourceEllenBodyPosition]
type = Buffer
stride = 40
filename = EllenBodyPosition.buf

[ResourceEllenBodyBlend]
type = Buffer
stride = 32
filename = EllenBodyBlend.buf

[ResourceEllenBodyTexcoord]
type = Buffer
stride = 24
filename = EllenBodyTexcoord.buf

[ResourceEllenBodyAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = EllenBodyA.ib

[ResourceEllenHairPosition]
type = Buffer
stride = 40
filename = EllenHairPosition.buf

[ResourceEllenHairBlend]
type = Buffer
stride = 32
filename = EllenHairBlend.buf

[ResourceEllenHairTexcoord]
type = Buffer
stride = 24
filename = EllenHairTexcoord.buf

[ResourceEllenHairAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = EllenHairA.ib

[ResourceEllenBodyADiffuse]
filename = EllenBodyADiffuse.dds

[ResourceEllenBodyANormalMap]
filename = EllenBodyANormalMap.dds

[ResourceEllenBodyALightMap]
filename = EllenBodyALightMap.dds

[ResourceEllenBodyAMaterialMap]
filename = EllenBodyAMaterialMap.dds

[ResourceEllenHairADiffuse]
filename = EllenHairADiffuse.dds

[ResourceEllenHairANormalMap]
filename = EllenHairANormalMap.dds

[ResourceEllenHairALightMap]
filename = EllenHairALightMap.dds

[ResourceEllenHairAMaterialMap]
filename = EllenHairAMaterialMap.dds

[ResourceCreditInfo]
type = Buffer
data = "Created by www.patreon.com/lewd_lad || lewdlad.fanbox.cc"

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