; MARK: Nicole
; MARK: CONSTANTS
[Constants]
global $creditinfo = 0
global $active = 0
global $vartemp = 0
global persist $swapvarSliderBreast = 0
global persist $swapvarSliderBottom = 0
global persist $swapvarHair = 0
global persist $swapvarAmil = 0
global persist $swapvarJacket = 0
global persist $swapvarBandage = 0
global persist $swapvarTop = 0
global persist $swapvarShort = 0
global persist $swapvarSleeves = 0
global persist $swapvarLegs = 0
global persist $swapvarHeels = 0
global persist $swapvarColor = 0
global persist $swapvarFace = 0
[KeySwapswapvarHair]
condition = $active == 1
key = no_alt no_ctrl VK_UP
type = cycle
$swapvarHair = 0,1,2,3
[KeySwapswapvarAmil]
condition = $active == 1
key = alt no_ctrl VK_UP
type = cycle
$swapvarAmil = 0,1,2,3
[KeySwapswapvarJacket]
condition = $active == 1
key = no_alt ctrl VK_UP
type = cycle
$swapvarJacket = 0,1
[KeySwapswapvarBandage]
condition = $active == 1
key = alt ctrl VK_UP
type = cycle
$swapvarBandage = 0,1
[KeySwapswapvarTop]
condition = $active == 1
key = no_alt no_ctrl VK_LEFT
type = cycle
$swapvarTop = 0,1,2,3,4
[KeySwapswapvarShort]
condition = $active == 1
key = alt no_ctrl VK_LEFT
type = cycle
$swapvarShort = 0,1,2,3
[KeySwapswapvarSleeves]
condition = $active == 1
key = no_alt ctrl VK_RIGHT
type = cycle
$swapvarSleeves = 0,1,2
[KeySwapswapvarLegs]
condition = $active == 1
key = no_alt no_ctrl VK_RIGHT
type = cycle
$swapvarLegs = 0,1,2,3
[KeySwapswapvarHeels]
condition = $active == 1
key = alt ctrl VK_RIGHT
type = cycle
$swapvarHeels = 0,1,2
[KeySwapswapvarColor]
condition = $active == 1
key = no_alt no_ctrl VK_DOWN
type = cycle
$swapvarColor = 0,1
[KeySwapswapvarFace]
condition = $active == 1
key = alt no_ctrl VK_DOWN
type = cycle
$swapvarFace = 0,1
[Present]
post $active = 0
run = CommandListCreditInfo
; MARK: OVERRIDE
[TextureOverrideNicoleHairBlend]
hash = 347e4a48
handling = skip
vb2 = ResourceNicoleHairBlend
if DRAW_TYPE == 1
	vb0 = ResourceNicoleHairPosition
	draw = 14431,0
endif
$active = 1
[TextureOverrideNicoleHairTexcoord]
hash = 06e4fd79
vb1 = ResourceNicoleHairTexcoord
[TextureOverrideNicoleHairVertexLimitRaise]
hash = f6344432
override_vertex_count = 14431
override_byte_stride = 92
[TextureOverrideNicoleBodyBlend]
hash = 7ecda89f
handling = skip
vb2 = ResourceNicoleBodyBlend
if DRAW_TYPE == 1
	vb0 = ResourceNicoleBodyPosition
	draw = 59094,0
endif
$active = 1
[TextureOverrideNicoleBodyTexcoord]
hash = 91c1b779
vb1 = ResourceNicoleBodyTexcoord
[TextureOverrideNicoleBodyVertexLimitRaise]
hash = 8cc1262b
override_vertex_count = 59094
override_byte_stride = 92
[TextureOverrideNicoleAmillionBlend]
hash = 4e1d9c9a
handling = skip
vb2 = ResourceNicoleAmillionBlend
if DRAW_TYPE == 1
	vb0 = ResourceNicoleAmillionPosition
	draw = 632,0
endif
$active = 1
[TextureOverrideNicoleAmillionTexcoord]
hash = 077c3500
vb1 = ResourceNicoleAmillionTexcoord
[TextureOverrideNicoleAmillionVertexLimitRaise]
hash = bb7fffe9
override_vertex_count = 632
override_byte_stride = 92
[TextureOverrideNicoleHairIB]
hash = 6847bbbd
handling = skip
[TextureOverrideNicoleHairA]
hash = 6847bbbd
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceNicoleHairAIB
run = CommandListRunSlotFix
run = CommandListNicoleHairA
[TextureOverrideNicoleBodyIB]
hash = 5a4c1ef3
handling = skip
[TextureOverrideNicoleBodyA]
hash = 5a4c1ef3
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceNicoleBodyAIB
run = CommandListRunSlotFix
run = CommandListNicoleBodyA
[TextureOverrideNicoleBodyB]
hash = 5a4c1ef3
match_first_index = 46683
run = CommandListSkinTexture
ib = ResourceNicoleBodyBIB
run = CommandListRunSlotFix
run = CommandListNicoleBodyB
[TextureOverrideNicoleAmillionIB]
hash = 40e64ae2
handling = skip
[TextureOverrideNicoleAmillionA]
hash = 40e64ae2
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceNicoleAmillionAIB
run = CommandListRunSlotFix
run = CommandListNicoleAmillionA
[CommandListNicoleHairA]
; MARK: NicoleHairA
	; HairShort (1165)
	drawindexed = 4881, 0, 0
	; Hair_front (1165)
	drawindexed = 4881, 4881, 0
	; MARK: Acc
		; Acc_neck.001
		if $swapvarBandage == 0 && $swapvarHair == 1
		    drawindexed = 4320, 9762, 0
		endif
		; Amil_head
		if $swapvarAmil == 2
		    drawindexed = 2904, 14082, 0
		endif
		; Heart_blue
		if $swapvarAmil == 2
		    drawindexed = 312, 16986, 0
		endif
	; MARK: Hair 0
		; HairAlt_1
		if $swapvarHair == 0
		    drawindexed = 4620, 17298, 0
		endif
		; HairAlt_2
		if $swapvarHair == 0
		    drawindexed = 16644, 21918, 0
		endif
	; MARK: Hair 1/2
		; HairBase_A
		if $swapvarHair == 1 || $swapvarHair == 2
		    drawindexed = 10560, 38562, 0
		endif
		; HairBase_B
		if $swapvarHair == 1
		    drawindexed = 6102, 49122, 0
		endif
	; MARK: Hair 3
		; Hair_
		if $swapvarHair == 3
		    drawindexed = 8790, 55224, 0
		endif
