; WWMI BETA-5 INI

; Mod State -------------------------

[KeySwapToggle0]
condition = $object_detected == 1
key = ALT 0
type = cycle
$swapvar_toggle_0 = -1, 0

[KeySwapToggle1]
condition = $object_detected == 1
key = ALT 1
type = cycle
$swapvar_toggle_1 = -1, 0

[KeySwapToggle2]
condition = $object_detected == 1
key = ALT 2
type = cycle
$swapvar_toggle_2 = -1, 0

[KeySwapToggle3]
condition = $object_detected == 1
key = ALT 3
type = cycle
$swapvar_toggle_3 = -1, 0

[KeySwapToggle4]
condition = $object_detected == 1
key = ALT 4
type = cycle
$swapvar_toggle_4 = -1, 0

[KeySwapToggle5]
condition = $object_detected == 1
key = ALT 5
type = cycle
$swapvar_toggle_5 = -1, 0

[KeySwapToggle6]
condition = $object_detected == 1
key = ALT 6
type = cycle
$swapvar_toggle_6 = -1, 0

[KeySwapToggle7]
condition = $object_detected == 1
key = ALT 7
type = cycle
$swapvar_toggle_7 = -1, 0

[KeySwapToggle8]
condition = $object_detected == 1
key = ALT 8
type = cycle
$swapvar_toggle_8 = -1, 0

[KeySwapToggle9]
condition = $object_detected == 1
key = ALT 9
type = cycle
$swapvar_toggle_9 = -1, 0

[KeySwapToggle10]
condition = $object_detected == 1
key = CTRL 0
type = cycle
$swapvar_toggle_10 = -1, 0

[KeySwapToggle11]
condition = $object_detected == 1
key = CTRL 1
type = cycle
$swapvar_toggle_11 = -1, 0

[KeySwapToggle12]
condition = $object_detected == 1
key = CTRL 2
type = cycle
$swapvar_toggle_12 = -1, 0

[KeySwapToggle13]
condition = $object_detected == 1
key = CTRL 3
type = cycle
$swapvar_toggle_13 = -1, 0

[KeySwapToggle14]
condition = $object_detected == 1
key = CTRL 4
type = cycle
$swapvar_toggle_14 = -1, 0

[KeySwapToggle15]
condition = $object_detected == 1
key = CTRL 5
type = cycle
$swapvar_toggle_15 = -1, 0

[KeySwapToggle16]
condition = $object_detected == 1
key = CTRL 6
type = cycle
$swapvar_toggle_16 = -1, 0

[KeySwapToggle17]
condition = $object_detected == 1
key = CTRL 7
type = cycle
$swapvar_toggle_17 = -1, 0

[KeySwapToggle18]
condition = $object_detected == 1
key = CTRL 8
type = cycle
$swapvar_toggle_18 = -1, 0

[KeySwapToggle19]
condition = $object_detected == 1
key = CTRL 9
type = cycle
$swapvar_toggle_19 = -1, 0

[KeySwapToggle20]
condition = $object_detected == 1
key = SHIFT 0
type = cycle
$swapvar_toggle_20 = -1, 0

[KeySwapToggle21]
condition = $object_detected == 1
key = SHIFT 1
type = cycle
$swapvar_toggle_21 = -1, 0

[KeySwapToggle22]
condition = $object_detected == 1
key = SHIFT 2
type = cycle
$swapvar_toggle_22 = -1, 0

[KeySwapToggle23]
condition = $object_detected == 1
key = SHIFT 3
type = cycle
$swapvar_toggle_23 = -1, 0

[KeySwapToggle24]
condition = $object_detected == 1
key = SHIFT 4
type = cycle
$swapvar_toggle_24 = -1, 0

[KeySwapToggle25]
condition = $object_detected == 1
key = SHIFT 5
type = cycle
$swapvar_toggle_25 = -1, 0

[KeySwapToggle26]
condition = $object_detected == 1
key = SHIFT 6
type = cycle
$swapvar_toggle_26 = -1, 0

[KeySwapToggle27]
condition = $object_detected == 1
key = SHIFT 7
type = cycle
$swapvar_toggle_27 = -1, 0

[KeySwapToggle28]
condition = $object_detected == 1
key = SHIFT 8
type = cycle
$swapvar_toggle_28 = -1, 0

[KeySwapToggle29]
condition = $object_detected == 1
key = SHIFT 9
type = cycle
$swapvar_toggle_29 = -1, 0

[KeySwapToggle30]
condition = $object_detected == 1
key = ALT CTRL 0
type = cycle
$swapvar_toggle_30 = -1, 0

[KeySwapToggle31]
condition = $object_detected == 1
key = ALT CTRL 1
type = cycle
$swapvar_toggle_31 = -1, 0

[KeySwapToggle32]
condition = $object_detected == 1
key = ALT CTRL 2
type = cycle
$swapvar_toggle_32 = -1, 0

[KeySwapToggle33]
condition = $object_detected == 1
key = ALT CTRL 3
type = cycle
$swapvar_toggle_33 = -1, 0

[KeySwapToggle34]
condition = $object_detected == 1
key = ALT CTRL 4
type = cycle
$swapvar_toggle_34 = -1, 0

[KeySwapToggle35]
condition = $object_detected == 1
key = ALT CTRL 5
type = cycle
$swapvar_toggle_35 = -1, 0

[KeySwapToggle36]
condition = $object_detected == 1
key = SHIFT ALT 7
type = cycle
$swapvar_toggle_36 = -1, 0

[KeySwapToggle37]
condition = $object_detected == 1
key = ALT CTRL 6
type = cycle
$swapvar_toggle_37 = -1, 0

[KeySwapToggle38]
condition = $object_detected == 1
key = ALT CTRL 7
type = cycle
$swapvar_toggle_38 = -1, 0

[KeySwapToggle39]
condition = $object_detected == 1
key = ALT CTRL 8
type = cycle
$swapvar_toggle_39 = -1, 0

[KeySwapToggle40]
condition = $object_detected == 1
key = ALT CTRL 9
type = cycle
$swapvar_toggle_40 = -1, 0

[KeySwapToggle41]
condition = $object_detected == 1
key = SHIFT ALT 0
type = cycle
$swapvar_toggle_41 = -1, 0

[KeySwapToggle42]
condition = $object_detected == 1
key = SHIFT ALT 1
type = cycle
$swapvar_toggle_42 = -1, 0

[KeySwapToggle43]
condition = $object_detected == 1
key = SHIFT ALT 2
type = cycle
$swapvar_toggle_43 = -1, 0

[KeySwapToggle44]
condition = $object_detected == 1
key = SHIFT ALT 3
type = cycle
$swapvar_toggle_44 = -1, 0

[KeySwapToggle45]
condition = $object_detected == 1
key = SHIFT ALT 4
type = cycle
$swapvar_toggle_45 = -1, 0

[KeySwapToggle46]
condition = $object_detected == 1
key = SHIFT ALT 5
type = cycle
$swapvar_toggle_46 = -1, 0

[KeySwapToggle47]
condition = $object_detected == 1
key = SHIFT ALT 6
type = cycle
$swapvar_toggle_47 = -1, 0

[Constants]
global $required_wwmi_version = 0.96
global $object_guid = 282999
global $mesh_vertex_count = 102551
global $shapekey_vertex_count = 159809
global $mod_id = -1000
global $state_id = 0
global $mod_enabled = 0
global $object_detected = 0
global $merge_status_id = 0
global $merge_status_id_0 = 0
global $merge_status_id_1 = 0
global $merge_status_id_2 = 0
global $merge_status_id_3 = 0
global $merge_status_id_4 = 0
global $merge_status_id_5 = 0
global $merge_status_id_6 = 0
global $merge_status_id_7 = 0
; Swap vars aka toggles defaults
global persist $swapvar_toggle_0 = 0
global persist $swapvar_toggle_1 = 0
global persist $swapvar_toggle_2 = 0
global persist $swapvar_toggle_3 = 0
global persist $swapvar_toggle_4 = 0
global persist $swapvar_toggle_5 = 0
global persist $swapvar_toggle_6 = 0
global persist $swapvar_toggle_7 = 0
global persist $swapvar_toggle_8 = 0
global persist $swapvar_toggle_9 = 0
global persist $swapvar_toggle_10 = 0
global persist $swapvar_toggle_11 = 0
global persist $swapvar_toggle_12 = 0
global persist $swapvar_toggle_13 = 0
global persist $swapvar_toggle_14 = 0
global persist $swapvar_toggle_15 = 0
global persist $swapvar_toggle_16 = 0
global persist $swapvar_toggle_17 = 0
global persist $swapvar_toggle_18 = 0
global persist $swapvar_toggle_19 = 0
global persist $swapvar_toggle_20 = 0
global persist $swapvar_toggle_21 = 0
global persist $swapvar_toggle_22 = 0
global persist $swapvar_toggle_23 = 0
global persist $swapvar_toggle_24 = 0
global persist $swapvar_toggle_25 = 0
global persist $swapvar_toggle_26 = 0
global persist $swapvar_toggle_27 = 0
global persist $swapvar_toggle_28 = 0
global persist $swapvar_toggle_29 = 0
global persist $swapvar_toggle_30 = 0
global persist $swapvar_toggle_31 = 0
global persist $swapvar_toggle_32 = 0
global persist $swapvar_toggle_33 = 0
global persist $swapvar_toggle_34 = 0
global persist $swapvar_toggle_35 = 0
global persist $swapvar_toggle_36 = 0
global persist $swapvar_toggle_37 = 0
global persist $swapvar_toggle_38 = 0
global persist $swapvar_toggle_39 = 0
global persist $swapvar_toggle_40 = 0
global persist $swapvar_toggle_41 = 0
global persist $swapvar_toggle_42 = 0
global persist $swapvar_toggle_43 = 0
global persist $swapvar_toggle_44 = 0
global persist $swapvar_toggle_45 = 0
global persist $swapvar_toggle_46 = 0
global persist $swapvar_toggle_47 = 0
; Per-object state vars
global $draw_component_0_bang = 1
global $draw_component_1_hair = 1
global $draw_component_2_face = 1
global $draw_component_3_arm_sleeve_left = 1
global $draw_component_3_arm_sleeve_right = 1
global $draw_component_3_arm_sleeve_ring_left_1 = 1
global $draw_component_3_arm_sleeve_ring_left_2 = 1
global $draw_component_3_arm_sleeve_ring_right_1 = 1
global $draw_component_3_arm_sleeve_ring_right_2 = 1
global $draw_component_3_body = 1
global $draw_component_3_body_baffle_before_1 = 1
global $draw_component_3_body_baffle_before_2 = 1
global $draw_component_3_body_baffle_side = 1
global $draw_component_3_body_cloth = 1
global $draw_component_3_body_cloth_border = 1
global $draw_component_3_bra = 1
global $draw_component_3_bra_fragment = 1
global $draw_component_3_chest_board_1 = 1
global $draw_component_3_chest_board_2 = 1
global $draw_component_3_chest_bow = 1
global $draw_component_3_chest_gem = 1
global $draw_component_3_hair_clip_1 = 1
global $draw_component_3_hand_ring = 1
global $draw_component_3_metal_button = 1
global $draw_component_3_mole = 1
global $draw_component_3_neck_armor_1 = 1
global $draw_component_3_neck_armor_2 = 1
global $draw_component_3_neck_armor_before = 1
global $draw_component_3_neck_bow_before = 1
global $draw_component_3_panty = 1
global $draw_component_3_waist_skirt_1 = 1
global $draw_component_3_waist_skirt_2 = 1
global $draw_component_3_waist_skirt_3 = 1
global $draw_component_3_waist_skirt_4 = 1
global $draw_component_4_float_tie = 1
global $draw_component_4_leg_ring_left = 1
global $draw_component_4_leg_ring_right = 1
global $draw_component_4_neck_armor_after = 1
global $draw_component_4_neck_armor_before = 1
global $draw_component_4_neck_bow_after = 1
global $draw_component_4_shoe_left = 1
global $draw_component_4_sock_right = 1
global $draw_component_4_waist_after_armor_1 = 1
global $draw_component_4_waist_after_armor_2 = 1
global $draw_component_4_waist_after_armor_3 = 1
global $draw_component_4_waist_after_bow_2 = 1
global $draw_component_5_hand_ring = 1
global $draw_component_5_head_ring = 1
global $draw_component_5_head_ring_clip = 1
global $draw_component_5_shoulder_ring_left = 1
global $draw_component_5_shoulder_ring_right = 1
global $draw_component_5_star = 1
global $draw_component_6_float_cloth_right = 1
global $draw_component_6_skirt = 1
global $draw_component_7_eye = 1

