Beispiel #1
0
        protected override void OnReload(GameMode currentGameMode)
        {
#if DEBUG
            BreastPhysicsController.Logger.LogDebug("Call OnReload");
#endif
            if (ChaControl.sex == 1 && HaveDynamicbone()) //Female and HighPoly
            {
                //Restore params from backup.
                if (paramBackup != null)
                {
                    if (paramBackup.backupedBust || paramBackup.backupedHip)
                    {
                        if (paramBackup.backupedBust)
                        {
                            paramBackup.RestoreBust(ChaControl);
                        }
                        if (paramBackup.backupedHip)
                        {
                            paramBackup.RestoreHip(ChaControl);
                        }
                        ChaControl?.ReSetupDynamicBoneBust();
                    }
                }

                //Initialize fields
                Init();
            }
            else //Male or LowPoly
            {
                paramCustom = null;
                paramBackup = null;
            }
        }
 public static bool LoadExtendedData(out ParamChara paramChara, string path)
 {
     try
     {
         using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
         {
             byte[] bytes = new byte[fs.Length];
             fs.Read(bytes, 0, (int)fs.Length);
             paramChara = LZ4MessagePackSerializer.Deserialize <ParamChara>(bytes);
             return(true);
         }
     }
     catch (System.IO.IsolatedStorage.IsolatedStorageException e)
     {
         BreastPhysicsController.Logger.LogWarning("Not found default parameter file.");
         paramChara = null;
         return(false);
     }
     catch (IOException e)
     {
         BreastPhysicsController.Logger.LogWarning("Failed opening default parameter file.\r\n");
         paramChara = null;
         return(false);
     }
 }
Beispiel #3
0
 public bool SaveDefaultStatus()
 {
     if (ExtendedDataIO.SaveParamChara(this, PluginPath.defaultParamPath))
     {
         defaultParam = paramCustom.Clone();
         return(true);
     }
     return(false);
 }
Beispiel #4
0
 private void Init()
 {
     controllerID = this.GetInstanceID();
     DBControllerManager.AddController(this);
     paramCustom = new ParamChara();
     paramBackup = new ParamBackup();
     Enabled     = false;
     changedControllerEnabled = false;
     changedInfo = new ParamChangedInfo();
     endInitLoad = false;
 }
        public ParamChara Clone()
        {
            ParamChara result = new ParamChara();

            result.paramBustNaked = paramBustNaked.Clone();
            foreach (ChaFileDefine.CoordinateType coordinate in paramBust.Keys)
            {
                foreach (ParamCharaController.ParamsKind state in paramBust[coordinate].Keys)
                {
                    result.paramBust[coordinate][state] = paramBust[coordinate][state].Clone();
                }
            }
            result.paramHip = paramHip.Clone();
            return(result);
        }
Beispiel #6
0
        public bool LoadDefaultStatus(bool forceControllerEnabled)
        {
            if (defaultParam == null)
            {
                if (!ExtendedDataIO.LoadExtendedData(out defaultParam, PluginPath.defaultParamPath))
                {
                    return(false);
                }
            }
            paramCustom = defaultParam.Clone();
            if (forceControllerEnabled)
            {
                Enabled = true;
            }
            changedInfo.SetInfo(ChaFileDefine.CoordinateType.School01,
                                ParamsKind.Naked, true, true, true);


            return(true);
        }