[CommandListNicoleBodyA]
	; MARK: Body
		; BodyBody (2568)
		drawindexed = 13728, 0, 0
		; BreastA
		if $swapvarTop == 2 || $swapvarTop == 4
		    drawindexed = 8760, 13728, 0
		endif
		; BreastA.001
		if $swapvarTop == 3
		    drawindexed = 3714, 22488, 0
		endif
		; BreastC
		if $swapvarTop == 0 || $swapvarTop == 1
		    drawindexed = 8520, 26202, 0
		endif
		; FeetA.004
		if $swapvarLegs == 2
		    if $swapvarHeels != 1
		        if $swapvarHeels == 2
		            drawindexed = 3684, 34722, 0
		        endif
		    endif
		endif
		; Heart_yellow
		if $swapvarAmil == 2 && $swapvarBandage == 1 && $swapvarLegs != 1
		    drawindexed = 204, 38406, 0
		endif
		; LegsA
		if $swapvarLegs == 2
		    drawindexed = 6240, 38610, 0
		endif
		; LegsA.001
		if $swapvarLegs == 3
		    drawindexed = 1440, 44850, 0
		endif
		; ThighA
		if $swapvarBandage != 1 || $swapvarBandage != 1 && $swapvarLegs == 1
		    drawindexed = 2304, 46290, 0
		endif
		; MARK: Pin
			; Pin_A
			if $swapvarTop == 2 || $swapvarTop == 3 || $swapvarTop == 4
			    drawindexed = 24, 48594, 0
			endif
			; Pin_B
			if $swapvarTop == 0
			    drawindexed = 24, 48618, 0
			endif
			; Pin_C
			if $swapvarTop == 1
			    drawindexed = 24, 48642, 0
			endif
			; Pin_D
			if $swapvarBandage != 1
			    drawindexed = 24, 48666, 0
			endif
			; Pin_E
			if $swapvarBandage == 1
			    drawindexed = 24, 48690, 0
			endif
	; MARK: Jacket
		; Jacket
		if $swapvarJacket == 0
		    drawindexed = 5349, 48714, 0
		endif
		; Stickers
		if $swapvarJacket == 0
		    drawindexed = 2466, 54063, 0
		endif
	; MARK: Sleeves
		; Acc_c (272)
		drawindexed = 1152, 56529, 0
		; Acc_c.001
		if $swapvarHeels != 1 && $swapvarLegs != 3
		    drawindexed = 1296, 57681, 0
		endif
		; Black-gloves
		if $swapvarSleeves == 1
		    drawindexed = 12792, 58977, 0
		endif
		; Black_sleev
		if $swapvarSleeves == 0
		    drawindexed = 12036, 71769, 0
		endif
		; Black_sleev.001
		if $swapvarSleeves == 0 || $swapvarBandage == 1
		    drawindexed = 648, 83805, 0
		endif
		; Hands
		if $swapvarSleeves == 1 || $swapvarSleeves == 2
		    drawindexed = 10908, 84453, 0
		endif
	; MARK: Neck
		; Acc_b (152)
		drawindexed = 624, 95361, 0
		; Acc_neck
		if $swapvarBandage != 1 && $swapvarTop != 3
		    drawindexed = 2160, 95985, 0
		endif
		; Base_neck (569)
		drawindexed = 1950, 98145, 0
		; Belt_neck_a
		if $swapvarBandage == 1 && $swapvarTop != 3
		    drawindexed = 288, 100095, 0
		endif
	; MARK: Thight
		; Base_body.008
		if $swapvarLegs == 0
		    drawindexed = 5118, 100383, 0
		endif
		; Black_thight_a
		if $swapvarLegs == 1
		    drawindexed = 10344, 105501, 0
		endif
		; Black_thight_a.001
		if $swapvarLegs == 1
		    if $swapvarHeels != 1
		        drawindexed = 3072, 115845, 0
		    endif
		endif
		; FeetA
		if $swapvarLegs == 2
		    if $swapvarHeels != 1
		        drawindexed = 3072, 118917, 0
		    endif
		endif
		; FeetA.001
		if $swapvarLegs == 0
		    if $swapvarHeels != 1
		        drawindexed = 2721, 121989, 0
		    endif
		endif
		; FeetA.003
		if $swapvarLegs == 0
		    if $swapvarHeels != 1
		        if $swapvarHeels == 2
		            drawindexed = 3120, 124710, 0
		        endif
		    endif
		endif
		; FeetA.005
		if $swapvarLegs == 1
		    if $swapvarHeels != 1
		        if $swapvarHeels == 2
		            drawindexed = 3120, 127830, 0
		        endif
		    endif
		endif
		; ThighB
		if $swapvarBandage == 1 || $swapvarBandage == 1 && $swapvarLegs == 1
		    drawindexed = 2304, 130950, 0
		endif
	; MARK: Feet
		; Boots
		if $swapvarHeels == 1
		    drawindexed = 7140, 133254, 0
		endif
		; HeelsB
		if $swapvarHeels == 0
		    if $swapvarLegs != 3
		        drawindexed = 4134, 140394, 0
		    endif
		endif
		; HeelsB.001
		if $swapvarHeels == 2
		    if $swapvarLegs != 3
		        drawindexed = 3444, 144528, 0
		    endif
		endif
		; HeelsB.003
		if $swapvarHeels == 2 || $swapvarHeels == 0
		    if $swapvarLegs == 3
		        drawindexed = 1164, 147972, 0
		    endif
		endif
	; MARK: Shorts
		; Corset
		if $swapvarShort == 1 && $swapvarTop != 3
		    drawindexed = 2544, 149136, 0
		endif
		; Corset.001
		if $swapvarShort == 1 && $swapvarTop == 3
		    drawindexed = 306, 151680, 0
		endif
		; Shorts
		if $swapvarShort == 0
		    if $swapvarTop != 3
		        drawindexed = 3561, 151986, 0
		    endif
		endif
	; MARK: Top
		; Top_a
		if $swapvarTop == 1
		    drawindexed = 4920, 155547, 0
		endif
		; Top_a.001
		if $swapvarTop == 0
		    drawindexed = 2304, 160467, 0
		endif
	; MARK: Bandage
		; Base_Hands.001
		if $swapvarBandage == 1 && $swapvarLegs != 1
		    if $swapvarTop != 3
		        drawindexed = 1248, 162771, 0
		    endif
		endif
		; Base_Hands.006
		if $swapvarBandage == 1 && $swapvarLegs != 1
		    drawindexed = 1152, 164019, 0
		endif
		; Base_Hands.007
		if $swapvarBandage == 1
		    if $swapvarTop != 3
		        drawindexed = 1464, 165171, 0
		    endif
		endif
		; Base_Hands.010
		if $swapvarBandage == 1
		    if $swapvarTop != 3
		        drawindexed = 1476, 166635, 0
		    endif
		endif
		; Belt_corset
		if $swapvarShort == 1 || $swapvarBandage == 1
		    if $swapvarTop != 3
		        drawindexed = 576, 168111, 0
		    endif
		endif
		; Bow_Head
		if $swapvarBandage == 1 && $swapvarHair == 1
		    drawindexed = 1164, 168687, 0
		endif
		; Circle
		if $swapvarShort == 1 || $swapvarBandage == 1
		    if $swapvarTop != 3
		        drawindexed = 480, 169851, 0
		    endif
		endif
		; Plane.002
		if $swapvarBandage == 1
		    if $swapvarTop != 3
		        drawindexed = 528, 170331, 0
		    endif
		endif
		; Plane.005
		if $swapvarBandage == 1
		    if $swapvarTop != 3
		        drawindexed = 888, 170859, 0
		    endif
		endif
		; vc
		if $swapvarBandage == 1
		    if $swapvarTop != 3
		        drawindexed = 810, 171747, 0
		    endif
		endif
	; MARK: Amillion
		; Amil_Breast
		if $swapvarAmil == 3
		    if $swapvarTop == 0 || $swapvarTop == 1
		        drawindexed = 2346, 172557, 0
		    endif
		endif
		; Amil_leg
		if $swapvarAmil == 2 && $swapvarBandage == 1 && $swapvarLegs != 1
		    drawindexed = 3048, 174903, 0
		endif