global persist $chest = 0
global persist $panty = 0
global persist $leg_left = 0
global persist $leg_right = 0
global persist $foot_left = 0
global persist $foot_right = 0
global persist $arm_left = 0
global persist $arm_right = 0
global persist $chest_side = 0

[Present]
if $object_detected
    if $mod_enabled
        post $object_detected = 0
        run = CommandListInitializeBlendRemaps
        run = CommandListProcessToggles
        run = CommandListUpdateMergedSkeleton
        run = CommandListSetChest
        run = CommandListSetPanty
        run = CommandListSetLegLeft
        run = CommandListSetLegRight
        run = CommandListSetFootLeft
        run = CommandListSetFootRight
        run = CommandListSetArmLeft
        run = CommandListSetArmRight
        run = CommandListSetChestSide
    else
        if $mod_id == -1000
            run = CommandListRegisterMod
        endif
    endif
endif

[CommandListRegisterMod]
$\WWMIv1\required_wwmi_version = $required_wwmi_version
$\WWMIv1\object_guid = $object_guid
Resource\WWMIv1\ModName = ref ResourceModName
Resource\WWMIv1\ModAuthor = ref ResourceModAuthor
Resource\WWMIv1\ModDesc = ref ResourceModDesc
Resource\WWMIv1\ModLink = ref ResourceModLink
Resource\WWMIv1\ModLogo = ref ResourceModLogo
run = CommandList\WWMIv1\RegisterMod
$mod_id = $\WWMIv1\mod_id
if $mod_id >= 0
    $mod_enabled = 1
endif

[CommandListProcessToggles]
; Set display of each object according to toggles logic
$draw_component_3_hair_clip_1 = ($swapvar_toggle_0 == 0)
$draw_component_5_head_ring_clip = ($swapvar_toggle_1 == 0)
$draw_component_5_head_ring = ($swapvar_toggle_2 == 0)
$draw_component_3_neck_armor_before = ($swapvar_toggle_3 == 0)
$draw_component_4_neck_armor_before = ($swapvar_toggle_3 == 0)
$draw_component_3_neck_bow_before = ($swapvar_toggle_4 == 0)
$draw_component_4_neck_armor_after = ($swapvar_toggle_5 == 0)
$draw_component_4_neck_bow_after = ($swapvar_toggle_6 == 0)
$draw_component_3_neck_armor_2 = ($swapvar_toggle_7 == 0)
$draw_component_3_neck_armor_1 = ($swapvar_toggle_8 == 0)
$draw_component_5_star = ($swapvar_toggle_9 == 0)
$draw_component_3_arm_sleeve_ring_left_1 = ($swapvar_toggle_10 == 0)
$draw_component_3_arm_sleeve_ring_right_1 = ($swapvar_toggle_11 == 0)
$draw_component_5_shoulder_ring_left = ($swapvar_toggle_12 == 0)
$draw_component_5_shoulder_ring_right = ($swapvar_toggle_13 == 0)
$draw_component_3_arm_sleeve_ring_left_2 = ($swapvar_toggle_14 == 0)
$draw_component_3_arm_sleeve_ring_right_2 = ($swapvar_toggle_15 == 0)
$draw_component_6_float_cloth_right = ($swapvar_toggle_16 == 0)
$draw_component_3_arm_sleeve_left = ($swapvar_toggle_17 == 0)
$draw_component_3_arm_sleeve_right = ($swapvar_toggle_18 == 0)
$draw_component_3_hand_ring = ($swapvar_toggle_19 == 0)
$draw_component_5_hand_ring = ($swapvar_toggle_20 == 0)
$draw_component_3_chest_gem = ($swapvar_toggle_21 == 0)
$draw_component_3_chest_bow = ($swapvar_toggle_22 == 0)
$draw_component_4_waist_after_armor_2 = ($swapvar_toggle_23 == 0)
$draw_component_4_waist_after_armor_1 = ($swapvar_toggle_24 == 0)
$draw_component_4_float_tie = ($swapvar_toggle_25 == 0)
$draw_component_4_waist_after_bow_2 = ($swapvar_toggle_26 == 0)
$draw_component_4_waist_after_armor_3 = ($swapvar_toggle_27 == 0)
$draw_component_3_chest_board_2 = ($swapvar_toggle_28 == 0)
$draw_component_3_body_baffle_before_2 = ($swapvar_toggle_29 == 0)
$draw_component_3_body_baffle_before_1 = ($swapvar_toggle_30 == 0)
$draw_component_3_waist_skirt_1 = ($swapvar_toggle_31 == 0)
$draw_component_3_body_baffle_side = ($swapvar_toggle_32 == 0)
$draw_component_3_waist_skirt_4 = ($swapvar_toggle_33 == 0)
$draw_component_3_waist_skirt_3 = ($swapvar_toggle_33 == 0)
$draw_component_3_waist_skirt_2 = ($swapvar_toggle_34 == 0)
$draw_component_3_body_cloth = ($swapvar_toggle_35 == 0)
$draw_component_3_metal_button = ($swapvar_toggle_35 == 0)
$draw_component_3_body_cloth_border = ($swapvar_toggle_36 == 0)
$draw_component_3_chest_board_1 = ($swapvar_toggle_36 == 0)
$draw_component_6_skirt = ($swapvar_toggle_37 == 0)
$draw_component_3_bra = ($swapvar_toggle_38 == 0)
$draw_component_3_bra_fragment = ($swapvar_toggle_39 == 0)
$draw_component_4_leg_ring_left = ($swapvar_toggle_40 == 0)
$draw_component_4_sock_right = ($swapvar_toggle_41 == 0)
$draw_component_4_leg_ring_right = ($swapvar_toggle_42 == 0)
$draw_component_4_shoe_left = ($swapvar_toggle_43 == 0)
$draw_component_3_mole = ($swapvar_toggle_44 == 0)
$draw_component_3_panty = ($swapvar_toggle_45 == 0)

[CommandListUpdateMergedSkeleton]
$merge_status_id_0 = 0
$merge_status_id_1 = 0
$merge_status_id_2 = 0
$merge_status_id_3 = 0
$merge_status_id_4 = 0
$merge_status_id_5 = 0
$merge_status_id_6 = 0
$merge_status_id_7 = 0
ResourceMergedSkeleton = copy ResourceMergedSkeletonRW
ResourceExtraMergedSkeleton = copy ResourceExtraMergedSkeletonRW
run = CommandListRemapMergedSkeleton

[ResourceMergedSkeletonRemap]
[ResourceExtraMergedSkeletonRemap]

[ResourceBlendBufferOverride]
[ResourceExtraMergedSkeletonOverride]
[ResourceMergedSkeletonOverride]

[ResourceRemappedBlendBufferRW]
[ResourceRemappedSkeletonRW]
[ResourceExtraRemappedSkeletonRW]

[ResourceRemappedBlendBufferComponent3]
[ResourceRemappedSkeletonComponent3]
[ResourceExtraRemappedSkeletonComponent3]

[ResourceRemappedBlendBufferComponent4]
[ResourceRemappedSkeletonComponent4]
[ResourceExtraRemappedSkeletonComponent4]

[ResourceRemappedBlendBufferComponent5]
[ResourceRemappedSkeletonComponent5]
[ResourceExtraRemappedSkeletonComponent5]

[ResourceRemappedBlendBufferComponent6]
[ResourceRemappedSkeletonComponent6]
[ResourceExtraRemappedSkeletonComponent6]

[CommandListInitializeBlendRemaps]
local $blend_remaps_initialized
if !$blend_remaps_initialized
    ResourceRemappedSkeletonRW = copy ResourceMergedSkeletonRW
    ResourceExtraRemappedSkeletonRW = copy ResourceExtraMergedSkeletonRW

    $\WWMIv1\custom_vertex_count = $mesh_vertex_count
    $\WWMIv1\weights_per_vertex_count = 8
    cs-t34 = ref ResourceBlendRemapReverseBuffer
    cs-t35 = ref ResourceBlendRemapVertexVGBuffer

    $\WWMIv1\blend_remap_id = 0
    ResourceRemappedBlendBufferRW = copy ResourceBlendBufferNoStride
    cs-u4 = ref ResourceRemappedBlendBufferRW
    run = CustomShader\WWMIv1\BlendRemapper
    ResourceRemappedBlendBufferComponent3 = copy ResourceRemappedBlendBufferRW
    ResourceRemappedBlendBufferComponent3 = copy_desc ResourceBlendBuffer

    $\WWMIv1\blend_remap_id = 1
    ResourceRemappedBlendBufferRW = copy ResourceBlendBufferNoStride
    cs-u4 = ref ResourceRemappedBlendBufferRW
    run = CustomShader\WWMIv1\BlendRemapper
    ResourceRemappedBlendBufferComponent4 = copy ResourceRemappedBlendBufferRW
    ResourceRemappedBlendBufferComponent4 = copy_desc ResourceBlendBuffer

    $\WWMIv1\blend_remap_id = 2
    ResourceRemappedBlendBufferRW = copy ResourceBlendBufferNoStride
    cs-u4 = ref ResourceRemappedBlendBufferRW
    run = CustomShader\WWMIv1\BlendRemapper
    ResourceRemappedBlendBufferComponent5 = copy ResourceRemappedBlendBufferRW
    ResourceRemappedBlendBufferComponent5 = copy_desc ResourceBlendBuffer

    $\WWMIv1\blend_remap_id = 3
    ResourceRemappedBlendBufferRW = copy ResourceBlendBufferNoStride
    cs-u4 = ref ResourceRemappedBlendBufferRW
    run = CustomShader\WWMIv1\BlendRemapper
    ResourceRemappedBlendBufferComponent6 = copy ResourceRemappedBlendBufferRW
    ResourceRemappedBlendBufferComponent6 = copy_desc ResourceBlendBuffer

    $blend_remaps_initialized = 1
