void LoadSettings(Maid maid)
        {
            if (maid == null)
            {
                return;
            }

            bool   autoCam       = ExSaveData.GetBool(maid, PluginName, "AutoCameraInitialValue", true);
            bool   eyeToCam      = ExSaveData.GetBool(maid, PluginName, "EyeToCameraInitialValue", true);
            string clothMaskMode = ExSaveData.Get(maid, PluginName, "ClothMaskMode", "");
            string bgName        = ExSaveData.Get(maid, PluginName, "BgName", "");
            string poseScript    = ExSaveData.Get(maid, PluginName, "Pose.Script", "");
            string poseLabel     = ExSaveData.Get(maid, PluginName, "Pose.Label", "");

            DebugWriteLine(
                "PersonalizedEditSceneSettings.LoadSettings : name={0}{1}, autoCam={2}, eyeToCam={3}, cloth={4}, bg={5}, pose={6}.{7}",
                maid.Param.status.last_name, maid.Param.status.first_name,
                autoCam, eyeToCam, clothMaskMode, bgName, poseScript, poseLabel);

            editViewReset.SetVisibleAutoCam(autoCam);
            editViewReset.SetVisibleEyeToCam(eyeToCam);
            sceneEdit.ClothesState(Helper.ToEnum <SceneEditInfo.ClothesState>(clothMaskMode, SceneEditInfo.ClothesState.Wear));

            SceneEdit.PVBInfo bgPvbInfo = sceneEdit.m_listBg.FirstOrDefault((i) =>
            {
                var bgInfo = i as SceneEdit.BGInfo;
                if (bgInfo == null)
                {
                    return(false);
                }
                return(bgInfo.strBGFileName == bgName);
            });
            if (bgPvbInfo != null)
            {
                sceneEdit.Bg(bgPvbInfo);
            }

            SceneEdit.PVBInfo posePvbInfo = sceneEdit.m_listPose.FirstOrDefault((i) =>
            {
                var poseInfo = i as SceneEdit.PoseInfo;
                if (poseInfo == null)
                {
                    return(false);
                }
                return(poseInfo.strScriptFileName == poseScript &&
                       poseInfo.strScriptLabelName == poseLabel);
            });

            if (posePvbInfo != null)
            {
                sceneEdit.Pose(posePvbInfo);
                lastPoseScript = poseScript;
                lastPoseLabel  = poseLabel;
            }

            LoadCameraSettings(maid);
        }
示例#2
0
        void LoadSettings(Maid maid)
        {
            if (maid == null)
            {
                return;
            }

            bool   autoCam       = ExSaveData.GetBool(maid, PluginName, "AutoCameraInitialValue", true);
            bool   eyeToCam      = ExSaveData.GetBool(maid, PluginName, "EyeToCameraInitialValue", true);
            string clothMaskMode = ExSaveData.Get(maid, PluginName, "ClothMaskMode", "");
            string bgName        = ExSaveData.Get(maid, PluginName, "BgName", "");
            string poseName      = ExSaveData.Get(maid, PluginName, "PoseName", "");

#if DEBUG
            Console.WriteLine(
                "PersonalizedEditSceneSettings.LoadSettings : name={0}{1}, autoCam={2}, eyeToCam={3}, cloth={4}, bg={5}, pose={6}",
                maid.Param.status.last_name, maid.Param.status.first_name,
                autoCam, eyeToCam, clothMaskMode, bgName, poseName);
#endif

            editViewReset.SetVisibleAutoCam(autoCam);
            editViewReset.SetVisibleEyeToCam(eyeToCam);
            sceneEdit.ClothesState(Helper.ToEnum <SceneEditInfo.ClothesState>(clothMaskMode, SceneEditInfo.ClothesState.Wear));

            SceneEdit.PVBInfo bgPvbInfo = sceneEdit.m_listBg.FirstOrDefault(i => i.info.strFileName == bgName);
            if (bgPvbInfo != null)
            {
                sceneEdit.Bg(bgPvbInfo);
            }

            SceneEdit.PVBInfo[] poses       = sceneEdit.m_dicPose[maid.Param.status.personal];
            SceneEdit.PVBInfo   posePvbInfo = poses.FirstOrDefault(i => i.info.strFileName + ".anm" == poseName);
            if (posePvbInfo != null)
            {
                sceneEdit.Pose(posePvbInfo);
            }

            LoadCameraSettings(maid);
        }