[CommandListNicoleBodyB]
; MARK: NicoleBodyB
	; Acc_a (288)
	drawindexed = 318, 0, 0
	; Acc_a.001
	if $swapvarTop == 2
	    drawindexed = 648, 318, 0
	endif
	; Acc_a.002
	if $swapvarShort == 2
	    if $swapvarTop != 3
	        drawindexed = 318, 966, 0
	    endif
	endif
	; Acc_a.003
	if $swapvarBandage == 1
	    if $swapvarTop != 3
	        drawindexed = 948, 1284, 0
	    endif
	endif
	; Acc_a.004
	if $swapvarShort != 0
	    if $swapvarLegs == 1 || $swapvarBandage == 1
	        if $swapvarTop != 3
	            drawindexed = 636, 2232, 0
	        endif
	    endif
	endif
	; Acc_a.005
	if $swapvarBandage == 1
	    drawindexed = 318, 2868, 0
	endif
	; Belt_neck_a.002
	if $swapvarTop == 3
	    drawindexed = 480, 3186, 0
	endif
	; BodyBody.009
	if $swapvarLegs == 3
	    drawindexed = 3168, 3666, 0
	endif
	; Dress
	if $swapvarTop == 3
	    drawindexed = 6576, 6834, 0
	endif
	; FeetA.002
	if $swapvarLegs == 3
	    if $swapvarHeels != 1
	        drawindexed = 1554, 13410, 0
	    endif
	endif
	; FeetA.007
	if $swapvarLegs == 3
	    drawindexed = 954, 14964, 0
	endif
	; HeelsB.002
	if $swapvarHeels == 2 || $swapvarHeels == 0
	    if $swapvarLegs == 3
	        drawindexed = 2442, 15918, 0
	    endif
	endif