endif

[CommandListRemapMergedSkeleton]
ResourceMergedSkeletonRemap = copy ResourceMergedSkeletonRW
ResourceExtraMergedSkeletonRemap = copy ResourceExtraMergedSkeletonRW

cs-t37 = ResourceBlendRemapForwardBuffer

$\WWMIv1\blend_remap_id = 0
$\WWMIv1\vg_count = 144
cs-t38 = ResourceMergedSkeletonRemap
cs-u5 = ResourceRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceRemappedSkeletonComponent3 = copy ResourceRemappedSkeletonRW
cs-t38 = ResourceExtraMergedSkeletonRemap
cs-u5 = ResourceExtraRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceExtraRemappedSkeletonComponent3 = copy ResourceExtraRemappedSkeletonRW

$\WWMIv1\blend_remap_id = 1
$\WWMIv1\vg_count = 80
cs-t38 = ResourceMergedSkeletonRemap
cs-u5 = ResourceRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceRemappedSkeletonComponent4 = copy ResourceRemappedSkeletonRW
cs-t38 = ResourceExtraMergedSkeletonRemap
cs-u5 = ResourceExtraRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceExtraRemappedSkeletonComponent4 = copy ResourceExtraRemappedSkeletonRW

$\WWMIv1\blend_remap_id = 2
$\WWMIv1\vg_count = 15
cs-t38 = ResourceMergedSkeletonRemap
cs-u5 = ResourceRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceRemappedSkeletonComponent5 = copy ResourceRemappedSkeletonRW
cs-t38 = ResourceExtraMergedSkeletonRemap
cs-u5 = ResourceExtraRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceExtraRemappedSkeletonComponent5 = copy ResourceExtraRemappedSkeletonRW

$\WWMIv1\blend_remap_id = 3
$\WWMIv1\vg_count = 48
cs-t38 = ResourceMergedSkeletonRemap
cs-u5 = ResourceRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceRemappedSkeletonComponent6 = copy ResourceRemappedSkeletonRW
cs-t38 = ResourceExtraMergedSkeletonRemap
cs-u5 = ResourceExtraRemappedSkeletonRW
run = CustomShader\WWMIv1\SkeletonRemapper
ResourceExtraRemappedSkeletonComponent6 = copy ResourceExtraRemappedSkeletonRW

; Resources: Mod Info -------------------------

[ResourceModName]
type = Buffer
data = "那个啥爱弥斯单词咋拼写来着 - Origin Toggle"

[ResourceModAuthor]
type = Buffer
data = "SpacePig"

[ResourceModDesc]
; type = Buffer
; data = "Empty Mod Description"

[ResourceModLink]
; type = Buffer
; data = "Empty Mod Link"

[ResourceModLogo]
; filename = Textures/Logo.dds

; Shading: Draw Call Stacks Processing -------------------------

[TextureOverrideMarkBoneDataCB]
hash = f02baf77
match_priority = 0
filter_index = 3381.7777

[CommandListMergeSkeleton]
if $merge_status_id == 0
	if vs-cb4 == 3381.7777
		cs-cb8 = ref vs-cb4
		cs-u6 = ResourceMergedSkeletonRW
		$\WWMIv1\custom_mesh_scale = 1.00
		run = CustomShader\WWMIv1\SkeletonMerger
		$merge_status_id = 1
	endif
endif
if $merge_status_id == 1
	if vs-cb4 == 3381.7777 && vs-cb3 == 3381.7777
		cs-cb8 = ref vs-cb3
		cs-u6 = ResourceExtraMergedSkeletonRW
		$\WWMIv1\custom_mesh_scale = 1.00
		run = CustomShader\WWMIv1\SkeletonMerger
		$merge_status_id = 2
	endif
endif

[CommandListTriggerResourceOverrides]
CheckTextureOverride = ps-t0
CheckTextureOverride = ps-t1
CheckTextureOverride = ps-t2
CheckTextureOverride = ps-t3
CheckTextureOverride = ps-t4
CheckTextureOverride = ps-t5
CheckTextureOverride = ps-t6
CheckTextureOverride = ps-t7
CheckTextureOverride = ps-t8
CheckTextureOverride = vs-cb3
CheckTextureOverride = vs-cb4

[CommandListOverrideSharedResources]
ResourceBypassVB0 = ref vb0
ib = ResourceIndexBuffer
vb0 = ResourceShapeKeyedPosition
vb1 = ResourceVectorBuffer
vb2 = ResourceTexcoordBuffer
vb3 = ResourceColorBuffer
if ResourceBlendBufferOverride === null
    vb4 = ResourceBlendBuffer
    if vs-cb4 == 3381.7777
        vs-cb4 = ref ResourceMergedSkeleton
		if vs-cb3 == 3381.7777
			vs-cb3 = ref ResourceExtraMergedSkeleton
		endif
	elif vs-cb3 == 3381.7777
		vs-cb3 = ref ResourceMergedSkeleton
    endif
else
    vb4 = ref ResourceBlendBufferOverride
    if vs-cb4 == 3381.7777
        vs-cb4 = ref ResourceMergedSkeletonOverride
		if vs-cb3 == 3381.7777
			vs-cb3 = ref ResourceExtraMergedSkeletonOverride
		endif
	elif vs-cb3 == 3381.7777
		vs-cb3 = ref ResourceMergedSkeletonOverride
    endif
endif
vb6 = null

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0
if ResourceBlendBufferOverride !== null
    ResourceBlendBufferOverride = null
    ResourceMergedSkeletonOverride = null
    ResourceExtraMergedSkeletonOverride = null
endif

[TextureOverrideComponent0]
hash = 2738a0f0
match_first_index = 0
match_index_count = 25920
$object_detected = 1
if $mod_enabled
    if $merge_status_id_0 != 2
        $\WWMIv1\vg_offset = 0
        $\WWMIv1\vg_count = 64
		$merge_status_id = $merge_status_id_0
		run = CommandListMergeSkeleton
		$merge_status_id_0 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 0.bang
        if $draw_component_0_bang
			drawindexed = 25920, 0, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

[TextureOverrideComponent1]
hash = 2738a0f0
match_first_index = 25920
match_index_count = 36696
$object_detected = 1
if $mod_enabled
    if $merge_status_id_1 != 2
        $\WWMIv1\vg_offset = 64
        $\WWMIv1\vg_count = 51
		$merge_status_id = $merge_status_id_1
		run = CommandListMergeSkeleton
		$merge_status_id_1 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 1.hair
        if $draw_component_1_hair
			drawindexed = 36696, 25920, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

[TextureOverrideComponent2]
hash = 2738a0f0
match_first_index = 62616
match_index_count = 12480
$object_detected = 1
if $mod_enabled
    if $merge_status_id_2 != 2
        $\WWMIv1\vg_offset = 115
        $\WWMIv1\vg_count = 21
		$merge_status_id = $merge_status_id_2
		run = CommandListMergeSkeleton
		$merge_status_id_2 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 2.face
        if $draw_component_2_face
			drawindexed = 12480, 62616, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

[TextureOverrideComponent3]
hash = 2738a0f0
match_first_index = 75096
match_index_count = 95856
$object_detected = 1
if $mod_enabled
    if $merge_status_id_3 != 2
        $\WWMIv1\vg_offset = 136
        $\WWMIv1\vg_count = 127
		$merge_status_id = $merge_status_id_3
		run = CommandListMergeSkeleton
		$merge_status_id_3 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        ResourceBlendBufferOverride = ref ResourceRemappedBlendBufferComponent3
        ResourceMergedSkeletonOverride = ref ResourceRemappedSkeletonComponent3
        ResourceExtraMergedSkeletonOverride = ref ResourceExtraRemappedSkeletonComponent3
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; ps-t2 = ResourceTexture_other
        ps-t6 = ResourceTexture_shine
        ; Draw Component 3.body
        if $draw_component_3_body
			drawindexed = 139539, 110580, 0
        endif
        ; Draw Component 3.arm.sleeve.left
        if $draw_component_3_arm_sleeve_left
			drawindexed = 12609, 75096, 0
        endif
        ; Draw Component 3.arm.sleeve.right
        if $draw_component_3_arm_sleeve_right
			drawindexed = 12894, 87705, 0
        endif
        ; Draw Component 3.arm.sleeve.ring.left.1
        if $draw_component_3_arm_sleeve_ring_left_1
			drawindexed = 3123, 100599, 0
        endif
        ; Draw Component 3.arm.sleeve.ring.left.2
        if $draw_component_3_arm_sleeve_ring_left_2
			drawindexed = 2313, 103722, 0
        endif
        ; Draw Component 3.arm.sleeve.ring.right.1
        if $draw_component_3_arm_sleeve_ring_right_1
			drawindexed = 3123, 106035, 0
        endif
        ; Draw Component 3.arm.sleeve.ring.right.2
        if $draw_component_3_arm_sleeve_ring_right_2
			drawindexed = 1422, 109158, 0
        endif
        ; Draw Component 3.body.baffle.before.1
        if $draw_component_3_body_baffle_before_1
            drawindexed = 1428, 250119, 0
        endif
        ; Draw Component 3.body.baffle.before.2
        if $draw_component_3_body_baffle_before_2
			drawindexed = 462, 251547, 0
        endif
        ; Draw Component 3.body.baffle.side
        if $draw_component_3_body_baffle_side
            drawindexed = 2154, 252009, 0
        endif
        ; Draw Component 3.body.cloth
        if $draw_component_3_body_cloth
            drawindexed = 3006, 254163, 0
        endif
        ; Draw Component 3.body.cloth.border
        if $draw_component_3_body_cloth_border
			drawindexed = 3522, 257169, 0
        endif
        ; Draw Component 3.bra.fragment
        if $draw_component_3_bra_fragment
			drawindexed = 3438, 265329, 0
        endif
        ; Draw Component 3.chest.board.1
        if $draw_component_3_chest_board_1
			drawindexed = 174, 268767, 0
        endif
        ; Draw Component 3.chest.board.2
        if $draw_component_3_chest_board_2
			drawindexed = 108, 268941, 0
        endif
        ; Draw Component 3.chest.bow
        if $draw_component_3_chest_bow
			drawindexed = 5160, 269049, 0
        endif
        ; Draw Component 3.chest.gem
        if $draw_component_3_chest_gem
			drawindexed = 1044, 274209, 0
        endif
        ; Draw Component 3.hair.clip.1
        if $draw_component_3_hair_clip_1
			drawindexed = 912, 275253, 0
        endif
        ; Draw Component 3.hand.ring
        if $draw_component_3_hand_ring
			drawindexed = 2808, 276165, 0
        endif
        ; Draw Component 3.metal.button
        if $draw_component_3_metal_button
			drawindexed = 1944, 278973, 0
        endif
        ; Draw Component 3.mole
        if $draw_component_3_mole
			drawindexed = 48, 280917, 0
        endif
        ; Draw Component 3.neck.armor.1
        if $draw_component_3_neck_armor_1
			drawindexed = 1686, 280965, 0
        endif
        ; Draw Component 3.neck.armor.2
        if $draw_component_3_neck_armor_2
			drawindexed = 1422, 282651, 0
        endif
        ; Draw Component 3.neck.armor.before
        if $draw_component_3_neck_armor_before
			drawindexed = 1386, 284073, 0
        endif
        ; Draw Component 3.neck.bow.before
        if $draw_component_3_neck_bow_before
			drawindexed = 1566, 285459, 0
        endif
        ; Draw Component 3.panty
        if $draw_component_3_panty
            drawindexed = 1908, 287025, 0
        endif
        ; Draw Component 3.waist.skirt.1
        if $draw_component_3_waist_skirt_1
			drawindexed = 5574, 288933, 0
        endif
        ; Draw Component 3.waist.skirt.2
        if $draw_component_3_waist_skirt_2
			drawindexed = 2076, 294507, 0
        endif
        ; Draw Component 3.waist.skirt.3
        if $draw_component_3_waist_skirt_3
			drawindexed = 4464, 296583, 0
        endif
        ; Draw Component 3.waist.skirt.4
        if $draw_component_3_waist_skirt_4
			drawindexed = 2244, 301047, 0
        endif
        ; Draw Component 3.bra
        if $draw_component_3_bra
            drawindexed = 4638, 260691, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

