private static void DrawWindow(int id)
        {
            GUIStyle lineStyle = new GUIStyle("box");

            lineStyle.border.top  = lineStyle.border.bottom = 1;
            lineStyle.margin.top  = lineStyle.margin.bottom = 1;
            lineStyle.padding.top = lineStyle.padding.bottom = 1;

            GUIStyle gridStyle = new GUIStyle("Button");

            gridStyle.onNormal.background = Texture2D.whiteTexture;
            gridStyle.onNormal.textColor  = Color.black;
            gridStyle.onHover.background  = Texture2D.whiteTexture;
            gridStyle.onHover.textColor   = Color.black;
            gridStyle.onActive.background = Texture2D.whiteTexture;
            gridStyle.onActive.textColor  = Color.black;

            string[] characterNames = new string[HS2_BetterHScenes.characters.Count];
            string[] offsetNames    = new string[] { "Whole Body", "Left Hand", "Right Hand", "Left Foot", "Right Foot" };
            for (var charIndex = 0; charIndex < HS2_BetterHScenes.characters.Count; charIndex++)
            {
                characterNames[charIndex] = HS2_BetterHScenes.characters[charIndex].fileParam.fullname;
            }

            using (GUILayout.VerticalScope guiVerticalScope = new GUILayout.VerticalScope("box"))
            {
                selectedCharacter = GUILayout.SelectionGrid(selectedCharacter, characterNames, HS2_BetterHScenes.characters.Count, gridStyle, GUILayout.Height(30));
                GUILayout.Box(GUIContent.none, lineStyle, GUILayout.ExpandWidth(true), GUILayout.Height(1f));
                using (GUILayout.HorizontalScope linkScope = new GUILayout.HorizontalScope("box"))
                {
                    selectedOffset = GUILayout.SelectionGrid(selectedOffset, offsetNames, offsetNames.Length, gridStyle, GUILayout.Height(30));
                }
                using (GUILayout.HorizontalScope linkScope = new GUILayout.HorizontalScope("box"))
                {
                    if (selectedOffset == (int)BodyPart.WholeBody)
                    {
                        GUILayout.Label("Mouth Size: ", GUILayout.Width((2 * uiWidth / 15) - 10));
                        mouthOffsets[selectedCharacter] = GUILayout.HorizontalSlider(mouthOffsets[selectedCharacter], -1, 1, GUILayout.Width((4 * uiWidth / 15) - 10));

                        GUILayout.FlexibleSpace();

                        GUILayout.Label("Heel Offset: ", GUILayout.Width((2 * uiWidth / 15) - 10));
                        shoeOffsets[selectedCharacter] = Convert.ToSingle(GUILayout.TextField(shoeOffsets[selectedCharacter].ToString("0.000"), GUILayout.Width((2 * uiWidth / 15) - 10)));
                    }
                    else
                    {
                        if (GUILayout.Button("Mirror Limb"))
                        {
                            MirrorActiveLimb();
                        }

                        bool[] lastCorrection = new bool[(int)BodyPart.BodyPartsCount];
                        for (var part = (int)BodyPart.LeftHand; part < (int)BodyPart.BodyPartsCount; part++)
                        {
                            lastCorrection[part] = characterOffsets[selectedCharacter].jointCorrection[part];
                        }

                        characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.LeftHand] =
                            GUILayout.Toggle(characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.LeftHand], " Correction");
                        characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.RightHand] =
                            GUILayout.Toggle(characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.RightHand], " Correction");
                        characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.LeftFoot] =
                            GUILayout.Toggle(characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.LeftFoot], " Correction");
                        characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.RightFoot] =
                            GUILayout.Toggle(characterOffsets[selectedCharacter].jointCorrection[(int)BodyPart.RightFoot], " Correction");

                        bool correctionChanged = false;
                        for (var part = (int)BodyPart.LeftHand; part < (int)BodyPart.BodyPartsCount; part++)
                        {
                            if (lastCorrection[part] == characterOffsets[selectedCharacter].jointCorrection[part])
                            {
                                continue;
                            }

                            correctionChanged = true;
                            break;
                        }

                        if (correctionChanged)
                        {
                            characterOffsets[selectedCharacter].ApplyJointCorrections();
                        }
                    }
                }

                GUILayout.Box(GUIContent.none, lineStyle, GUILayout.ExpandWidth(true), GUILayout.Height(1f));

                string  LabelName         = "Hint";
                float   sliderMaxHint     = HS2_BetterHScenes.sliderMaxHintPosition.Value;
                float   sliderMaxRotation = HS2_BetterHScenes.sliderMaxLimbRotation.Value;
                float   sliderMaxPosition = HS2_BetterHScenes.sliderMaxLimbPosition.Value;
                Vector3 lastPosition      = Vector3.zero;
                Vector3 lastRotation      = Vector3.zero;

                if (selectedOffset == (int)BodyPart.WholeBody)
                {
                    LabelName         = "Head Rotation";
                    sliderMaxHint     = HS2_BetterHScenes.sliderMaxBodyRotation.Value;
                    sliderMaxRotation = HS2_BetterHScenes.sliderMaxBodyRotation.Value;
                    sliderMaxPosition = HS2_BetterHScenes.sliderMaxBodyPosition.Value;
                    lastPosition      = new Vector3(
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x,
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y,
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z);
                    lastRotation = new Vector3(
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x,
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y,
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z);
                }

                using (GUILayout.HorizontalScope positionScope = new GUILayout.HorizontalScope("box"))
                {
                    using (GUILayout.VerticalScope verticalScopeX = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeX = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Position X");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x, -sliderMaxPosition, sliderMaxPosition);
                    }

                    using (GUILayout.VerticalScope verticalScopeY = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeY = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Position Y");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y, -sliderMaxPosition, sliderMaxPosition);
                    }

                    using (GUILayout.VerticalScope verticalScopeZ = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeZ = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Position Z");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z, -sliderMaxPosition, sliderMaxPosition);
                    }
                }

                using (GUILayout.HorizontalScope rotationScope = new GUILayout.HorizontalScope("box"))
                {
                    using (GUILayout.VerticalScope verticalScopeX = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeX = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Rotation X");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x, -sliderMaxRotation, sliderMaxRotation);
                    }

                    using (GUILayout.VerticalScope verticalScopeY = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeY = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Rotation Y");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y, -sliderMaxRotation, sliderMaxRotation);
                    }

                    using (GUILayout.VerticalScope verticalScopeZ = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeZ = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Rotation Z");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z, -sliderMaxRotation, sliderMaxRotation);
                    }
                }

                using (GUILayout.HorizontalScope rotationScope = new GUILayout.HorizontalScope("box"))
                {
                    using (GUILayout.VerticalScope verticalScopeX = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeX = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label($"{LabelName} X");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.x = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.x =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.x, -sliderMaxHint, sliderMaxHint);
                    }

                    using (GUILayout.VerticalScope verticalScopeY = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeY = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label($"{LabelName} Y");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.y = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.y =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.y, -sliderMaxHint, sliderMaxHint);
                    }

                    using (GUILayout.VerticalScope verticalScopeZ = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeZ = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label($"{LabelName} Z");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.z = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.z =
                            GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hint.z, -sliderMaxHint, sliderMaxHint);
                    }
                }

                if (selectedOffset != (int)BodyPart.WholeBody)
                {
                    if (selectedOffset <= (int)BodyPart.RightHand)
                    {
                        sliderMaxRotation /= 4;
                    }

                    using (GUILayout.HorizontalScope rotationScope = new GUILayout.HorizontalScope("box"))
                    {
                        GUILayout.FlexibleSpace();

                        using (GUILayout.VerticalScope verticalScopeZ = new GUILayout.VerticalScope("box"))
                        {
                            using (GUILayout.HorizontalScope horizontalScopeZ = new GUILayout.HorizontalScope())
                            {
                                GUILayout.Label($"Digit Rotation");

                                if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                                {
                                    characterOffsets[selectedCharacter].offsetVectors[selectedOffset].digitRotation = 0;
                                }
                            }

                            characterOffsets[selectedCharacter].offsetVectors[selectedOffset].digitRotation =
                                GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].digitRotation, -sliderMaxRotation, sliderMaxRotation);
                        }

                        GUILayout.FlexibleSpace();
                    }
                }

                if (selectedOffset == (int)BodyPart.WholeBody &&
                    (lastPosition != characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position ||
                     lastRotation != characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation))
                {
                    ApplyPositionsAndCorrections();
                }

                using (GUILayout.HorizontalScope controlScope = new GUILayout.HorizontalScope("box"))
                {
                    if (GUILayout.Button("Copy"))
                    {
                        CopyPositions();
                    }

                    if (GUILayout.Button("Paste"))
                    {
                        PastePositions();
                    }

                    if (GUILayout.Button("Reset All"))
                    {
                        ResetPositions();
                    }

                    if (GUILayout.Button("Reload"))
                    {
                        HSceneOffset.ApplyCharacterOffsets();
                    }

                    if (HS2_BetterHScenes.useOneOffsetForAllMotions.Value == false && GUILayout.Button("Save This"))
                    {
                        SavePosition(false);
                    }

                    if (GUILayout.Button(HS2_BetterHScenes.useUniqueOffsetForWeak.Value && HS2_BetterHScenes.currentMotion.StartsWith("D_") ? "Save Weak" : "Save Default"))
                    {
                        SavePosition(true);
                    }

                    if (GUILayout.Button("Delete All"))
                    {
                        HS2_BetterHScenes.activeConfirmDeleteUI = true;
                    }
                }
            }

            GUI.DragWindow();
        }
        //-- Apply chara offsets --//
        //-- Auto finish, togle chara draggers UI --//
        private void Update()
        {
            if (hScene == null)
            {
                return;
            }

            if (showDraggerUI.Value.IsDown())
            {
                activeDraggerUI = !activeDraggerUI;
            }

            if (showAnimationUI.Value.IsDown())
            {
                activeAnimationUI = !activeAnimationUI;
            }

            if (shouldApplyOffsets && !hScene.NowChangeAnim)
            {
                HSceneOffset.ApplyCharacterOffsets();
                SliderUI.UpdateDependentStatus();
                FixMotionList(hScene.ctrlFlag.nowAnimationInfo.fileFemale);
                FixEffectors();
                shouldApplyOffsets = false;
            }

            if (autoFinish.Value == Tools.AutoFinish.Off)
            {
                return;
            }

            if (hFlagCtrl.feel_m >= 0.98f && Tools.IsService() && autoFinish.Value != Tools.AutoFinish.InsertOnly)
            {
                // same mode as OnBody only for some reason
                var drink = hSprite.IsFinishVisible(1) && Tools.modeCtrl != 0 && !(!hSprite.IsFinishVisible(4) && hSprite.IsFinishVisible(1) && Tools.modeCtrl == 1);
                var vomit = hSprite.IsFinishVisible(3);
                // same mode as drink for some reason
                var onbody = hSprite.IsFinishVisible(4) || (hSprite.IsFinishVisible(1) && (Tools.modeCtrl == 0 || Tools.modeCtrl == 1));

                switch (autoServicePrefer.Value)
                {
                case Tools.AutoServicePrefer.Drink when drink:
                    hFlagCtrl.click = HSceneFlagCtrl.ClickKind.FinishDrink;
                    break;

                case Tools.AutoServicePrefer.Spit when vomit:
                    hFlagCtrl.click = HSceneFlagCtrl.ClickKind.FinishVomit;
                    break;

                case Tools.AutoServicePrefer.Outside when onbody:
                    hFlagCtrl.click = HSceneFlagCtrl.ClickKind.FinishOutSide;
                    break;

                case Tools.AutoServicePrefer.Random:
                    var random = new List <HSceneFlagCtrl.ClickKind>();
                    if (drink)
                    {
                        random.Add(HSceneFlagCtrl.ClickKind.FinishDrink);
                    }
                    if (vomit)
                    {
                        random.Add(HSceneFlagCtrl.ClickKind.FinishVomit);
                    }
                    if (onbody)
                    {
                        random.Add(HSceneFlagCtrl.ClickKind.FinishOutSide);
                    }

                    if (random.Count < 1)
                    {
                        break;
                    }

                    hFlagCtrl.click = random[rand.Next(random.Count)];
                    break;
                }
            }
            else if (hFlagCtrl.feel_f >= 0.98f && hFlagCtrl.feel_m >= 0.98f && Tools.IsInsert() && autoFinish.Value != Tools.AutoFinish.ServiceOnly)
            {
                var inside  = hSprite.IsFinishVisible(1);
                var outside = hSprite.IsFinishVisible(5);
                var same    = hSprite.IsFinishVisible(2);

                switch (autoInsertPrefer.Value)
                {
                case Tools.AutoInsertPrefer.Inside when inside:
                    hFlagCtrl.click = HSceneFlagCtrl.ClickKind.FinishInSide;
                    break;

                case Tools.AutoInsertPrefer.Outside when outside:
                    hFlagCtrl.click = HSceneFlagCtrl.ClickKind.FinishOutSide;
                    break;

                case Tools.AutoInsertPrefer.Same when same:
                    hFlagCtrl.click = HSceneFlagCtrl.ClickKind.FinishSame;
                    break;

                case Tools.AutoInsertPrefer.Random:
                    var random = new List <HSceneFlagCtrl.ClickKind>();
                    if (inside)
                    {
                        random.Add(HSceneFlagCtrl.ClickKind.FinishInSide);
                    }
                    if (outside)
                    {
                        random.Add(HSceneFlagCtrl.ClickKind.FinishOutSide);
                    }
                    if (same)
                    {
                        random.Add(HSceneFlagCtrl.ClickKind.FinishSame);
                    }

                    if (random.Count < 1)
                    {
                        break;
                    }

                    hFlagCtrl.click = random[rand.Next(random.Count)];
                    break;
                }
            }
        }