[CommandListNicoleAmillionA]
; MARK: NicoleAmillionA
	; Amil_Base
	if $swapvarAmil == 1
	    drawindexed = 2760, 0, 0
	endif
; MARK: TEXTURES
[ResourceNicoleDiffuse]
filename = .\Textures\NicoleDiffuse.dds
[ResourceNicoleNormalMap]
filename = .\Textures\NicoleNormalMap.dds
[ResourceNicoleLightMap]
filename = .\Textures\NicoleLightMap.dds
[ResourceNicoleMaterialMap]
filename = .\Textures\NicoleMaterialMap.dds
[ResourceNicoleGlowMap]
filename = .\Textures\NicoleGlowMap.dds
[ResourceNicoleDiffusePink]
filename = .\Textures\NicoleDiffusePink.dds
; MARK: FACE
[TextureOverrideNicoleFaceIB]
hash = 7435fc0e
; MARK: SLOTS
[CommandListRunSlotFix]
ps-t9 = ResourceNicoleDiffuse
if $swapvarColor == 0
ps-t3 = ResourceNicoleDiffuse
else
ps-t3 = ResourceNicoleDiffusePink
endif
ps-t4 = ResourceNicoleNormalMap
ps-t5 = ResourceNicoleLightMap
ps-t6 = ResourceNicoleMaterialMap
ps-t8 = ResourceNicoleGlowMap
; MARK: CREDIT FUNCTION
[CommandListCreditInfo]
if $creditinfo == 0 && $active == 1 && $disablecredits == 0
    if $lasttime == 0
    $lasttime = time
    endif
    $credits = time - $lasttime
    $credits = $credits * 20.0
    run = CommandListCreditPlateSDX
    if $credits >= 40
        $credits = 0
        $creditinfo = 1
    endif
endif
; MARK: CREDIT VALUES
[Constants]
global $cmx = 0.02
global $cmy = 0.83
global $credits = 0
global persist $disablecredits = 0
global $lasttime = 0
global $ww
global $wh
global $cpx
global $cpy
global $dt
global $ts
[KeySwapDisableCredits]
condition = $active == 1
key = alt ctrl /
type = cycle
$disablecredits = 0,1
[CommandListDimensionsCredit]
if window_width != 0
  $ww = window_width
  $wh = window_height
else
  if $ww != 0
    $ww = rt_width
    $wh = rt_height
  else
    $ww = res_width
    $wh = res_height
  endif
endif
if cursor_x != 0 && cursor_y != 0
  $cpx = cursor_x
  $cpy = cursor_y
else
  if cursor_window_x != 0 && cursor_window_y != 0
    $cpx = cursor_window_x / $ww
    $cpy = cursor_window_y / $wh
  else
    $cpx = cursor_screen_x / $ww
    $cpy = cursor_screen_y / $wh
  endif