[TextureOverrideComponent4]
hash = 2738a0f0
match_first_index = 170952
match_index_count = 68616
$object_detected = 1
if $mod_enabled
    if $merge_status_id_4 != 2
        $\WWMIv1\vg_offset = 263
        $\WWMIv1\vg_count = 85
		$merge_status_id = $merge_status_id_4
		run = CommandListMergeSkeleton
		$merge_status_id_4 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        ResourceBlendBufferOverride = ref ResourceRemappedBlendBufferComponent4
        ResourceMergedSkeletonOverride = ref ResourceRemappedSkeletonComponent4
        ResourceExtraMergedSkeletonOverride = ref ResourceExtraRemappedSkeletonComponent4
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 4.float.tie
        if $draw_component_4_float_tie
			drawindexed = 6000, 303291, 0
        endif
        ; Draw Component 4.leg.ring.left
        if $draw_component_4_leg_ring_left
			drawindexed = 1887, 309291, 0
        endif
        ; Draw Component 4.leg.ring.right
        if $draw_component_4_leg_ring_right
			drawindexed = 810, 311178, 0
        endif
        ; Draw Component 4.neck.armor.after
        if $draw_component_4_neck_armor_after
			drawindexed = 666, 311988, 0
        endif
        ; Draw Component 4.neck.armor.before
        if $draw_component_4_neck_armor_before
			drawindexed = 816, 312654, 0
        endif
        ; Draw Component 4.neck.bow.after
        if $draw_component_4_neck_bow_after
			drawindexed = 372, 313470, 0
        endif
        ; Draw Component 4.shoe.left
        if $draw_component_4_shoe_left
			drawindexed = 3678, 313842, 0
        endif
        ; Draw Component 4.sock.right
        if $draw_component_4_sock_right
			drawindexed = 8466, 317520, 0
        endif
        ; Draw Component 4.waist.after.armor.1
        if $draw_component_4_waist_after_armor_1
			drawindexed = 4074, 325986, 0
        endif
        ; Draw Component 4.waist.after.armor.2
        if $draw_component_4_waist_after_armor_2
			drawindexed = 5118, 330060, 0
        endif
        ; Draw Component 4.waist.after.armor.3
        if $draw_component_4_waist_after_armor_3
			drawindexed = 4092, 335178, 0
        endif
        ; Draw Component 4.waist.after.bow.2
        if $draw_component_4_waist_after_bow_2
			drawindexed = 15480, 339270, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

[TextureOverrideComponent5]
hash = 2738a0f0
match_first_index = 239568
match_index_count = 7365
$object_detected = 1
if $mod_enabled
    if $merge_status_id_5 != 2
        $\WWMIv1\vg_offset = 348
        $\WWMIv1\vg_count = 15
		$merge_status_id = $merge_status_id_5
		run = CommandListMergeSkeleton
		$merge_status_id_5 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        ResourceBlendBufferOverride = ref ResourceRemappedBlendBufferComponent5
        ResourceMergedSkeletonOverride = ref ResourceRemappedSkeletonComponent5
        ResourceExtraMergedSkeletonOverride = ref ResourceExtraRemappedSkeletonComponent5
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 5.hand.ring
        if $draw_component_5_hand_ring
			drawindexed = 96, 354750, 0
        endif
        ; Draw Component 5.head.ring
        if $draw_component_5_head_ring
			drawindexed = 3165, 354846, 0
        endif
        ; Draw Component 5.head.ring.clip
        if $draw_component_5_head_ring_clip
			drawindexed = 3261, 358011, 0
        endif
        ; Draw Component 5.shoulder.ring.left
        if $draw_component_5_shoulder_ring_left
			drawindexed = 144, 361272, 0
        endif
        ; Draw Component 5.shoulder.ring.right
        if $draw_component_5_shoulder_ring_right
			drawindexed = 144, 361416, 0
        endif
        ; Draw Component 5.star
        if $draw_component_5_star
			drawindexed = 459, 361560, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

[TextureOverrideComponent6]
hash = 2738a0f0
match_first_index = 246933
match_index_count = 34590
$object_detected = 1
if $mod_enabled
    if $merge_status_id_6 != 2
        $\WWMIv1\vg_offset = 363
        $\WWMIv1\vg_count = 48
		$merge_status_id = $merge_status_id_6
		run = CommandListMergeSkeleton
		$merge_status_id_6 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        ResourceBlendBufferOverride = ref ResourceRemappedBlendBufferComponent6
        ResourceMergedSkeletonOverride = ref ResourceRemappedSkeletonComponent6
        ResourceExtraMergedSkeletonOverride = ref ResourceExtraRemappedSkeletonComponent6
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 6.float.cloth.right
        if $draw_component_6_float_cloth_right
			drawindexed = 11298, 362019, 0
        endif
        ; Draw Component 6.skirt
        if $draw_component_6_skirt
			drawindexed = 23292, 373317, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

[TextureOverrideComponent7]
hash = 2738a0f0
match_first_index = 281523
match_index_count = 1476
$object_detected = 1
if $mod_enabled
    if $merge_status_id_7 != 2
        $\WWMIv1\vg_offset = 411
        $\WWMIv1\vg_count = 1
		$merge_status_id = $merge_status_id_7
		run = CommandListMergeSkeleton
		$merge_status_id_7 = $merge_status_id
	endif
    if ResourceMergedSkeleton !== null
        handling = skip
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 7.eye
        if $draw_component_7_eye
			drawindexed = 1476, 396609, 0
        endif
        run = CommandListCleanupSharedResources
    endif
endif

; Shading: Textures -------------------------

[ResourceTexture_main]
filename = Textures/main.dds
[ResourceTexture_normal]
filename = Textures/normal.dds
[ResourceTexture_transparent]
filename = Textures/transparent.dds
[ResourceTexture_other]
filename = Textures/other.dds

[ResourceTexture_shine]
filename = Textures/shine.dds

[TextureOverride_main_1]
hash = f58624fb
match_priority = 0
if $object_detected
    this = ResourceTexture_main
endif
[TextureOverride_main_2]
hash = f857b2b4
match_priority = 0
if $object_detected
    this = ResourceTexture_main
endif

[TextureOverride_normal]
hash = fda934b4
match_priority = 0
if $object_detected
    this = ResourceTexture_normal
endif
[TextureOverride_transparent]
hash = 79081b2b
match_priority = 0
if $object_detected
    this = ResourceTexture_transparent
endif
[TextureOverride_other]
hash = 1944212c
match_priority = 0
if $object_detected
    this = ResourceTexture_other
endif

; Skinning: Shape Keys Override -------------------------

[CommandListSetChest]
$\WWMIv1\shapekey_id = 111
$\WWMIv1\shapekey_value = $chest
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetPanty]
$\WWMIv1\shapekey_id = 112
$\WWMIv1\shapekey_value = $panty
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetLegLeft]
$\WWMIv1\shapekey_id = 113
$\WWMIv1\shapekey_value = $leg_left
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetLegRight]
$\WWMIv1\shapekey_id = 114
$\WWMIv1\shapekey_value = $leg_right
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetFootLeft]
$\WWMIv1\shapekey_id = 115
$\WWMIv1\shapekey_value = $foot_left
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetFootRight]
$\WWMIv1\shapekey_id = 116
$\WWMIv1\shapekey_value = $foot_right
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetArmLeft]
$\WWMIv1\shapekey_id = 117
$\WWMIv1\shapekey_value = $arm_left
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetArmRight]
$\WWMIv1\shapekey_id = 118
$\WWMIv1\shapekey_value = $arm_right
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey
[CommandListSetChestSide]
$\WWMIv1\shapekey_id = 119
$\WWMIv1\shapekey_value = $chest_side
cs-u5 = ResourceCustomShapeKeyValuesRW
run = CommandList\WWMIv1\SetShapeKey

[TextureOverrideShapeKeyOffsets]
hash = 15eeff11
match_priority = 0
override_byte_stride = 24
override_vertex_count = $mesh_vertex_count

[TextureOverrideShapeKeyScale]
hash = 61ccff68
match_priority = 0
override_byte_stride = 4
override_vertex_count = $mesh_vertex_count

[CommandListSetupShapeKeys]
$\WWMIv1\shapekey_checksum = 1840
cs-t33 = ResourceShapeKeyOffsetBuffer
cs-u5 = ResourceCustomShapeKeyValuesRW
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyOverrider

[CommandListLoadShapeKeys]
$\WWMIv1\shapekey_vertex_count = $shapekey_vertex_count
cs-t0 = ResourceShapeKeyVertexIdBuffer
cs-t1 = ResourceShapeKeyVertexOffsetBuffer
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyLoader

[TextureOverrideShapeKeyLoaderCallback]
hash = 15eeff11
match_priority = 0
if $mod_enabled
    if cs == 3381.3333 && ResourceMergedSkeleton !== null
        handling = skip
        run = CommandListSetupShapeKeys
        run = CommandListLoadShapeKeys
    endif
endif

[CommandListMultiplyShapeKeys]
$\WWMIv1\custom_vertex_count = $mesh_vertex_count
run = CustomShader\WWMIv1\ShapeKeyMultiplier

[CommandListApplyShapeKeys]
cs-t6 = ResourcePositionBuffer
cs-u6 = ResourcePositionRW
run = CustomShader\WWMIv1\ShapeKeyApplier
ResourceShapeKeyedPosition = copy ResourcePositionRW