Exemple #3
0
        private static void DrawWindow(int id)
        {
            GUIStyle lineStyle = new GUIStyle("box");

            lineStyle.border.top  = lineStyle.border.bottom = 1;
            lineStyle.margin.top  = lineStyle.margin.bottom = 1;
            lineStyle.padding.top = lineStyle.padding.bottom = 1;

            GUIStyle gridStyle = new GUIStyle("Button");

            gridStyle.onNormal.background = Texture2D.whiteTexture;
            gridStyle.onNormal.textColor  = Color.black;
            gridStyle.onHover.background  = Texture2D.whiteTexture;
            gridStyle.onHover.textColor   = Color.black;
            gridStyle.onActive.background = Texture2D.whiteTexture;
            gridStyle.onActive.textColor  = Color.black;

            string[] characterNames = new string[HS2_BetterHScenes.characters.Count];
            string[] offsetNames    = new string[] { "Whole Body", "Left Hand", "Right Hand", "Left Foot", "Right Foot" };
            for (var charIndex = 0; charIndex < HS2_BetterHScenes.characters.Count; charIndex++)
            {
                characterNames[charIndex] = HS2_BetterHScenes.characters[charIndex].fileParam.fullname;
            }

            using (GUILayout.VerticalScope guiVerticalScope = new GUILayout.VerticalScope("box"))
            {
                selectedCharacter = GUILayout.SelectionGrid(selectedCharacter, characterNames, HS2_BetterHScenes.characters.Count, gridStyle, GUILayout.Height(30));
                GUILayout.Box(GUIContent.none, lineStyle, GUILayout.ExpandWidth(true), GUILayout.Height(1f));
                selectedOffset = GUILayout.SelectionGrid(selectedOffset, offsetNames, offsetNames.Length, gridStyle, GUILayout.Height(30));
                using (GUILayout.HorizontalScope linkScope = new GUILayout.HorizontalScope("box"))
                {
                    GUILayout.Space((uiWidth / 5) - 10);
                    if (GUILayout.Button("Mirror Active Limb"))
                    {
                        MirrorActiveLimb();
                    }
                }

                GUILayout.Box(GUIContent.none, lineStyle, GUILayout.ExpandWidth(true), GUILayout.Height(1f));

                float sliderMaxRotation = HS2_BetterHScenes.sliderMaxRotation.Value;
                float sliderMaxPosition = HS2_BetterHScenes.sliderMaxPosition.Value;
                if (selectedOffset != 0)
                {
                    sliderMaxRotation *= 2;
                    sliderMaxPosition /= 2;
                }

                Vector3 lastPosition = new Vector3(0, 0, 0);
                Vector3 lastRotation = new Vector3(0, 0, 0);
                if (selectedOffset == (int)BodyPart.WholeBody)
                {
                    lastPosition = new Vector3(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x, characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y, characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z);
                    lastRotation = new Vector3(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x, characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y, characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z);
                }

                using (GUILayout.HorizontalScope positionScope = new GUILayout.HorizontalScope("box"))
                {
                    using (GUILayout.VerticalScope verticalScopeX = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeX = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Position X");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.x, -sliderMaxPosition, sliderMaxPosition);
                    }

                    using (GUILayout.VerticalScope verticalScopeY = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeY = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Position Y");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.y, -sliderMaxPosition, sliderMaxPosition);
                    }

                    using (GUILayout.VerticalScope verticalScopeZ = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeZ = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Position Z");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position.z, -sliderMaxPosition, sliderMaxPosition);
                    }
                }

                using (GUILayout.HorizontalScope rotationScope = new GUILayout.HorizontalScope("box"))
                {
                    using (GUILayout.VerticalScope verticalScopeX = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeX = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Rotation X");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.x, -sliderMaxRotation, sliderMaxRotation);
                    }

                    using (GUILayout.VerticalScope verticalScopeY = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeY = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Rotation Y");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.y, -sliderMaxRotation, sliderMaxRotation);
                    }

                    using (GUILayout.VerticalScope verticalScopeZ = new GUILayout.VerticalScope("box"))
                    {
                        using (GUILayout.HorizontalScope horizontalScopeZ = new GUILayout.HorizontalScope())
                        {
                            GUILayout.Label("Rotation Z");

                            if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                            {
                                characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z = 0;
                            }
                        }
                        characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation.z, -sliderMaxRotation, sliderMaxRotation);
                    }
                }

                if (selectedOffset != (int)BodyPart.WholeBody)
                {
                    using (GUILayout.HorizontalScope rotationScope = new GUILayout.HorizontalScope("box"))
                    {
                        using (GUILayout.VerticalScope verticalScopeX = new GUILayout.VerticalScope("box"))
                        {
                            using (GUILayout.HorizontalScope horizontalScopeX = new GUILayout.HorizontalScope())
                            {
                                GUILayout.Label("Hint X");

                                if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                                {
                                    characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.x = 0;
                                }
                            }
                            characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.x = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.x, -sliderMaxPosition, sliderMaxPosition);
                        }

                        using (GUILayout.VerticalScope verticalScopeY = new GUILayout.VerticalScope("box"))
                        {
                            using (GUILayout.HorizontalScope horizontalScopeY = new GUILayout.HorizontalScope())
                            {
                                GUILayout.Label("Hint Y");

                                if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                                {
                                    characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.y = 0;
                                }
                            }
                            characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.y = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.y, -sliderMaxPosition, sliderMaxPosition);
                        }

                        using (GUILayout.VerticalScope verticalScopeZ = new GUILayout.VerticalScope("box"))
                        {
                            using (GUILayout.HorizontalScope horizontalScopeZ = new GUILayout.HorizontalScope())
                            {
                                GUILayout.Label("Hint Z");

                                if (GUILayout.Button("Reset", GUILayout.MaxWidth(uiWidth / 12)))
                                {
                                    characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.z = 0;
                                }
                            }
                            characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.z = GUILayout.HorizontalSlider(characterOffsets[selectedCharacter].offsetVectors[selectedOffset].hintPosition.z, -sliderMaxPosition, sliderMaxPosition);
                        }
                    }
                }
                else
                {
                    if (lastPosition != characterOffsets[selectedCharacter].offsetVectors[selectedOffset].position || lastRotation != characterOffsets[selectedCharacter].offsetVectors[selectedOffset].rotation)
                    {
                        ApplyPositions();
                    }
                }

                using (GUILayout.HorizontalScope controlScope = new GUILayout.HorizontalScope("box"))
                {
                    if (GUILayout.Button("Copy"))
                    {
                        CopyPositions();
                    }

                    if (GUILayout.Button("Paste"))
                    {
                        PastePositions();
                    }

                    if (GUILayout.Button("Reset All"))
                    {
                        ResetPositions();
                    }

                    if (GUILayout.Button("Reload"))
                    {
                        HSceneOffset.ApplyCharacterOffsets();
                    }

                    if (GUILayout.Button("Save This"))
                    {
                        SavePosition(HS2_BetterHScenes.useOneOffsetForAllMotions.Value);
                    }

                    if (HS2_BetterHScenes.useOneOffsetForAllMotions.Value == false && GUILayout.Button("Save Default"))
                    {
                        SavePosition(true);
                    }
                }
            }

            GUI.DragWindow();
        }