endif
[CommandListCreditPlateSDX]
run = CommandListDimensionsCredit
run = CommandListCreditPlate
[CommandListCreditPlate]
local $cox
local $coy
x88 = $credits
ps-t100 = ResourceCredit
y87 = 128 / $wh
x87 = 512 / $ww
z87 = $cmx
w87 = $cmy
run = CustomShaderCredit
[CustomShaderCredit]
vs = .\Shaders\CreditRender.hlsl
ps = .\Shaders\CreditRender.hlsl
run = BuiltInCommandListUnbindAllRenderTargets
blend = ADD SRC_ALPHA INV_SRC_ALPHA
cull = none
topology = triangle_strip
o0 = set_viewport bb
Draw = 4,0
[ResourceCredit]
filename = .\UIResources\Credit.png
; MARK: MODELS
[ResourceNicoleHairPosition]
type = Buffer
stride = 40
filename = .\Meshes\NicoleHairPosition.buf
[ResourceNicoleHairBlend]
type = Buffer
stride = 32
filename = .\Meshes\NicoleHairBlend.buf
[ResourceNicoleHairTexcoord]
type = Buffer
stride = 20
filename = .\Meshes\NicoleHairTexcoord.buf
[ResourceNicoleBodyPosition]
type = Buffer
stride = 40
filename = .\Meshes\NicoleBodyPosition.buf
[ResourceNicoleBodyBlend]
type = Buffer
stride = 32
filename = .\Meshes\NicoleBodyBlend.buf
[ResourceNicoleBodyTexcoord]
type = Buffer
stride = 20
filename = .\Meshes\NicoleBodyTexcoord.buf
[ResourceNicoleAmillionPosition]
type = Buffer
stride = 40
filename = .\Meshes\NicoleAmillionPosition.buf
[ResourceNicoleAmillionBlend]
type = Buffer
stride = 32
filename = .\Meshes\NicoleAmillionBlend.buf
[ResourceNicoleAmillionTexcoord]
type = Buffer
stride = 20
filename = .\Meshes\NicoleAmillionTexcoord.buf
[ResourceNicoleHairAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\Meshes\NicoleHairA.ib
[ResourceNicoleBodyAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\Meshes\NicoleBodyA.ib
[ResourceNicoleBodyBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\Meshes\NicoleBodyB.ib
[ResourceNicoleAmillionAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\Meshes\NicoleAmillionA.ib
[ResourceCreditInfo]
type = Buffer
data = "Created by FleurNaive"

; MARK: UI
[Constants]
global $menu = 0
global $hold
global $holdSlot
global $holdingSlot
global $drag
global $hovering
global $slot
global $hoveredSlot
global $clickedSlot
global persist $mx = 0.05
global persist $my = 0.25
global $ww
global $wh
global $cpx
global $cpy
global $dt
global $ts
global $page

global $UIfps = 60
global $UIframeStart= -500
global $UIframeEnd = 500
global persist $swapvarUIAnim = 0

[KeyShowMenuAlt]
condition = $active == 1
key = no_alt no_ctrl /
type = cycle
$menu = 0,1

[KeyShowMenuPage]
condition = $active == 1
key = alt no_ctrl /
type = cycle
$page = 0,1

[KeyMenu.ResetPosition]
condition = $menu == 1
key = \
run = CommandListResetMenuPos

[KeyHold]
condition = $menu == 1 && $hovering == 0
key = no_ctrl no_shift VK_LBUTTON
key = no_ctrl no_shift VK_RBUTTON
type = hold
$hold = 1

[KeyHolding]
condition = $menu == 1 && $hovering == 1
key = no_ctrl no_shift VK_LBUTTON
key = no_ctrl no_shift VK_RBUTTON
type = hold
$holdSlot = 1


[KeyClickedSlot]
condition = $hovering == 1 && $menu == 1
key = no_ctrl no_shift VK_LBUTTON
key = no_ctrl no_shift VK_RBUTTON
run = CommandListClickedSlot

[CommandListUIAnimation]
$swapvarUIAnim = (time * $UIfps % ($UIframeEnd - $UIframeStart + 1) + $UIframeStart) // 1
if $active
  $dt = time - $ts
  $ts = time
  if $menu
    run = CommandListOutfitMenu
  endif
endif

[Present]
if active == 1
run = CommandListUIAnimation
endif
[CommandListDimensions]
if window_width != 0
  $ww = window_width
  $wh = window_height
else
  if $ww != 0
    $ww = rt_width
    $wh = rt_height
  else
    $ww = res_width
    $wh = res_height
  endif
endif

if cursor_x != 0 && cursor_y != 0
  $cpx = cursor_x
  $cpy = cursor_y
else
  if cursor_window_x != 0 && cursor_window_y != 0
    $cpx = cursor_window_x / $ww
    $cpy = cursor_window_y / $wh
  else
    $cpx = cursor_screen_x / $ww
    $cpy = cursor_screen_y / $wh
  endif
endif

[CommandListOutfitMenu]
run = CommandListDimensions
run = CommandListBackground

[CommandListBackground]
local $cox
local $coy

x88 = $swapvarUIAnim
ps-t100 = ResourceMenuBack
ps-t101 = ResourceMenuPlate
ps-t102 = ResourceMenuFrontShadow
y87 = 800 / $wh
x87 = 312 / $ww

if $hovering == 0
    if $drag == 0
        if $cpx > $mx + 0.0125 && $cpx < ($mx+x87-0.0035) && $cpy > $my && $cpy < ($my+y87-0.0035)
            if $hold
                $cox = $cpx - $mx
                $coy = $cpy - $my
                $drag = 1
            endif
        endif
    else
        if $hold
            $mx = $cpx - $cox
            $my = $cpy - $coy
        else
            $drag = 0
        endif
    endif
endif
z87 = $mx
w87 = $my
run = CustomShaderElementMenu
run = CommandListDrawToggles

[CommandListSlot]
ps-t100 = ResourceItemSlotBack
run = CustomShaderElement

run = CommandListSlotItemImage

if $cpx > z87 && $cpx < (z87 + x87 - 0.0035) && $cpy > w87 && $cpy < (w87 + y87 - 0.0035)
	ps-t100 = ResourceItemSlotHover.SlotHover
	$hovering = 1
	$hoveredSlot = $slot
	ps-t100 = ResourceItemSlotHover.SlotHover
else
	ps-t100 = ResourceItemSlot
endif

x87 = 76 / $ww 
y87 = 76 / $wh
z87 = z87 - 6 / $ww
w87 = w87 - 12 / $ww

run = CustomShaderElement

if $clickedSlot == $slot
	ps-t100 = ResourceItemSlotHover.SlotClicked
	run = CustomShaderElement
	$clickedSlot = 0
endif

[CommandListSlotSlider]
run = CommandListSlotItemImage

if $cpx > z87 && $cpx < (z87 + x87 - 0.0035) && $cpy > w87 && $cpy < (w87 + y87 - 0.0035)
	ps-t100 = ResourceItemSlotHover.SlotHover
	$hovering = 1
	$hoveredSlot = $slot

endif

if $holdSlot == 1
	run = CommandListHoldingSlot
else
	$holdingSlot = -1
endif
$done = 0

[CommandListSlotOtherButtons]
run = CommandListSlotItemImage

ps-t100 = NULL

if $cpx > z87 && $cpx < (z87 + x87 - 0.0035) && $cpy > w87 && $cpy < (w87 + y87 - 0.0035)
	$hovering = 1
	$hoveredSlot = $slot
	$selectedSlot = 0
endif

if $slot == 100
	if $page != 0
		ps-t100 = ResourceItemSlot.UPage
	else
		ps-t100 = ResourceItemSlot.Page
	endif
elif $slot == 101
	if $page != 1
		ps-t100 = ResourceItemSlot.UPage
	else
		ps-t100 = ResourceItemSlot.Page
	endif
endif 

run = CustomShaderElement

[CommandListResetMenuPos]
$mx = 50 / $ww
$my = 0.5 - 360 / $wh

[CustomShaderElementMenu]
vs = .\Shaders\MenuRender.hlsl
ps = .\Shaders\MenuRender.hlsl
run = BuiltInCommandListUnbindAllRenderTargets
blend = ADD SRC_ALPHA INV_SRC_ALPHA
cull = none
topology = triangle_strip
o0 = set_viewport bb
Draw = 4,0

[CustomShaderElement]
vs = .\Shaders\RenderUI.hlsl
ps = .\Shaders\RenderUI.hlsl
run = BuiltInCommandListUnbindAllRenderTargets
blend = ADD SRC_ALPHA INV_SRC_ALPHA
cull = none
topology = triangle_strip
o0 = set_viewport bb
Draw = 4,0

[ResourceMenuBack]
filename = .\UIResources\MenuBack.png

[ResourceMenuPlate]
filename = .\UIResources\MenuPlate.png

[ResourceMenuFrontShadow]
filename = .\UIResources\MenuFrontShadow.png

[ResourceItemSlot]
filename = .\UIResources\Slot.png

[ResourceItemSlotBack]
filename = .\UIResources\Slot_Back.png

[ResourceItemSlotHover.SlotHover]
filename = .\UIResources\Slot_Hover.png

[ResourceItemSlotHover.SlotClicked]
filename = .\UIResources\Slot_Hover_2.png

[ResourceItemSlot.Page]
filename = .\UIResources\UPage.png

[ResourceItemSlot.UPage]
filename = .\UIResources\Page.png

[ResourceMenuItem.Slider]
  filename = .\UIResources\Slider.png
  
[ResourceMenuItem.SliderBack]
  filename = .\UIResources\SliderBack.png

[ResourceMenuItem.SliderBreast]
  filename = .\UIResources\SliderBreast.png

[ResourceMenuItem.SliderBottom]
  filename = .\UIResources\SliderBottom.png

[ResourceMenuItem.SliderSlot]
  filename = .\UIResources\SliderSlot.png
[CommandListClickedSlot]
$clickedSlot = $hoveredSlot

if $clickedSlot == 100
$page = 0
elif $clickedSlot == 101
$page = 1
endif

if $clickedSlot == 1
  $swapvarHair = $swapvarHair + 1
  if $swapvarHair > 3
    $swapvarHair = 0
  endif
elif $clickedSlot == 2
  $swapvarAmil = $swapvarAmil + 1
  if $swapvarAmil > 3
    $swapvarAmil = 0
  endif
elif $clickedSlot == 3
  $swapvarJacket = $swapvarJacket + 1
  if $swapvarJacket > 1
    $swapvarJacket = 0
  endif
elif $clickedSlot == 4
  $swapvarBandage = $swapvarBandage + 1
  if $swapvarBandage > 1
    $swapvarBandage = 0
  endif
elif $clickedSlot == 5
  $swapvarTop = $swapvarTop + 1
  if $swapvarTop > 4
    $swapvarTop = 0
  endif
elif $clickedSlot == 6
  $swapvarShort = $swapvarShort + 1
  if $swapvarShort > 3
    $swapvarShort = 0
  endif
elif $clickedSlot == 7
  $swapvarSleeves = $swapvarSleeves + 1
  if $swapvarSleeves > 2
    $swapvarSleeves = 0
  endif
elif $clickedSlot == 8
  $swapvarLegs = $swapvarLegs + 1
  if $swapvarLegs > 3
    $swapvarLegs = 0
  endif
elif $clickedSlot == 9
  $swapvarHeels = $swapvarHeels + 1
  if $swapvarHeels > 2
    $swapvarHeels = 0
  endif
elif $clickedSlot == 10
  $swapvarColor = $swapvarColor + 1
  if $swapvarColor > 1
    $swapvarColor = 0
  endif
elif $clickedSlot == 11
  $swapvarFace = $swapvarFace + 1
  if $swapvarFace > 1
    $swapvarFace = 0
  endif
endif

[CommandListHoldingSlot]
$holdingSlot = $hoveredSlot

local $dragx = $cpx - $mx
local $drag_mapped = $dragx * 9.3 -0.23
if $holdingSlot == 50
  $swapvarSliderBreast = $drag_mapped
  if $swapvarSliderBreast < 0
	$swapvarSliderBreast = 0
  elif $swapvarSliderBreast > 1
	$swapvarSliderBreast = 1
  endif
endif
if $holdingSlot == 51
  $swapvarSliderBottom = $drag_mapped
  if $swapvarSliderBottom < 0
	$swapvarSliderBottom = 0
  elif $swapvarSliderBottom > 1
	$swapvarSliderBottom = 1
  endif
endif
[CommandListDrawToggles]
local $z0 = z87 + 20 / $ww
local $z1 = $z0 + 95 / $ww

local $wo = 75 / $wh

$hovering = 0
$slot = 0
x87 = 64 / $ww
y87 = 64 / $wh

local $zbase = $z1
local $wbase = w87

local $xof = 60

ps-t100 = NULL
run = CustomShaderElement

z87 = $zbase + 1.08*75 / $wh
w87 = $wbase + $xof/ $wh + 0.0*75 / $wh
$slot = 100
run = CommandListSlotOtherButtons

z87 = $zbase + 1.08*75 / $wh
w87 = $wbase + $xof/ $wh + 0.65*75 / $wh
$slot = 101
run = CommandListSlotOtherButtons

;Hair
z87 = $zbase + 0.0*75 / $wh
w87 = $wbase + $xof/ $wh + 0*75 / $wh
$slot = 1
run = CommandListSlot
;Amil
z87 = $zbase + 0.55*75 / $wh
w87 = $wbase + $xof/ $wh + 2*75 / $wh
$slot = 2
run = CommandListSlot
;Jacket
z87 = $zbase + 0.0*75 / $wh
w87 = $wbase + $xof/ $wh + 1*75 / $wh
$slot = 3
run = CommandListSlot
;Bandage
z87 = $zbase + 0.55*75 / $wh
w87 = $wbase + $xof/ $wh + 1*75 / $wh
$slot = 4
run = CommandListSlot
;Top
z87 = $zbase + 0.0*75 / $wh
w87 = $wbase + $xof/ $wh + 2*75 / $wh
$slot = 5
run = CommandListSlot
;Short
z87 = $zbase + 0.0*75 / $wh
w87 = $wbase + $xof/ $wh + 3*75 / $wh
$slot = 6
run = CommandListSlot
;Sleeves
z87 = $zbase + -0.55*75 / $wh
w87 = $wbase + $xof/ $wh + 1*75 / $wh
$slot = 7
run = CommandListSlot
;Legs
z87 = $zbase + -0.55*75 / $wh
w87 = $wbase + $xof/ $wh + 2*75 / $wh
$slot = 8
run = CommandListSlot
;Heels
z87 = $zbase + -0.55*75 / $wh
w87 = $wbase + $xof/ $wh + 3*75 / $wh
$slot = 9
run = CommandListSlot
;Color
z87 = $zbase + 0.0*75 / $wh
w87 = $wbase + $xof/ $wh + 6*75 / $wh
$slot = 10
run = CommandListSlot
;Face
z87 = $zbase + 0.0*75 / $wh
w87 = $wbase + $xof/ $wh + 7*75 / $wh
$slot = 11
run = CommandListSlot
;SliderBreast
z87 = $zbase + -0.5*75 / $wh
w87 = $wbase + $xof/ $wh + 8*75 / $wh
$slot = 50
run = CommandListSlotSlider
;SliderBottom
z87 = $zbase + -0.5*75 / $wh
w87 = $wbase + $xof/ $wh + 8.6*75 / $wh
$slot = 51
run = CommandListSlotSlider

[CommandListSlotItemImage]
x87 = 64 / $ww 
y87 = 64 / $wh
z87 = z87 + 6 / $ww
w87 = w87 + 10 / $ww
local $skip = 0
local $initialz = z87


if $slot == 1
  ps-t100 = ResourceMenuItem.Hair
elif $slot == 2
  ps-t100 = ResourceMenuItem.Amil
elif $slot == 3
  ps-t100 = ResourceMenuItem.Jacket
elif $slot == 4
  ps-t100 = ResourceMenuItem.Bandage
elif $slot == 5
  ps-t100 = ResourceMenuItem.Top
elif $slot == 6
  ps-t100 = ResourceMenuItem.Short
elif $slot == 7
  ps-t100 = ResourceMenuItem.Sleeves
elif $slot == 8
  ps-t100 = ResourceMenuItem.Legs
elif $slot == 9
  ps-t100 = ResourceMenuItem.Heels
elif $slot == 10
  ps-t100 = ResourceMenuItem.Color
elif $slot == 11
  ps-t100 = ResourceMenuItem.Face
endif
if $slot == 50
  ps-t100 = ResourceMenuItem.SliderBack
  x87 = 202 / $ww
  y87 = 32 / $wh
  run = CustomShaderElement

  ps-t100 = ResourceMenuItem.Slider
  x87 = 202 / $ww * $swapvarSliderBreast
  y87 = 32 / $wh
  run = CustomShaderElement

  x87 = 202 / $ww
  y87 = 32 / $wh
  ps-t100 = ResourceMenuItem.SliderSlot
  run = CustomShaderElement
  
  x87 = 202 / $ww
  y87 = 32 / $wh
  z87 = z87 + (($swapvarSliderBreast-0.5)*175) / $ww
  ps-t100 = ResourceMenuItem.SliderBreast
  run = CustomShaderElement
  z87 = $initialz
  $skip = 1
elif $slot == 51
  ps-t100 = ResourceMenuItem.SliderBack
  x87 = 202 / $ww
  y87 = 32 / $wh
  run = CustomShaderElement

  ps-t100 = ResourceMenuItem.Slider
  x87 = 202 / $ww * $swapvarSliderBottom
  y87 = 32 / $wh
  run = CustomShaderElement

  x87 = 202 / $ww
  y87 = 32 / $wh
  ps-t100 = ResourceMenuItem.SliderSlot
  run = CustomShaderElement

  x87 = 202 / $ww
  y87 = 32 / $wh
  z87 = z87 + (($swapvarSliderBottom-0.5)*175) / $ww
  ps-t100 = ResourceMenuItem.SliderBottom
  run = CustomShaderElement
  z87 = $initialz
  $skip = 1
endif
  

if $skip == 0
	run = CustomShaderElement
endif


[ResourceMenuItem.Hair]
  filename = .\UIResources\Hair.png
[ResourceMenuItem.Amil]
  filename = .\UIResources\Amil.png
[ResourceMenuItem.Jacket]
  filename = .\UIResources\Jacket.png
[ResourceMenuItem.Bandage]
  filename = .\UIResources\Bandage.png
[ResourceMenuItem.Top]
  filename = .\UIResources\Top.png
[ResourceMenuItem.Short]
  filename = .\UIResources\Short.png
[ResourceMenuItem.Sleeves]
  filename = .\UIResources\Sleeves.png
[ResourceMenuItem.Legs]
  filename = .\UIResources\Legs.png
[ResourceMenuItem.Heels]
  filename = .\UIResources\Heels.png
[ResourceMenuItem.Color]
  filename = .\UIResources\Color.png
[ResourceMenuItem.Face]
  filename = .\UIResources\Face.png
; MARK: SHAPEKEYS

[Constants]
global $part = 0
global $done = 0
global persist $sktop = 0
global persist $skbottom = 0

[KeySwapswapvarBiggerChest]
condition = $active == 1 && $swapvarSliderBreast != 1.0
key = no_alt no_ctrl 9
type = cycle
$swapvarSliderBreast = 0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0
$done = 0
[KeySwapswapvarSmallerChest]
condition = $active == 1 && $swapvarSliderBreast != 0.0
key = alt no_ctrl 9
type = cycle
$swapvarSliderBreast = 1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.0
$done = 0
[KeySwapswapvarBiggerBottom]
condition = $active == 1 && $swapvarSliderBottom != 1.0
key = no_alt no_ctrl 0
type = cycle
$swapvarSliderBottom = 0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0
$done = 0
[KeySwapswapvarSmallerBottom]
condition = $active == 1 && $swapvarSliderBottom != 0.0
key = alt no_ctrl 0
type = cycle
$swapvarSliderBottom = 1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.0
$done = 0

[Present]
if $active == 1
    if $done == 0
        run = CommandListComputeShapeKeys
        run = CommandListKeyBottom
        $done = 1
    endif 
endif 

[CommandListComputeShapeKeys]
ResourceNicoleBodyPosition = copy ResourceNicoleBodyPositionBase
run = CustomShaderKeys
cs-u5 = null
cs-t50 = null
cs-t51 = null
cs-t52 = null
cs-t53 = null
cs-t54 = null

[CommandListKeyBottom] 
   cs-t50 = copy ResourceNicoleBodyPositionBase
   cs-t51 = copy ResourceNicoleBodyPositionBiggerBottom
   cs-t52 = copy ResourceNicoleBodyPositionSmallerBottom
   cs-t53 = copy ResourceNicoleBodyPositionBiggerChest
   cs-t54 = copy ResourceNicoleBodyPositionSmallerChest

x88 = $swapvarSliderBottom
x89 = $swapvarSliderBreast
run = CustomShaderKeys

[CustomShaderKeys]
cs-u5 = copy ResourceNicoleBodyPositionBase 

cs = .\Shaders\ShapeKey.hlsl
dispatch = 59094, 1, 1

ResourceNicoleBodyPosition = copy ref cs-u5


[ResourceNicoleBodyPositionBase]
type = Buffer
stride = 40
filename = .\Meshes\NicoleBodyPosition.buf

[ResourceNicoleBodyPositionBiggerBottom]
type = Buffer
stride = 40
filename = .\Meshes\NicoleBodyPositionBiggerBottom.buf

[ResourceNicoleBodyPositionSmallerBottom]
type = Buffer
stride = 40
filename = .\Meshes\NicoleBodyPositionSmallerBottom.buf

[ResourceNicoleBodyPositionBiggerChest]
type = Buffer
stride = 40
filename = .\Meshes\NicoleBodyPositionBiggerChest.buf

[ResourceNicoleBodyPositionSmallerChest]
type = Buffer
stride = 40
filename = .\Meshes\NicoleBodyPositionSmallerChest.buf
[TextureOverrideFace]
hash = 6abd3dd3
$active = 1
if $swapvarFace == 0
this = ResourceFace
endif

[TextureOverrideNicole.HeadA.Diffuse.2048]
hash = d1e84a34
$active = 1
if $swapvarFace == 0
this = ResourceFace
endif

[TextureOverrideNicole.Head.IB]
hash = 7435fc0e
run = CommandListSkinTexture
match_priority = 0

[ResourceFace]
filename = .\Textures\Face.dds