[TextureOverrideShapeKeyMultiplierCallback]
hash = 15eeff11
match_priority = 0
if $mod_enabled
    if cs == 3381.4444 && ResourceMergedSkeleton !== null
        handling = skip
        run = CommandListMultiplyShapeKeys
        run = CommandListApplyShapeKeys
    endif
endif

; Resources: Shape Keys Override -------------------------

[ResourceShapeKeyedPosition]

[ResourcePositionRW]
type = RWBuffer
format = R32_FLOAT
stride = 12
array = 1917708

[ResourceShapeKeyCBRW]
type = RWBuffer
format = R32G32B32A32_UINT
array = 66

[ResourceCustomShapeKeyValuesRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 32

; Resources: Skeleton Override -------------------------

[ResourceMergedSkeleton]

[ResourceMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 1536

[ResourceExtraMergedSkeleton]

[ResourceExtraMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 1536

; Resources: Buffers -------------------------

[ResourceBypassVB0]

[ResourceIndexBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 12
filename = Meshes/Index.buf

[ResourcePositionBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32_FLOAT
stride = 12
filename = Meshes/Position.buf

[ResourceBlendBuffer]
type = Buffer
format = DXGI_FORMAT_R8_UINT
stride = 16
filename = Meshes/Blend.buf

[ResourceBlendBufferNoStride]
type = Buffer
format = DXGI_FORMAT_R8_UINT
filename = Meshes/Blend.buf

[ResourceVectorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_SNORM
stride = 8
filename = Meshes/Vector.buf

[ResourceColorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_UNORM
stride = 4
filename = Meshes/Color.buf

[ResourceTexCoordBuffer]
type = Buffer
format = DXGI_FORMAT_R16G16_FLOAT
stride = 16
filename = Meshes/TexCoord.buf

[ResourceBlendRemapVertexVGBuffer]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = Meshes/BlendRemapVertexVG.buf

[ResourceBlendRemapForwardBuffer]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = Meshes/BlendRemapForward.buf

[ResourceBlendRemapReverseBuffer]
type = Buffer
format = DXGI_FORMAT_R16_UINT
filename = Meshes/BlendRemapReverse.buf

[ResourceShapeKeyOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32A32_UINT
stride = 16
filename = Meshes/ShapeKeyOffset.buf

[ResourceShapeKeyVertexIdBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 4
filename = Meshes/ShapeKeyVertexId.buf

[ResourceShapeKeyVertexOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R16_FLOAT
stride = 2
filename = Meshes/ShapeKeyVertexOffset.buf

[Constants]
; user
global persist $slider_value_1 = 0
global persist $slider_value_2 = 0
global persist $slider_value_3 = 0

global persist $version = 1.0

[TextureOverrideUIMenu]
hash = 2738a0f0
match_priority = 0
$is_role_active = 2

[Constants]
; custom
global $page_total_amount = 3
global $toggle_total_amount = 47
global $toggle_horizontal_amount = 6
global $slider_total_amount = 3

; custom_extend
global $sidebar_size_x = 0.05
global $sidebar_size_y = 0
global $title_size_x = 0.25
global $title_size_y = 0.05
global $version_size_x = 0.1
global $version_size_y = 0.04

global $page_icon_size_x = 0.03
global $page_icon_size_y = 0.05
global $page_icon_gap_x = 0.01
global $page_icon_gap_y = 0.01

global $slider_icon_size_x = 0.02
global $slider_icon_size_y = 0.04
global $slider_bar_size_x = 0.2
global $slider_bar_size_y = 0.01
global $slider_gap_x = 0.002
global $slider_gap_y = 0.015

global $toggle_size_x = 0.05
global $toggle_size_y = 0.05
global $toggle_gap = 0.003

global $close_icon_size_x = 0.03
global $close_icon_size_y = 0.05

global $sidebar_divider_thickness = 0.002
global $title_divider_thickness = 0.004
global $slider_tolerance_y = 0.008

; temporary
global $ww = 1920
global $wh = 1080

global $ui_size_x = 0
global $ui_size_y = 0
global $content_size_x = 0
global $content_size_y = 0

global $cursor_clicked = 0
global $cursor_holded = 0

global $is_ui_dragging = 0
global $is_slider_dragging = 0
global $is_render_append = 0
global $is_role_active = 0
global $is_ui_menu = 0
global persist $is_toggle_page = 0
global persist $is_slider_page = 0
global persist $is_epilog_page = 0
global $is_close_hover = 1
global $is_page_hover = 1
global $is_toggled = 0

global $start_x = 0
global $start_y = 0
global persist $final_x = 0
global persist $final_y = 0
global $cursor_x = 0
global $cursor_y = 0
global $page_x = 0
global $page_y = 0
global $page_number = 0
global $current_page_number = 1
global $toggle_x = 0
global $toggle_y = 0
global $toggle_number = 0
global $toggle_number = 0
global $slider_x = 0
global $slider_y = 0
global $slider_value = 0.0
global $slider_number = 0
global $current_slider_number = 1
global $close_x = 0
global $close_y = 0

[KeyToggleUI]
condition = $is_role_active
key = no_ctrl no_shift no_alt 0
type = cycle
$is_ui_menu = 0, 1

[KeyMouseLeft]
condition = $is_ui_menu
key = VK_LBUTTON    
type = hold
$cursor_holded = 1
$cursor_clicked = 1

[Present]
post $is_role_active = $is_role_active - 1
if $is_role_active <= 0
    $is_ui_menu = 0
endif
if $is_ui_menu
    run = CommandListInitUISize

    run = CommandListDrawUISidebar
    run = CommandListDrawSidebarDivider
    run = CommandListDrawUITitle
    run = CommandListDrawTitleDivider
    run = CommandListDrawUIVersion
    run = CommandListCloseBlock

    run = CommandListAddPageIcon
    run = CommandListAddPageIcon

    if $is_toggle_page
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
        run = CommandListAddToggle
    else if $is_epilog_page
        run = CommandListDrawEpilogPage
    endif

    ; run = CommandListDrawUIBackground

    run = CommandListResetState
    run = CommandListCheckDrag
endif
if $swapvar_toggle_38 == -1
    $chest = 0
else
    $chest = 1
endif
if $swapvar_toggle_45 == -1
    $panty = 0
else
    $panty = 1
endif
if $swapvar_toggle_40 == 0
    $leg_left = 0
else
    $leg_left = 1
endif
if $swapvar_toggle_42 == 0
    $leg_right = 0
else
    $leg_right = 1
endif
if $swapvar_toggle_43 == 0
    $foot_left = 1
else
    $foot_left = 0
endif
if $swapvar_toggle_41 == 0
    $foot_right = 1
else
    $foot_right = 0
endif
if $swapvar_toggle_17 == 0
    $arm_left = 1
else
    $arm_left = 0
endif
if $swapvar_toggle_18 == 0
    $arm_right = 1
else
    $arm_right = 0
endif
if $swapvar_toggle_36 == 0 || $swapvar_toggle_38 == 0
    $chest_side = 1
else
    $chest_side = 0
endif

[CommandListResetState]
$page_number = 0
$toggle_number = 0
$slider_number = 0
$cursor_clicked = 0
pre $is_close_hover = 0

[CommandListInitUISize]
if window_width >= 640
    $ww = window_width
    $wh = window_height
else if rt_width >= 640
    $ww = rt_width
    $wh = rt_height
else
    $ww = res_width
    $wh = res_height
endif

if cursor_x > 0 && cursor_y > 0 && cursor_x < 1 && cursor_y < 1
    $cursor_x = cursor_x
    $cursor_y = cursor_y
elif cursor_window_x > 0 && cursor_window_y > 0 && cursor_window_x < 1 && cursor_window_y < 1
    $cursor_x = cursor_window_x / $ww
    $cursor_y = cursor_window_y / $wh
else
    $cursor_x = cursor_screen_x / $ww
    $cursor_y = cursor_screen_y / $wh
endif

local $ui_toggle_width = 0
if $toggle_total_amount > $toggle_horizontal_amount
    $ui_toggle_width = ($toggle_size_x + $toggle_gap) * $toggle_horizontal_amount
else
    $ui_toggle_width = ($toggle_size_x + $toggle_gap) * $toggle_total_amount
endif
if $slider_bar_size_x > $ui_toggle_width
    $content_size_x = $slider_bar_size_x + $slider_gap_x*2
else
    $content_size_x = $ui_toggle_width
    $slider_bar_size_x = $ui_toggle_width - $slider_gap_x*3
endif

local $rows = ($toggle_total_amount + $toggle_horizontal_amount - 1) // $toggle_horizontal_amount
local $ui_toggle_height = $rows * $toggle_size_y * $ww/$wh + ($rows - 1) * $toggle_gap
local $ui_slider_height = ($slider_bar_size_y + $slider_gap_y) * $slider_total_amount + $slider_gap_y*6
if $ui_toggle_height > $ui_slider_height
    $content_size_y = $ui_toggle_height
else
    $content_size_y = $ui_slider_height
endif

$ui_size_x = $sidebar_size_x + $sidebar_divider_thickness + $content_size_x
$ui_size_y = $title_size_y + $title_divider_thickness + $content_size_y + $version_size_y

$sidebar_size_y = $ui_size_y

[CommandListAddPageIcon]
$page_number = $page_number + 1
if $page_number <= $page_total_amount
    run = CommandListPageBlock
endif

[CommandListAddToggle]
$toggle_number = $toggle_number + 1
if $toggle_number <= $toggle_total_amount
    run = CommandListToggleBlock
endif

[CommandListAddSlider]
$slider_number = $slider_number + 1
if $slider_number <= $slider_total_amount
    run = CommandListSliderBlock
endif

[CommandListPageBlock]
$page_x = $final_x + $page_icon_gap_x
$page_y = $final_y + $page_icon_gap_y*2 + ($page_icon_size_y + $page_icon_gap_y) * ($page_number - 1)

if $cursor_y > $page_y && $cursor_y < $page_y + $page_icon_size_x
    if $page_number <= $page_total_amount
        if $cursor_x > $page_x && $cursor_x < $page_x + $page_icon_size_x
            if $cursor_clicked
                $current_page_number = $page_number
                run = CommandListSetPage
            endif
            $is_page_hover = 1
        endif
    endif
endif
run = CommandListDrawPageIcon
$is_page_hover = 0

[CommandListToggleBlock]
$toggle_x = $final_x + $sidebar_size_x + $sidebar_divider_thickness + $toggle_gap + ($toggle_size_x + $toggle_gap) * (($toggle_number - 1) % $toggle_horizontal_amount)
local $row = (($toggle_number - 1) // $toggle_horizontal_amount)
$toggle_y = $final_y + $title_size_y + $toggle_gap + $title_divider_thickness + $row * ($toggle_size_y + $toggle_gap) * $ww/$wh

if $toggle_number <= $toggle_total_amount
    if $cursor_y > $toggle_y && $cursor_y < $toggle_y + $toggle_size_y * $ww/$wh && $cursor_x > $toggle_x && $cursor_x < $toggle_x + $toggle_size_x
        if $cursor_clicked
            $toggle_number = $toggle_number
            run = CommandListSetToggleValue
        endif
        run = CommandListDrawToggleEffect
    endif
endif
run = CommandListDrawToggle
run = CommandListDrawToggleSelect

[CommandListSliderBlock]
$slider_x = $final_x + $sidebar_size_x + $sidebar_divider_thickness + $slider_gap_x*3
$slider_y = $final_y + $title_size_y + $title_divider_thickness + $slider_gap_y*2 + (($slider_bar_size_y + $slider_gap_y*3) * ($slider_number - 1))

run = CommandListDrawSliderBar
run = CommandListDrawSliderBarCover
$is_render_append = !$is_render_append
run = CommandListDrawSliderIcon

if $slider_number <= $slider_total_amount
    if $cursor_y > $slider_y - $slider_tolerance_y && $cursor_y < $slider_y + $slider_bar_size_y
        if $cursor_x > $slider_x && $cursor_x < $slider_x + $slider_bar_size_x
            if $cursor_holded && !$is_slider_dragging
                $current_slider_number = $slider_number
                run = CommandListCheckDrag
            endif
        endif
    endif
endif

[CommandListCloseBlock]
$close_x = $final_x + ($ui_size_x - $close_icon_size_x)
$close_y = $final_y

if $cursor_y > $close_y && $cursor_y < $close_y + $close_icon_size_y
    if $cursor_x > $close_x && $cursor_x < $close_x + $close_icon_size_x
        if $cursor_clicked
            $is_ui_menu = 0
        endif
        $is_close_hover = 1
    endif
endif
run = CommandListDrawUICloseIcon

[CommandListVersionBlock]
; TODO: auto version number

[CommandListCheckDrag]
if $is_ui_dragging
    if $cursor_holded
        run = CommandListMoveUIMenu
    else
        $is_ui_dragging = 0
    endif

else if $is_slider_dragging
    if $cursor_holded
        run = CommandListSetSliderValue
    else
        $is_slider_dragging = 0
    endif

else if $cursor_x > $final_x && $cursor_x < $final_x + $ui_size_x
    if $cursor_y > $final_y && $cursor_y < $final_y + $ui_size_y

        if $cursor_holded
            if $is_slider_page
                local $slider_right = $slider_x + $slider_bar_size_x
                local $slider_top = $slider_y - $slider_tolerance_y
                local $slider_bottom = $slider_y + $slider_bar_size_y

                if $cursor_x > $slider_x && $cursor_x < $slider_right && $cursor_y > $slider_top && $cursor_y < $slider_bottom
                    run = CommandListSetSliderValue
                    $is_slider_dragging = 1
                else
                    run = CommandListStartUIDrag
                    run = CommandListMoveUIMenu
                endif
            else
                run = CommandListStartUIDrag
                run = CommandListMoveUIMenu
            endif
        else
            $is_ui_dragging = 0
            $is_slider_dragging = 0
        endif
    endif
endif

[CommandListStartUIDrag]
if !$is_ui_dragging
    $start_x = $cursor_x - $final_x
    $start_y = $cursor_y - $final_y
    $is_ui_dragging = 1
endif

[CommandListMoveUIMenu]
if $is_ui_dragging
    if $mouse_hold
        local $off_x = $cursor_x - $start_x
        local $off_y = $cursor_y - $start_y

        if $off_x < 0
            $final_x = 0
        else if $off_x + $ui_size_x > 1
            $final_x = 1 - $ui_size_x
        else
            $final_x = $off_x
        endif

        if $off_y < 0
            $final_y = 0
        else if $off_y + $ui_size_y > 1
            $final_y = 1 - $ui_size_y
        else
            $final_y = $off_y
        endif
    else
        $is_ui_dragging = 0
    endif
endif

[CommandListDrawUISidebar]
x87 = $sidebar_size_x
y87 = $sidebar_size_y
z87 = $final_x
w87 = $final_y
ps-t100 = ResourceUIBackgroundTransparent
run = CustomShaderElement

[CommandListDrawSidebarDivider]
x87 = $sidebar_divider_thickness
y87 = $ui_size_y
z87 = $final_x + $sidebar_size_x
w87 = $final_y
ps-t100 = ResourceUIDivider
run = CustomShaderElement

[CommandListDrawUITitle]
x87 = $title_size_x
y87 = $title_size_y
z87 = $final_x + $sidebar_size_x
w87 = $final_y
ps-t100 = ResourceUITitle
run = CustomShaderElement

[CommandListDrawTitleDivider]
x87 = $content_size_x
y87 = $title_divider_thickness
z87 = $final_x + $sidebar_size_x + $sidebar_divider_thickness
w87 = $final_y + $title_size_y
ps-t100 = ResourceUIDivider
run = CustomShaderElement

[CommandListDrawEpilogPage]
x87 = $content_size_x
y87 = $content_size_y
z87 = $final_x + $sidebar_size_x + $sidebar_divider_thickness
w87 = $final_y + $title_size_y
ps-t100 = ResourceUIAbout
run = CustomShaderElement

[CommandListDrawUIVersion]
x87 = $version_size_x
y87 = $version_size_y
z87 = $final_x + ($sidebar_size_x + $sidebar_divider_thickness)
w87 = $final_y + ($title_size_y + $title_divider_thickness + $content_size_y)
ps-t100 = ResourceUIVersion
run = CustomShaderElement

[CommandListDrawPageIcon]
x87 = $page_icon_size_x
y87 = $page_icon_size_y
z87 = $page_x
w87 = $page_y
run = CommandListSetPageIcon
run = CustomShaderElement

[CommandListDrawToggle]
x87 = $toggle_size_x
y87 = $toggle_size_y * $ww/$wh
z87 = $toggle_x
w87 = $toggle_y
run = CommandListSetToggleIcon
run = CustomShaderElement

[CommandListDrawToggleSelect]
x87 = $toggle_size_x
y87 = $toggle_size_y * $ww/$wh
z87 = $toggle_x
w87 = $toggle_y
if $is_toggled
    ps-t100 = ResourceUIToggled
else
    ps-t100 = ResourceUIToggleSelect
endif
run = CustomShaderElement
$is_toggled = 0

[CommandListDrawToggleEffect]
x87 = $toggle_size_x
y87 = $toggle_size_y * $ww/$wh
z87 = $toggle_x
w87 = $toggle_y
if $is_ui_dragging && $toggle_number == $toggle_number
    ps-t100 = ResourceUITogglePush
else
    ps-t100 = ResourceUIToggleBorder
endif
run = CustomShaderElement

[CommandListDrawSliderBar]
x87 = $slider_bar_size_x
y87 = $slider_bar_size_y
z87 = $slider_x
w87 = $slider_y
ps-t100 = ResourceSliderBar
run = CustomShaderElement

[CommandListDrawSliderBarCover]
if $slider_number == 1
    x87 = $slider_value_1 * $slider_bar_size_x
else if $slider_number == 2
    x87 = $slider_value_2 * $slider_bar_size_x
else if $slider_number == 3
    x87 = $slider_value_3 * $slider_bar_size_x
endif
y87 = $slider_bar_size_y
z87 = $slider_x
w87 = $slider_y
ps-t100 = ResourceUIDivider
run = CustomShaderElement

[CommandListDrawSliderIcon]
local $icon_off = 0.0025
local $tolerance_x = 0.014
x87 = $slider_icon_size_x
y87 = $slider_icon_size_y
if $slider_number == 1
    z87 = ($slider_x - $icon_off) + $slider_value_1 * ($slider_bar_size_x - $tolerance_x)
else if $slider_number == 2
    z87 = ($slider_x - $icon_off) + $slider_value_2 * ($slider_bar_size_x - $tolerance_x)
else if $slider_number == 3
    z87 = ($slider_x - $icon_off) + $slider_value_3 * ($slider_bar_size_x - $tolerance_x)
endif
w87 = $slider_y - $slider_icon_size_y / 3
run = CommandListSetSliderIcon
run = CustomShaderElement

[CommandListDrawUICloseIcon]
x87 = $close_icon_size_x
y87 = $close_icon_size_y
z87 = $final_x + ($ui_size_x - $close_icon_size_x)
w87 = $final_y
if $is_close_hover
    ps-t100 = ResourceUIClose2
else
    ps-t100 = ResourceUIClose1
endif
run = CustomShaderElement

[CommandListDrawUIBackground]
x87 = $ui_size_x
y87 = $ui_size_y
z87 = $final_x
w87 = $final_y
ps-t100 = ResourceUIBackgroundShenghen
run = CustomShaderElement

[CustomShaderElement]
hs = null
ds = null
gs = null
cs = null
vs = .\res\draw_2d.hlsl
ps = .\res\draw_2d.hlsl
blend = ADD SRC_ALPHA INV_SRC_ALPHA
cull = none
topology = triangle_strip
o0 = set_viewport bb
Draw = 4,0

[CommandListSetPage]
$is_toggle_page = 0
$is_slider_page = 0
$is_epilog_page = 0

if $current_page_number == 1
    $is_toggle_page = 1
else if $current_page_number == 2
    $is_epilog_page = 1
endif

[CommandListSetPageIcon]
if $page_number == 1
    ps-t100 = ResourceUIToggle1
    if $is_page_hover || $current_page_number == $page_number
        ps-t100 = ResourceUIToggle2
    endif
else if $page_number == 2
    ps-t100 = ResourceUIAbout1
    if $is_page_hover || $current_page_number == $page_number
        ps-t100 = ResourceUIAbout2
    endif
else
    ps-t100 = ResourceUIToggle1
endif

[CommandListSetToggleValue]
if $toggle_number == 1
    if $swapvar_toggle_0 < 0
        $swapvar_toggle_0 = $swapvar_toggle_0 + 1
    else
        $swapvar_toggle_0 = -1
    endif

else if $toggle_number == 2
    if $swapvar_toggle_1 < 0
        $swapvar_toggle_1 = $swapvar_toggle_1 + 1
    else
        $swapvar_toggle_1 = -1
    endif

else if $toggle_number == 3
    if $swapvar_toggle_2 < 0
        $swapvar_toggle_2 = $swapvar_toggle_2 + 1
    else
        $swapvar_toggle_2 = -1
    endif

else if $toggle_number == 4
    if $swapvar_toggle_3 < 0
        $swapvar_toggle_3 = $swapvar_toggle_3 + 1
    else
        $swapvar_toggle_3 = -1
    endif

else if $toggle_number == 5
    if $swapvar_toggle_4 < 0
        $swapvar_toggle_4 = $swapvar_toggle_4 + 1
    else
        $swapvar_toggle_4 = -1
    endif

else if $toggle_number == 6
    if $swapvar_toggle_5 < 0
        $swapvar_toggle_5 = $swapvar_toggle_5 + 1
    else
        $swapvar_toggle_5 = -1
    endif

else if $toggle_number == 7
    if $swapvar_toggle_6 < 0
        $swapvar_toggle_6 = $swapvar_toggle_6 + 1
    else
        $swapvar_toggle_6 = -1
    endif

else if $toggle_number == 8
    if $swapvar_toggle_7 < 0
        $swapvar_toggle_7 = $swapvar_toggle_7 + 1
    else
        $swapvar_toggle_7 = -1
    endif

else if $toggle_number == 9
    if $swapvar_toggle_8 < 0
        $swapvar_toggle_8 = $swapvar_toggle_8 + 1
    else
        $swapvar_toggle_8 = -1
    endif

else if $toggle_number == 10
    if $swapvar_toggle_9 < 0
        $swapvar_toggle_9 = $swapvar_toggle_9 + 1
    else
        $swapvar_toggle_9 = -1
    endif

else if $toggle_number == 11
    if $swapvar_toggle_10 < 0
        $swapvar_toggle_10 = $swapvar_toggle_10 + 1
    else
        $swapvar_toggle_10 = -1
    endif

else if $toggle_number == 12
    if $swapvar_toggle_11 < 0
        $swapvar_toggle_11 = $swapvar_toggle_11 + 1
    else
        $swapvar_toggle_11 = -1
    endif

else if $toggle_number == 13
    if $swapvar_toggle_12 < 0
        $swapvar_toggle_12 = $swapvar_toggle_12 + 1
    else
        $swapvar_toggle_12 = -1
    endif

else if $toggle_number == 14
    if $swapvar_toggle_13 < 0
        $swapvar_toggle_13 = $swapvar_toggle_13 + 1
    else
        $swapvar_toggle_13 = -1
    endif

else if $toggle_number == 15
    if $swapvar_toggle_14 < 0
        $swapvar_toggle_14 = $swapvar_toggle_14 + 1
    else
        $swapvar_toggle_14 = -1
    endif

else if $toggle_number == 16
    if $swapvar_toggle_15 < 0
        $swapvar_toggle_15 = $swapvar_toggle_15 + 1
    else
        $swapvar_toggle_15 = -1
    endif

else if $toggle_number == 17
    if $swapvar_toggle_16 < 0
        $swapvar_toggle_16 = $swapvar_toggle_16 + 1
    else
        $swapvar_toggle_16 = -1
    endif

else if $toggle_number == 18
    if $swapvar_toggle_17 < 0
        $swapvar_toggle_17 = $swapvar_toggle_17 + 1
    else
        $swapvar_toggle_17 = -1
    endif

else if $toggle_number == 19
    if $swapvar_toggle_18 < 0
        $swapvar_toggle_18 = $swapvar_toggle_18 + 1
    else
        $swapvar_toggle_18 = -1
    endif

else if $toggle_number == 20
    if $swapvar_toggle_19 < 0
        $swapvar_toggle_19 = $swapvar_toggle_19 + 1
    else
        $swapvar_toggle_19 = -1
    endif

else if $toggle_number == 21
    if $swapvar_toggle_20 < 0
        $swapvar_toggle_20 = $swapvar_toggle_20 + 1
    else
        $swapvar_toggle_20 = -1
    endif

else if $toggle_number == 22
    if $swapvar_toggle_21 < 0
        $swapvar_toggle_21 = $swapvar_toggle_21 + 1
    else
        $swapvar_toggle_21 = -1
    endif

else if $toggle_number == 23
    if $swapvar_toggle_22 < 0
        $swapvar_toggle_22 = $swapvar_toggle_22 + 1
    else
        $swapvar_toggle_22 = -1
    endif

else if $toggle_number == 24
    if $swapvar_toggle_23 < 0
        $swapvar_toggle_23 = $swapvar_toggle_23 + 1
    else
        $swapvar_toggle_23 = -1
    endif

else if $toggle_number == 25
    if $swapvar_toggle_24 < 0
        $swapvar_toggle_24 = $swapvar_toggle_24 + 1
    else
        $swapvar_toggle_24 = -1
    endif

else if $toggle_number == 26
    if $swapvar_toggle_25 < 0
        $swapvar_toggle_25 = $swapvar_toggle_25 + 1
    else
        $swapvar_toggle_25 = -1
    endif

else if $toggle_number == 27
    if $swapvar_toggle_26 < 0
        $swapvar_toggle_26 = $swapvar_toggle_26 + 1
    else
        $swapvar_toggle_26 = -1
    endif

else if $toggle_number == 28
    if $swapvar_toggle_27 < 0
        $swapvar_toggle_27 = $swapvar_toggle_27 + 1
    else
        $swapvar_toggle_27 = -1
    endif

else if $toggle_number == 29
    if $swapvar_toggle_28 < 0
        $swapvar_toggle_28 = $swapvar_toggle_28 + 1
    else
        $swapvar_toggle_28 = -1
    endif

else if $toggle_number == 30
    if $swapvar_toggle_29 < 0
        $swapvar_toggle_29 = $swapvar_toggle_29 + 1
    else
        $swapvar_toggle_29 = -1
    endif

else if $toggle_number == 31
    if $swapvar_toggle_30 < 0
        $swapvar_toggle_30 = $swapvar_toggle_30 + 1
    else
        $swapvar_toggle_30 = -1
    endif

else if $toggle_number == 32
    if $swapvar_toggle_31 < 0
        $swapvar_toggle_31 = $swapvar_toggle_31 + 1
    else
        $swapvar_toggle_31 = -1
    endif

else if $toggle_number == 33
    if $swapvar_toggle_32 < 0
        $swapvar_toggle_32 = $swapvar_toggle_32 + 1
    else
        $swapvar_toggle_32 = -1
    endif

else if $toggle_number == 34
    if $swapvar_toggle_33 < 0
        $swapvar_toggle_33 = $swapvar_toggle_33 + 1
    else
        $swapvar_toggle_33 = -1
    endif

else if $toggle_number == 35
    if $swapvar_toggle_34 < 0
        $swapvar_toggle_34 = $swapvar_toggle_34 + 1
    else
        $swapvar_toggle_34 = -1
    endif

else if $toggle_number == 36
    if $swapvar_toggle_35 < 0
        $swapvar_toggle_35 = $swapvar_toggle_35 + 1
    else
        $swapvar_toggle_35 = -1
    endif

else if $toggle_number == 37
    if $swapvar_toggle_36 < 0
        $swapvar_toggle_36 = $swapvar_toggle_36 + 1
    else
        $swapvar_toggle_36 = -1
    endif

else if $toggle_number == 38
    if $swapvar_toggle_37 < 0
        $swapvar_toggle_37 = $swapvar_toggle_37 + 1
    else
        $swapvar_toggle_37 = -1
    endif

else if $toggle_number == 39
    if $swapvar_toggle_38 < 0
        $swapvar_toggle_38 = $swapvar_toggle_38 + 1
    else
        $swapvar_toggle_38 = -1
    endif

else if $toggle_number == 40
    if $swapvar_toggle_39 < 0
        $swapvar_toggle_39 = $swapvar_toggle_39 + 1
    else
        $swapvar_toggle_39 = -1
    endif

else if $toggle_number == 41
    if $swapvar_toggle_40 < 0
        $swapvar_toggle_40 = $swapvar_toggle_40 + 1
    else
        $swapvar_toggle_40 = -1
    endif

else if $toggle_number == 42
    if $swapvar_toggle_41 < 0
        $swapvar_toggle_41 = $swapvar_toggle_41 + 1
    else
        $swapvar_toggle_41 = -1
    endif

else if $toggle_number == 43
    if $swapvar_toggle_42 < 0
        $swapvar_toggle_42 = $swapvar_toggle_42 + 1
    else
        $swapvar_toggle_42 = -1
    endif

else if $toggle_number == 44
    if $swapvar_toggle_43 < 0
        $swapvar_toggle_43 = $swapvar_toggle_43 + 1
    else
        $swapvar_toggle_43 = -1
    endif

else if $toggle_number == 45
    if $swapvar_toggle_44 < 0
        $swapvar_toggle_44 = $swapvar_toggle_44 + 1
    else
        $swapvar_toggle_44 = -1
    endif

else if $toggle_number == 46
    if $swapvar_toggle_45 < 0
        $swapvar_toggle_45 = $swapvar_toggle_45 + 1
    else
        $swapvar_toggle_45 = -1
    endif

else if $toggle_number == 47
    if $swapvar_toggle_46 < 0
        $swapvar_toggle_46 = $swapvar_toggle_46 + 1
        $swapvar_toggle_0 = 0
        $swapvar_toggle_1 = 0
        $swapvar_toggle_2 = 0
        $swapvar_toggle_3 = 0
        $swapvar_toggle_4 = 0
        $swapvar_toggle_5 = 0
        $swapvar_toggle_6 = 0
        $swapvar_toggle_7 = 0
        $swapvar_toggle_8 = 0
        $swapvar_toggle_9 = 0
        $swapvar_toggle_10 = 0
        $swapvar_toggle_11 = 0
        $swapvar_toggle_12 = 0
        $swapvar_toggle_13 = 0
        $swapvar_toggle_14 = 0
        $swapvar_toggle_15 = 0
        $swapvar_toggle_16 = 0
        $swapvar_toggle_17 = 0
        $swapvar_toggle_18 = 0
        $swapvar_toggle_19 = 0
        $swapvar_toggle_20 = 0
        $swapvar_toggle_21 = 0
        $swapvar_toggle_22 = 0
        $swapvar_toggle_23 = 0
        $swapvar_toggle_24 = 0
        $swapvar_toggle_25 = 0
        $swapvar_toggle_26 = 0
        $swapvar_toggle_27 = 0
        $swapvar_toggle_28 = 0
        $swapvar_toggle_29 = 0
        $swapvar_toggle_30 = 0
        $swapvar_toggle_31 = 0
        $swapvar_toggle_32 = 0
        $swapvar_toggle_33 = 0
        $swapvar_toggle_34 = 0
        $swapvar_toggle_35 = 0
        $swapvar_toggle_36 = 0
        $swapvar_toggle_37 = 0
        $swapvar_toggle_38 = 0
        $swapvar_toggle_39 = 0
        $swapvar_toggle_40 = 0
        $swapvar_toggle_41 = 0
        $swapvar_toggle_42 = 0
        $swapvar_toggle_43 = 0
        $swapvar_toggle_44 = 0
        $swapvar_toggle_45 = 0
    else
        $swapvar_toggle_46 = -1
        $swapvar_toggle_0 = -1
        $swapvar_toggle_1 = -1
        $swapvar_toggle_2 = -1
        $swapvar_toggle_3 = -1
        $swapvar_toggle_4 = -1
        $swapvar_toggle_5 = -1
        $swapvar_toggle_6 = -1
        $swapvar_toggle_7 = -1
        $swapvar_toggle_8 = -1
        $swapvar_toggle_9 = -1
        $swapvar_toggle_10 = -1
        $swapvar_toggle_11 = -1
        $swapvar_toggle_12 = -1
        $swapvar_toggle_13 = -1
        $swapvar_toggle_14 = -1
        $swapvar_toggle_15 = -1
        $swapvar_toggle_16 = -1
        $swapvar_toggle_17 = -1
        $swapvar_toggle_18 = -1
        $swapvar_toggle_19 = -1
        $swapvar_toggle_20 = -1
        $swapvar_toggle_21 = -1
        $swapvar_toggle_22 = -1
        $swapvar_toggle_23 = -1
        $swapvar_toggle_24 = -1
        $swapvar_toggle_25 = -1
        $swapvar_toggle_26 = -1
        $swapvar_toggle_27 = -1
        $swapvar_toggle_28 = -1
        $swapvar_toggle_29 = -1
        $swapvar_toggle_30 = -1
        $swapvar_toggle_31 = -1
        $swapvar_toggle_32 = -1
        $swapvar_toggle_33 = -1
        $swapvar_toggle_34 = -1
        $swapvar_toggle_35 = -1
        $swapvar_toggle_36 = -1
        $swapvar_toggle_37 = -1
        $swapvar_toggle_38 = -1
        $swapvar_toggle_39 = -1
        $swapvar_toggle_40 = -1
        $swapvar_toggle_41 = -1
        $swapvar_toggle_42 = -1
        $swapvar_toggle_43 = -1
        $swapvar_toggle_44 = -1
        $swapvar_toggle_45 = -1
    endif

endif

[CommandListSetToggleIcon]
if $toggle_number == 1
    ps-t100 = ResourceButton_30
else if $toggle_number == 2
    ps-t100 = ResourceButton_44
else if $toggle_number == 3
    ps-t100 = ResourceButton_43
else if $toggle_number == 4
    ps-t100 = ResourceButton_7
else if $toggle_number == 5
    ps-t100 = ResourceButton_37
else if $toggle_number == 6
    ps-t100 = ResourceButton_6
else if $toggle_number == 7
    ps-t100 = ResourceButton_8
else if $toggle_number == 8
    ps-t100 = ResourceButton_35
else if $toggle_number == 9
    ps-t100 = ResourceButton_34
else if $toggle_number == 10
    ps-t100 = ResourceButton_52
else if $toggle_number == 11
    ps-t100 = ResourceButton_17
else if $toggle_number == 12
    ps-t100 = ResourceButton_19
else if $toggle_number == 13
    ps-t100 = ResourceButton_45
else if $toggle_number == 14
    ps-t100 = ResourceButton_46
else if $toggle_number == 15
    ps-t100 = ResourceButton_18
else if $toggle_number == 16
    ps-t100 = ResourceButton_20
else if $toggle_number == 17
    ps-t100 = ResourceButton_1
else if $toggle_number == 18
    ps-t100 = ResourceButton_15
else if $toggle_number == 19
    ps-t100 = ResourceButton_16
else if $toggle_number == 20
    ps-t100 = ResourceButton_31
else if $toggle_number == 21
    ps-t100 = ResourceButton_42
else if $toggle_number == 22
    ps-t100 = ResourceButton_29
else if $toggle_number == 23
    ps-t100 = ResourceButton_28
else if $toggle_number == 24
    ps-t100 = ResourceButton_12
else if $toggle_number == 25
    ps-t100 = ResourceButton_11
else if $toggle_number == 26
    ps-t100 = ResourceButton_3
else if $toggle_number == 27
    ps-t100 = ResourceButton_14
else if $toggle_number == 28
    ps-t100 = ResourceButton_13
else if $toggle_number == 29
    ps-t100 = ResourceButton_27
else if $toggle_number == 30
    ps-t100 = ResourceButton_22
else if $toggle_number == 31
    ps-t100 = ResourceButton_21
else if $toggle_number == 32
    ps-t100 = ResourceButton_38
else if $toggle_number == 33
    ps-t100 = ResourceButton_23
else if $toggle_number == 34
    ps-t100 = ResourceButton_41
else if $toggle_number == 35
    ps-t100 = ResourceButton_39
else if $toggle_number == 36
    ps-t100 = ResourceButton_53
else if $toggle_number == 37
    ps-t100 = ResourceButton_24
else if $toggle_number == 38
    ps-t100 = ResourceButton_2
else if $toggle_number == 39
    ps-t100 = ResourceButton_25
else if $toggle_number == 40
    ps-t100 = ResourceButton_26
else if $toggle_number == 41
    ps-t100 = ResourceButton_4
else if $toggle_number == 42
    ps-t100 = ResourceButton_10
else if $toggle_number == 43
    ps-t100 = ResourceButton_5
else if $toggle_number == 44
    ps-t100 = ResourceButton_9
else if $toggle_number == 45
    ps-t100 = ResourceButton_33
else if $toggle_number == 46
    ps-t100 = ResourceButton_48
else if $toggle_number == 47
    ps-t100 = ResourceButton_47
else
    ps-t100 = ResourceButton_1
endif

[CommandListSetSliderValue]
$slider_value = (($cursor_x - $slider_x) / $slider_bar_size_x)
if $slider_value < 0
    $slider_value = 0
elif $slider_value > 1
    $slider_value = 1
endif

if $current_slider_number == 1
    $slider_value_1 = $slider_value
else if $current_slider_number == 2
    $slider_value_2 = $slider_value
else if $current_slider_number == 3
    $slider_value_3 = $slider_value
endif

[CommandListSetSliderIcon]
if $slider_number == 1
    ps-t100 = ResourceButton_1
else if $slider_number == 2
    ps-t100 = ResourceButton_1
else if $slider_number == 3
    ps-t100 = ResourceButton_1
else
    ps-t100 = ResourceButton_1
endif

[ResourceUIToggleBorder]
filename = .\res\toggle_border_1.png

[ResourceUITogglePush]
filename = .\res\toggle_push.png

[ResourceUIToggleSelect]
filename = .\res\toggle_select.png

[ResourceUIToggled]
filename = .\res\toggle_push.png

[ResourceUIToggle1]
filename = .\res\toggle_1.png

[ResourceUIToggle2]
filename = .\res\toggle_2.png

[ResourceUISlider1]
filename = .\res\slider_1.png

[ResourceUISlider2]
filename = .\res\slider_2.png

[ResourceSliderBar]
filename = .\res\slider_bar.png

[ResourceUIAbout1]
filename = .\res\about_1.png

[ResourceUIAbout2]
filename = .\res\about_2.png

[ResourceUIClose1]
filename = .\res\close_1.png

[ResourceUIClose2]
filename = .\res\close_2.png

[ResourceUIBackgroundShenghen]
filename = .\res\shenghen_background.png

[ResourceUIBackgroundTransparent]
filename = .\res\background_transparent.png

[ResourceUITitle]
filename = .\res\title.png

[ResourceUIVersion]
filename = .\res\version.png

[ResourceUIAbout]
filename = .\res\about.png

[ResourceUIDivider]
filename = .\res\divider.png

[ResourceVersionNumber0]
filename = .\res\90.png
[ResourceVersionNumber1]
filename = .\res\91.png
[ResourceVersionNumber2]
filename = .\res\92.png
[ResourceVersionNumber3]
filename = .\res\93.png
[ResourceVersionNumber4]
filename = .\res\94.png
[ResourceVersionNumber5]
filename = .\res\95.png
[ResourceVersionNumber6]
filename = .\res\96.png
[ResourceVersionNumber7]
filename = .\res\97.png
[ResourceVersionNumber8]
filename = .\res\98.png
[ResourceVersionNumber9]
filename = .\res\99.png

[ResourceButton_1]
filename = .\res\1.png
[ResourceButton_2]
filename = .\res\2.png
[ResourceButton_3]
filename = .\res\3.png
[ResourceButton_4]
filename = .\res\4.png
[ResourceButton_5]
filename = .\res\5.png
[ResourceButton_6]
filename = .\res\6.png
[ResourceButton_7]
filename = .\res\7.png
[ResourceButton_8]
filename = .\res\8.png
[ResourceButton_9]
filename = .\res\9.png
[ResourceButton_10]
filename = .\res\10.png
[ResourceButton_11]
filename = .\res\11.png
[ResourceButton_12]
filename = .\res\12.png
[ResourceButton_13]
filename = .\res\13.png
[ResourceButton_14]
filename = .\res\14.png
[ResourceButton_15]
filename = .\res\15.png
[ResourceButton_16]
filename = .\res\16.png
[ResourceButton_17]
filename = .\res\17.png
[ResourceButton_18]
filename = .\res\18.png
[ResourceButton_19]
filename = .\res\19.png
[ResourceButton_20]
filename = .\res\20.png
[ResourceButton_21]
filename = .\res\21.png
[ResourceButton_22]
filename = .\res\22.png
[ResourceButton_23]
filename = .\res\23.png
[ResourceButton_24]
filename = .\res\24.png
[ResourceButton_25]
filename = .\res\25.png
[ResourceButton_26]
filename = .\res\26.png
[ResourceButton_27]
filename = .\res\27.png
[ResourceButton_28]
filename = .\res\28.png
[ResourceButton_29]
filename = .\res\29.png
[ResourceButton_30]
filename = .\res\30.png
[ResourceButton_31]
filename = .\res\31.png
[ResourceButton_32]
filename = .\res\32.png
[ResourceButton_33]
filename = .\res\33.png
[ResourceButton_34]
filename = .\res\34.png
[ResourceButton_35]
filename = .\res\35.png
[ResourceButton_36]
filename = .\res\36.png
[ResourceButton_37]
filename = .\res\37.png
[ResourceButton_38]
filename = .\res\38.png
[ResourceButton_39]
filename = .\res\39.png
[ResourceButton_40]
filename = .\res\40.png
[ResourceButton_41]
filename = .\res\41.png
[ResourceButton_42]
filename = .\res\42.png
[ResourceButton_43]
filename = .\res\43.png
[ResourceButton_44]
filename = .\res\44.png
[ResourceButton_45]
filename = .\res\45.png
[ResourceButton_46]
filename = .\res\46.png
[ResourceButton_47]
filename = .\res\47.png
[ResourceButton_48]
filename = .\res\48.png
[ResourceButton_49]
filename = .\res\49.png
[ResourceButton_50]
filename = .\res\50.png
[ResourceButton_51]
filename = .\res\51.png
[ResourceButton_52]
filename = .\res\52.png
[ResourceButton_53]
filename = .\res\53.png


; Autogenerated -------------------------

; This mod.ini was automatically generated by WWMI Tools Blender addon v1.5.1 and requires WWMI v0.9.6+ to function

; XXMI Launcher GameBanana: https://gamebanana.com/tools/17252
; XXMI Launcher GitHub: https://github.com/SpectrumQT/XXMI-Launcher
; WWMI Package GitHub: https://github.com/SpectrumQT/WWMI-Package
; WWMI Tools GameBanana: https://gamebanana.com/tools/17289
; WWMI Tools GitHub: https://github.com/SpectrumQT/WWMI_Tools
; AGMG Modding Community Discord: https://discord.com/invite/agmg
; SHA256 CHECKSUM: 3bca56803c588dd870d4d9c1d57170d4a4b3b5dcf7aeb0a5928f9287722fbf19
