Ejemplo n.º 1
0
        private void SetPage(int _page)
        {
            StudioNode studioNode = (StudioNode)null;

            if (this.dicPage.TryGetValue(SceneLoadScene.page, out studioNode))
            {
                studioNode.select = false;
            }
            _page = Mathf.Clamp(_page, 0, this.pageNum - 1);
            int num = 12 * _page;

            for (int index = 0; index < 12; ++index)
            {
                int n = num + index;
                if (!MathfEx.RangeEqualOn <int>(0, n, this.thumbnailNum - 1))
                {
                    this.buttonThumbnail[index].interactable = false;
                }
                else
                {
                    this.buttonThumbnail[index].texture      = (Texture)PngAssist.LoadTexture(this.listPath[n]);
                    this.buttonThumbnail[index].interactable = true;
                }
            }
            SceneLoadScene.page = _page;
            if (this.dicPage.TryGetValue(SceneLoadScene.page, out studioNode))
            {
                studioNode.select = true;
            }
            Resources.UnloadUnusedAssets();
            GC.Collect();
        }
        internal static void MakerSettingChangePreview(ChaControl chaCtrl, AccTriggerInfo Part)
        {
            AccStateSyncController pluginCtrl = GetController(chaCtrl);

            if (MathfEx.RangeEqualOn(0, Part.Kind, 7))
            {
                int  state = chaCtrl.fileStatus.clothesState[Part.Kind];
                bool vis   = Part.State[state];
                Part.Group = "";
                chaCtrl.SetAccessoryState(Part.Slot, vis);
            }
            else if (Part.Kind >= 9)
            {
                if (Part.Kind == 9)
                {
                    List <ChaFileAccessory.PartsInfo> PartsInfo = MoreAccessories_Support.GetAccessoriesInfos(chaCtrl);
                    Part.Group = PartsInfo[Part.Slot].parentKey;
                }
                else
                {
                    Part.Group = "custom_" + (Part.Kind - 9).ToString();
                }

                bool vis = true;
                if (pluginCtrl.VirtualGroupStates.ContainsKey(Part.Group))
                {
                    vis = pluginCtrl.VirtualGroupStates[Part.Group] ? Part.State[0] : Part.State[3];
                }
                chaCtrl.SetAccessoryState(Part.Slot, vis);
            }
        }
Ejemplo n.º 3
0
 public void SetColor(Color _color, int _idx)
 {
     if (MathfEx.RangeEqualOn <int>(0, _idx, 3))
     {
         this.itemInfo.colors[_idx].mainColor = _color;
     }
     this.UpdateColor();
 }
Ejemplo n.º 4
0
 public void SetGlossiness(int _idx, float _value)
 {
     if (MathfEx.RangeEqualOn <int>(0, _idx, 3))
     {
         this.itemInfo.colors[_idx].glossiness = _value;
     }
     this.UpdateColor();
 }
Ejemplo n.º 5
0
 public void SetMetallic(int _idx, float _value)
 {
     if (MathfEx.RangeEqualOn <int>(0, _idx, 3))
     {
         this.itemInfo.colors[_idx].metallic = _value;
     }
     this.UpdateColor();
 }
Ejemplo n.º 6
0
            internal void SetReferralIndex(int _index)
            {
                DebugMsg(LogLevel.Warning, $"[SetReferralIndex][{ChaControl.GetFullname()}][_index: {_index}]");

                if (ReferralIndex != _index)
                {
                    ReferralIndex = MathfEx.RangeEqualOn(0, _index, RefMax) ? _index : RefMax;
                }
            }
Ejemplo n.º 7
0
 private void OnClickSelect(VoicePlayNode _vpn)
 {
     if (MathfEx.RangeEqualOn <int>(0, this.select, this.listNode.Count))
     {
         this.listNode[this.select].select = false;
     }
     this.select = this.listNode.FindIndex((Predicate <VoicePlayNode>)(v => Object.op_Equality((Object)v, (Object)_vpn)));
     this.listNode[this.select].select = true;
 }
Ejemplo n.º 8
0
 public int CheckNewIndex()
 {
     for (int n = -1; MathfEx.RangeEqualOn <int>(0, n, int.MaxValue); ++n)
     {
         if (!this.hashIndex.Contains(n))
         {
             return(n);
         }
     }
     return(-1);
 }
Ejemplo n.º 9
0
 public void SetOptionVisible(int _idx, bool _visible)
 {
     if (MathfEx.RangeEqualOn <int>(0, _idx, this.itemInfo.option.Count - 1))
     {
         this.itemInfo.option[_idx] = _visible;
     }
     if (this.itemComponent == null)
     {
         return;
     }
     this.itemComponent.SetOptionVisible(_idx, _visible);
 }
Ejemplo n.º 10
0
 public int GetNewIndex()
 {
     for (int n = 0; MathfEx.RangeEqualOn <int>(0, n, int.MaxValue); ++n)
     {
         if (!this.hashIndex.Contains(n))
         {
             this.hashIndex.Add(n);
             return(n);
         }
     }
     return(-1);
 }
Ejemplo n.º 11
0
            public static void Migrate(int _coordinate, OutfitTriggerInfo _outfitTriggerInfo, Dictionary <string, VirtualGroupInfo> _outfitVirtualGroupInfo, ref List <TriggerProperty> _outputTriggerProperty, ref List <TriggerGroup> _outputTriggerGroup)
            {
                if (_outfitTriggerInfo == null)
                {
                    return;
                }
                if (_outfitVirtualGroupInfo == null)
                {
                    _outfitVirtualGroupInfo = new Dictionary <string, VirtualGroupInfo>();
                }

                Dictionary <string, int> _mapping = new Dictionary <string, int>();
                int _refBase = 9;

                List <AccTriggerInfo> _parts = _outfitTriggerInfo.Parts.Values.OrderBy(x => x.Kind).ThenBy(x => x.Group).ThenBy(x => x.Slot).ToList();

                foreach (AccTriggerInfo _part in _parts)
                {
                    if (MathfEx.RangeEqualOn(0, _part.Kind, 8))
                    {
                        for (int i = 0; i < 4; i++)
                        {
                            _outputTriggerProperty.Add(new TriggerProperty(_coordinate, _part.Slot, _part.Kind, i, _part.State[i], 0));
                        }
                    }
                    else if (_part.Kind >= 9)
                    {
                        if (!_mapping.ContainsKey(_part.Group))
                        {
                            _mapping[_part.Group] = _refBase;
                            _refBase++;
                        }

                        _outputTriggerProperty.Add(new TriggerProperty(_coordinate, _part.Slot, _mapping[_part.Group], 0, _part.State[0], 0));
                        _outputTriggerProperty.Add(new TriggerProperty(_coordinate, _part.Slot, _mapping[_part.Group], 1, _part.State[3], 0));
                    }
                }

                foreach (KeyValuePair <string, int> x in _mapping)
                {
                    if (!_outfitVirtualGroupInfo.ContainsKey(x.Key))
                    {
                        string _label = _accessoryParentNames.ContainsKey(x.Key) ? _accessoryParentNames[x.Key] : x.Key;
                        _outputTriggerGroup.Add(new TriggerGroup(_coordinate, x.Value, _label));
                    }
                    else
                    {
                        VirtualGroupInfo _group = _outfitVirtualGroupInfo[x.Key];
                        _outputTriggerGroup.Add(new TriggerGroup(_coordinate, x.Value, _group.Label, (_group.State ? 0 : 1), 0, (_group.Secondary ? 1 : -1)));
                    }
                }
            }
Ejemplo n.º 12
0
 public bool this[int _idx]
 {
     get
     {
         return(this._enable.SafeGet <bool>(_idx));
     }
     set
     {
         if (!MathfEx.RangeEqualOn <int>(0, _idx, this._enable.Length - 1))
         {
             return;
         }
         this._enable[_idx] = value;
     }
 }
Ejemplo n.º 13
0
 // Token: 0x060032D5 RID: 13013 RVA: 0x0012C8D4 File Offset: 0x0012ACD4
 public static string GetBloodTypeStr(int bloodType)
 {
     string[] array = new string[]
     {
         "A型",
         "B型",
         "O型",
         "AB型"
     };
     if (MathfEx.RangeEqualOn <int>(0, bloodType, array.Length - 1))
     {
         return(array[bloodType]);
     }
     return("不明");
 }
            internal void ToggleByClothesState(ChaControl chaCtrl, int kind, int state)
            {
                if (TriggerEnabled)
                {
                    if (!MathfEx.RangeEqualOn(0, kind, 7))
                    {
                        return;
                    }

                    List <AccTriggerInfo> Parts = CurOutfitTriggerInfo.Parts.Where(x => x.Kind == kind).ToList();
                    foreach (AccTriggerInfo Part in Parts)
                    {
                        chaCtrl.SetAccessoryState(Part.Slot, Part.State[state]);
                    }
                }
            }
Ejemplo n.º 15
0
        private void SetPage(int _page, bool _force = false)
        {
            if (!_force && this.page == _page)
            {
                return;
            }
            _page = Mathf.Clamp(_page, 0, this.pageNum - 1);
            int num = this.thumbnailLimit * _page;

            for (int index = 0; index < this.thumbnailLimit; ++index)
            {
                int n = num + index;
                if (!MathfEx.RangeEqualOn <int>(0, n, this.thumbnailNum - 1))
                {
                    if (_page == 0 && index == 0)
                    {
                        this.rawsThumbnail[index].set_texture(this.textureNoData);
                        ((Behaviour)this.rawsThumbnail[index]).set_enabled(true);
                    }
                    else
                    {
                        ((Behaviour)this.rawsThumbnail[index]).set_enabled(false);
                    }
                    ((Behaviour)this.buttonsThumbnail[index]).set_enabled(false);
                }
                else
                {
                    this.rawsThumbnail[index].set_texture((Texture)PngAssist.LoadTexture(this.listPath[n]));
                    ((Behaviour)this.rawsThumbnail[index]).set_enabled(true);
                    ((Behaviour)this.buttonsThumbnail[index]).set_enabled(true);
                    ((Selectable)this.buttonsThumbnail[index]).set_interactable(true);
                }
            }
            this.page = _page;
            if (_force && this.view.ItemList.FirstOrDefault <LoopListViewItem2>((Func <LoopListViewItem2, bool>)(_v => _v.ItemIndex == _page)) is PageButton pageButton)
            {
                pageButton.Select();
            }
            Resources.UnloadUnusedAssets();
            GC.Collect();
        }
Ejemplo n.º 16
0
        public bool Play(int _idx)
        {
            if (!Singleton <Info> .IsInstance() || this.list.Count == 0)
            {
                return(false);
            }
            if (!MathfEx.RangeEqualOn <int>(0, _idx, this.list.Count - 1))
            {
                this.index = -1;
                return(false);
            }
            this.Stop();
            VoiceCtrl.VoiceInfo voiceInfo = this.list[_idx];
            Info.LoadCommonInfo loadInfo  = this.GetLoadInfo(voiceInfo.group, voiceInfo.category, voiceInfo.no);
            if (loadInfo == null)
            {
                return(false);
            }
            Manager.Voice instance        = Singleton <Manager.Voice> .Instance;
            int           personality     = this.personality;
            string        bundlePath      = loadInfo.bundlePath;
            string        fileName        = loadInfo.fileName;
            float         pitch           = this.pitch;
            Transform     transHead       = this.transHead;
            int           no              = personality;
            string        assetBundleName = bundlePath;
            string        assetName       = fileName;
            double        num             = (double)pitch;
            Transform     voiceTrans      = transHead;

            this.transVoice = instance.Play(no, assetBundleName, assetName, (float)num, 0.0f, 0.0f, true, voiceTrans, Manager.Voice.Type.PCM, -1, true, true, false);
            if (Object.op_Equality((Object)this.transVoice, (Object)null))
            {
                return(false);
            }
            this.index                      = _idx;
            this.voiceEndChecker            = (VoiceEndChecker)((Component)this.transVoice).get_gameObject().AddComponent <VoiceEndChecker>();
            this.voiceEndChecker.onEndFunc += new VoiceEndChecker.OnEndFunc(this.NextVoicePlay);
            this.ociChar.SetVoice();
            return(true);
        }
Ejemplo n.º 17
0
        public bool LoadScenario(string assetbundle, string file)
        {
            this._scenarioTableList.Clear();
            this._currentLine = -1;
            ExcelData excelData = AssetUtility.LoadAsset <ExcelData>(assetbundle, file, string.Empty);

            if (Object.op_Equality((Object)excelData, (Object)null))
            {
                Debug.LogError((object)string.Format("読み込みエラー: 要チェック{{[{0}][{1}]}}", (object)assetbundle, (object)file));
                return(false);
            }
            int maxCell = excelData.MaxCell;

            for (int index = 0; index < maxCell; ++index)
            {
                ExcelData.Param obj = excelData.list[index];
                if (obj.list.Count != 0)
                {
                    string str = obj.list[0];
                    if (str.Length != 0 && MathfEx.RangeEqualOn <int>(0, str.IndexOf("@"), 1))
                    {
                        string         key = obj.list[0].Replace("'@", string.Empty).Replace("@", string.Empty);
                        IScriptCommand scriptCommand;
                        if (!this.ActorCommandTable.TryGetValue(key, out scriptCommand))
                        {
                            Debug.LogWarning((object)string.Format("未実装のコマンド: {0}", (object)key));
                        }
                        else if (scriptCommand.IsBefore)
                        {
                            scriptCommand.Execute(scriptCommand.Analysis(obj.list), -1);
                        }
                        else
                        {
                            this._scenarioTableList.Add(scriptCommand.Analysis(obj.list));
                        }
                    }
                }
            }
            this._currentLine = -1;
            return(this._scenarioTableList.Count != 0);
        }
Ejemplo n.º 18
0
        private void SetPage(int _page, bool _force = false)
        {
            if (!_force && this.page == _page)
            {
                return;
            }
            _page = Mathf.Clamp(_page, 0, this.pageNum - 1);
            int num = this.thumbnailLimit * _page;

            for (int index = 0; index < this.thumbnailLimit; ++index)
            {
                int n = num + index;
                if (!MathfEx.RangeEqualOn <int>(0, n, this.thumbnailNum - 1))
                {
                    if (_page == 0 && index == 0)
                    {
                        this.rawsThumbnail[index].set_texture(this.textureNoData);
                        ((Behaviour)this.rawsThumbnail[index]).set_enabled(true);
                    }
                    else
                    {
                        ((Behaviour)this.rawsThumbnail[index]).set_enabled(false);
                    }
                    ((Behaviour)this.buttonsThumbnail[index]).set_enabled(false);
                }
                else
                {
                    this.rawsThumbnail[index].set_texture((Texture)PngAssist.LoadTexture(this.listPath[n]));
                    ((Behaviour)this.rawsThumbnail[index]).set_enabled(true);
                    ((Behaviour)this.buttonsThumbnail[index]).set_enabled(true);
                    ((Selectable)this.buttonsThumbnail[index]).set_interactable(true);
                }
            }
            this.page = _page;
            this.UpdateSelectImage();
            Resources.UnloadUnusedAssets();
            GC.Collect();
        }
            internal void SyncAllAccToggle()
            {
                Logger.Log(DebugLogLevel, $"[SyncAllAccToggle][{ChaControl.chaFile.parameter?.fullname}] Fired!!");

                if ((MakerAPI.InsideMaker) && (!CharaMakerPreview.Value))
                {
#if DEBUG
                    Logger.LogInfo($"[SyncAllAccToggle][{ChaControl.chaFile.parameter?.fullname}] Disabled by config");
#endif
                    return;
                }
                if (!TriggerEnabled)
                {
                    Logger.Log(DebugLogLevel, $"[SyncAllAccToggle][{ChaControl.chaFile.parameter?.fullname}] TriggerEnabled false");
                    return;
                }

                foreach (AccTriggerInfo Part in CurOutfitTriggerInfo.Parts)
                {
                    if (MathfEx.RangeEqualOn(0, Part.Kind, 7))
                    {
                        int  state = ChaControl.fileStatus.clothesState[Part.Kind];
                        bool vis   = Part.State[state];
                        Logger.Log(DebugLogLevel, $"[SyncAllAccToggle][{ChaControl.chaFile.parameter?.fullname}][slot: {Part.Slot}][kind: {Part.Kind}][state: {state}][vis: {vis}]");
                        ChaControl.SetAccessoryState(Part.Slot, vis);
                    }
                    else if ((Part.Kind >= 9) && (!Part.Group.IsNullOrEmpty()))
                    {
                        bool vis = true;
                        if (VirtualGroupStates.ContainsKey(Part.Group))
                        {
                            vis = VirtualGroupStates[Part.Group] ? Part.State[0] : Part.State[3];
                        }
                        ChaControl.SetAccessoryState(Part.Slot, vis);
                    }
                }
            }
 public static bool CheckPartsOfHead(string keyName)
 {
     ChaAccessoryDefine.AccessoryParentKey result;
     return(Enum.TryParse <ChaAccessoryDefine.AccessoryParentKey>(keyName, out result) && MathfEx.RangeEqualOn <int>(1, (int)result, 14));
 }
Ejemplo n.º 21
0
 // Token: 0x06008AAB RID: 35499 RVA: 0x0035DBF6 File Offset: 0x0035BFF6
 public static bool IsRange <T>(T min, T n, T max, bool isEqual) where T : IComparable
 {
     return((!isEqual) ? MathfEx.RangeEqualOff <T>(min, n, max) : MathfEx.RangeEqualOn <T>(min, n, max));
 }
Ejemplo n.º 22
0
            internal void ToggleByRefKind(int _refKind)
            {
                if (_duringLoadChange)
                {
                    return;
                }
                if (JetPack.CharaMaker.Loaded && !_cfgCharaMakerPreview.Value)
                {
                    return;
                }
                if (JetPack.CharaStudio.Loaded && !TriggerEnabled)
                {
                    return;
                }

                Dictionary <int, TriggerProperty> _effectingPropertList = new Dictionary <int, TriggerProperty>();

                Dictionary <int, int> _clothesStates = _ListClothesStates();

                HashSet <int> _filtered = new HashSet <int>(_cachedCoordinatePropertyList.Where(x => x.RefKind == _refKind).Select(x => x.Slot));

                if (ChaControl.notBot && (_refKind == 0 || _refKind == 1))
                {
                    _filtered = new HashSet <int>(_cachedCoordinatePropertyList.Where(x => (x.RefKind == 0 || x.RefKind == 1)).Select(x => x.Slot));
                }
                if (ChaControl.notShorts && (_refKind == 2 || _refKind == 3))
                {
                    _filtered = new HashSet <int>(_cachedCoordinatePropertyList.Where(x => (x.RefKind == 2 || x.RefKind == 3)).Select(x => x.Slot));
                }
                if (_refKind == 7 || _refKind == 8)
                {
                    _filtered = new HashSet <int>(_cachedCoordinatePropertyList.Where(x => (x.RefKind == 7 || x.RefKind == 8)).Select(x => x.Slot));
                }

                foreach (int _slot in _filtered)
                {
                    TriggerProperty        _effectingPropert = null;
                    List <TriggerProperty> _slotPropertyList = _cachedCoordinatePropertyList.Where(x => x.Slot == _slot).OrderByDescending(x => x.Priority).ThenBy(x => x.RefKind).ThenBy(x => x.RefState).ToList();
                    foreach (TriggerProperty x in _slotPropertyList)
                    {
                        DebugMsg(LogLevel.Info, $"[ToggleByRefKind][Slot: {x.Slot}][Priority: {x.Priority}][RefKind: {x.RefKind}][RefState: {x.RefState}][Visible: {x.Visible}]");

                        if (MathfEx.RangeEqualOn(0, x.RefKind, 8))
                        {
                            if (!_clothesStates.ContainsKey(x.RefKind))
                            {
                                continue;
                            }
                            if (_shoesType == 0 && x.RefKind == 8 && ChaControl.GetClothesStateKind(7) != null)
                            {
                                continue;
                            }
                            if (_shoesType == 1 && x.RefKind == 7 && ChaControl.GetClothesStateKind(8) != null)
                            {
                                continue;
                            }

                            if (_clothesStates[x.RefKind] == x.RefState)
                            {
                                _effectingPropert = x;
                                break;
                            }
                        }
                        else if (x.RefKind >= 9)
                        {
                            TriggerGroup _group = _cachedCoordinateGroupList.Where(y => y.Kind == x.RefKind).FirstOrDefault();
                            if (_group != null && _group.State == x.RefState)
                            {
                                _effectingPropert = x;
                                break;
                            }
                        }
                    }

                    if (_effectingPropert != null)
                    {
                        _effectingPropertList[_slot] = _effectingPropert;
                    }
                }

                foreach (TriggerProperty _trigger in _effectingPropertList.Values)
                {
                    ChaControl.SetAccessoryState(_trigger.Slot, _trigger.Visible);
                }
            }
Ejemplo n.º 23
0
        public static void InitHairBone(OCIChar _ociChar, Dictionary <int, Info.BoneInfo> _dicBoneInfo)
        {
            GameObject referenceInfo = _ociChar.charReference.GetReferenceInfo(ChaReference.RefObjKey.HeadParent);
            Dictionary <int, OCIChar.BoneInfo> dictionary = new Dictionary <int, OCIChar.BoneInfo>();

            foreach (KeyValuePair <int, Info.BoneInfo> keyValuePair in _dicBoneInfo.Where <KeyValuePair <int, Info.BoneInfo> >((Func <KeyValuePair <int, Info.BoneInfo>, bool>)(b => MathfEx.RangeEqualOn <int>(7, b.Value.group, 9))))
            {
                GameObject loop = referenceInfo.get_transform().FindLoop(keyValuePair.Value.bone);
                if (!Object.op_Equality((Object)loop, (Object)null))
                {
                    OCIChar.BoneInfo boneInfo1 = (OCIChar.BoneInfo)null;
                    if (dictionary.TryGetValue(keyValuePair.Value.sync, out boneInfo1))
                    {
                        boneInfo1.AddSyncBone(loop);
                    }
                    else
                    {
                        OIBoneInfo _boneInfo = (OIBoneInfo)null;
                        if (!_ociChar.oiCharInfo.bones.TryGetValue(keyValuePair.Key, out _boneInfo))
                        {
                            _boneInfo = new OIBoneInfo(Studio.Studio.GetNewIndex());
                            _ociChar.oiCharInfo.bones.Add(keyValuePair.Key, _boneInfo);
                        }
                        _boneInfo.group = OIBoneInfo.BoneGroup.Hair;
                        _boneInfo.level = keyValuePair.Value.level;
                        GuideObject      _guideObject = AddObjectAssist.AddBoneGuide(loop.get_transform(), _boneInfo.dicKey, _ociChar.guideObject, keyValuePair.Value.name);
                        OCIChar.BoneInfo boneInfo2    = new OCIChar.BoneInfo(_guideObject, _boneInfo, keyValuePair.Key);
                        _ociChar.listBones.Add(boneInfo2);
                        _guideObject.SetActive(false, true);
                        if (keyValuePair.Value.sync != -1)
                        {
                            dictionary.Add(keyValuePair.Key, boneInfo2);
                        }
                    }
                }
            }
            _ociChar.UpdateFKColor(OIBoneInfo.BoneGroup.Hair);
        }
Ejemplo n.º 24
0
        public static bool CheckDataRangeFace(ChaFile chafile, List <string> checkInfo = null)
        {
            ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
            ChaFileFace    face        = chafile.custom.face;
            byte           sex         = chafile.parameter.sex;
            bool           flag        = false;

            for (int index = 0; index < face.shapeValueFace.Length; ++index)
            {
                if (!MathfEx.RangeEqualOn <float>(0.0f, face.shapeValueFace[index], 1f))
                {
                    checkInfo?.Add(string.Format("【{0}】値:{1}", (object)ChaFileDefine.cf_headshapename[index], (object)face.shapeValueFace[index]));
                    flag = true;
                    face.shapeValueFace[index] = Mathf.Clamp(face.shapeValueFace[index], 0.0f, 1f);
                }
            }
            if (face.shapeValueFace.Length > ChaFileDefine.cf_headshapename.Length)
            {
                float[] numArray = new float[ChaFileDefine.cf_headshapename.Length];
                Array.Copy((Array)face.shapeValueFace, (Array)numArray, numArray.Length);
                face.shapeValueFace = new float[ChaFileDefine.cf_headshapename.Length];
                Array.Copy((Array)numArray, (Array)face.shapeValueFace, numArray.Length);
            }
            if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.fo_head : ChaListDefine.CategoryNo.mo_head).ContainsKey(face.headId))
            {
                checkInfo?.Add(string.Format("【頭の種類】値:{0}", (object)face.headId));
                flag        = true;
                face.headId = sex != (byte)0 ? 0 : 0;
            }
            if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_skin_f : ChaListDefine.CategoryNo.mt_skin_f).ContainsKey(face.skinId))
            {
                checkInfo?.Add(string.Format("【肌の種類】値:{0}", (object)face.skinId));
                flag        = true;
                face.skinId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_detail_f : ChaListDefine.CategoryNo.mt_detail_f).ContainsKey(face.detailId))
            {
                checkInfo?.Add(string.Format("【彫りの種類】値:{0}", (object)face.detailId));
                flag          = true;
                face.detailId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyebrow).ContainsKey(face.eyebrowId))
            {
                checkInfo?.Add(string.Format("【眉毛の種類】値:{0}", (object)face.eyebrowId));
                flag           = true;
                face.eyebrowId = 0;
            }
            for (int index = 0; index < 2; ++index)
            {
                if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eye).ContainsKey(face.pupil[index].pupilId))
                {
                    checkInfo?.Add(string.Format("【瞳の種類】値:{0}", (object)face.pupil[index].pupilId));
                    flag = true;
                    face.pupil[index].pupilId = 0;
                }
                if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyeblack).ContainsKey(face.pupil[index].blackId))
                {
                    checkInfo?.Add(string.Format("【黒目の種類】値:{0}", (object)face.pupil[index].blackId));
                    flag = true;
                    face.pupil[index].blackId = 0;
                }
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eye_hl).ContainsKey(face.hlId))
            {
                checkInfo?.Add(string.Format("【ハイライト種類】値:{0}", (object)face.hlId));
                flag      = true;
                face.hlId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyelash).ContainsKey(face.eyelashesId))
            {
                checkInfo?.Add(string.Format("【睫毛の種類】値:{0}", (object)face.eyelashesId));
                flag             = true;
                face.eyelashesId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_mole).ContainsKey(face.moleId))
            {
                checkInfo?.Add(string.Format("【ホクロの種類】値:{0}", (object)face.moleId));
                flag        = true;
                face.moleId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyeshadow).ContainsKey(face.makeup.eyeshadowId))
            {
                checkInfo?.Add(string.Format("【アイシャドウ種類】値:{0}", (object)face.makeup.eyeshadowId));
                flag = true;
                face.makeup.eyeshadowId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_cheek).ContainsKey(face.makeup.cheekId))
            {
                checkInfo?.Add(string.Format("【チークの種類】値:{0}", (object)face.makeup.cheekId));
                flag = true;
                face.makeup.cheekId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_lip).ContainsKey(face.makeup.lipId))
            {
                checkInfo?.Add(string.Format("【リップの種類】値:{0}", (object)face.makeup.lipId));
                flag = true;
                face.makeup.lipId = 0;
            }
            for (int index = 0; index < 2; ++index)
            {
                if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_paint).ContainsKey(face.makeup.paintInfo[index].id))
                {
                    checkInfo?.Add(string.Format("【ペイント種類】値:{0}", (object)face.makeup.paintInfo[index].id));
                    flag = true;
                    face.makeup.paintInfo[index].id = 0;
                }
            }
            if (sex == (byte)0 && !chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.mt_beard).ContainsKey(face.beardId))
            {
                checkInfo?.Add(string.Format("【ヒゲの種類】値:{0}", (object)face.beardId));
                flag         = true;
                face.beardId = 0;
            }
            return(flag);
        }
Ejemplo n.º 25
0
        public static bool CheckDataRangeBody(ChaFile chafile, List <string> checkInfo = null)
        {
            ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
            ChaFileBody    body        = chafile.custom.body;
            byte           sex         = chafile.parameter.sex;
            bool           flag        = false;

            for (int index = 0; index < body.shapeValueBody.Length; ++index)
            {
                if (!MathfEx.RangeEqualOn <float>(0.0f, body.shapeValueBody[index], 1f))
                {
                    checkInfo?.Add(string.Format("【{0}】値:{1}", (object)ChaFileDefine.cf_bodyshapename[index], (object)body.shapeValueBody[index]));
                    flag = true;
                    body.shapeValueBody[index] = Mathf.Clamp(body.shapeValueBody[index], 0.0f, 1f);
                }
            }
            if (!MathfEx.RangeEqualOn <float>(0.0f, body.bustSoftness, 1f))
            {
                checkInfo?.Add(string.Format("【胸の柔らかさ】値:{0}", (object)body.bustSoftness));
                flag = true;
                body.bustSoftness = Mathf.Clamp(body.bustSoftness, 0.0f, 1f);
            }
            if (!MathfEx.RangeEqualOn <float>(0.0f, body.bustWeight, 1f))
            {
                checkInfo?.Add(string.Format("【胸の重さ】値:{0}", (object)body.bustWeight));
                flag            = true;
                body.bustWeight = Mathf.Clamp(body.bustWeight, 0.0f, 1f);
            }
            if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_skin_b : ChaListDefine.CategoryNo.mt_skin_b).ContainsKey(body.skinId))
            {
                checkInfo?.Add(string.Format("【肌の種類】値:{0}", (object)body.skinId));
                flag        = true;
                body.skinId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_detail_b : ChaListDefine.CategoryNo.mt_detail_b).ContainsKey(body.detailId))
            {
                checkInfo?.Add(string.Format("【筋肉の種類】値:{0}", (object)body.detailId));
                flag          = true;
                body.detailId = 0;
            }
            if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_sunburn : ChaListDefine.CategoryNo.mt_sunburn).ContainsKey(body.sunburnId))
            {
                checkInfo?.Add(string.Format("【日焼けの種類】値:{0}", (object)body.sunburnId));
                flag           = true;
                body.sunburnId = 0;
            }
            for (int index = 0; index < 2; ++index)
            {
                if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_paint).ContainsKey(body.paintInfo[index].id))
                {
                    checkInfo?.Add(string.Format("【ペイントの種類】値:{0}", (object)body.paintInfo[index].id));
                    flag = true;
                    body.paintInfo[index].id = 0;
                }
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_nip).ContainsKey(body.nipId))
            {
                checkInfo?.Add(string.Format("【乳首の種類】値:{0}", (object)body.nipId));
                flag       = true;
                body.nipId = 0;
            }
            if (!MathfEx.RangeEqualOn <float>(0.0f, body.areolaSize, 1f))
            {
                checkInfo?.Add(string.Format("【乳輪のサイズ】値:{0}", (object)body.areolaSize));
                flag            = true;
                body.areolaSize = Mathf.Clamp(body.areolaSize, 0.0f, 1f);
            }
            if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_underhair).ContainsKey(body.underhairId))
            {
                checkInfo?.Add(string.Format("【アンダーヘア種類】値:{0}", (object)body.underhairId));
                flag             = true;
                body.underhairId = 0;
            }
            return(flag);
        }
            internal void SyncOutfitTriggerInfo(int CoordinateIndex)
            {
                if (!TriggerEnabled)
                {
                    Logger.Log(DebugLogLevel, $"[SyncOutfitTriggerInfo][{ChaControl.chaFile.parameter?.fullname}] TriggerEnabled false");
                    return;
                }

                List <ChaFileAccessory.PartsInfo> PartsInfo = MoreAccessories_Support.GetCoordinatePartsInfo(ChaControl, CoordinateIndex);
                OutfitTriggerInfo OutfitTriggerInfo         = CharaTriggerInfo.ElementAtOrDefault(CoordinateIndex);

                Logger.Log(DebugLogLevel, $"[SyncOutfitTriggerInfo][{ChaControl.chaFile.parameter?.fullname}]Process OutfitTriggerInfo for Coordinate {CoordinateIndex}");

                List <AccTriggerInfo> TriggerParts = OutfitTriggerInfo.Parts;
                int PartsInfoCount    = PartsInfo.Count();
                int TriggerPartsCount = TriggerParts.Count();

                Logger.Log(DebugLogLevel, $"[SyncOutfitTriggerInfo][{ChaControl.chaFile.parameter?.fullname}][{CoordinateIndex}] Count {TriggerPartsCount} : {PartsInfoCount}");

                if (TriggerPartsCount > PartsInfoCount)
                {
                    CharaTriggerInfo[CoordinateIndex].Parts = CharaTriggerInfo[CoordinateIndex].Parts.Take(PartsInfoCount).ToList();
                    Logger.LogWarning($"[SyncOutfitTriggerInfo][{ChaControl.chaFile.parameter?.fullname}] AccTriggerInfo for Coordinate {CoordinateIndex} Slot {TriggerPartsCount} -> {PartsInfoCount}");
                }
                else if (TriggerPartsCount < PartsInfoCount)
                {
                    for (int j = TriggerPartsCount; j < PartsInfoCount; j++)
                    {
                        CharaTriggerInfo[CoordinateIndex].Parts.Add(new AccTriggerInfo(j));
                    }
                    Logger.Log(DebugLogLevel, $"[SyncOutfitTriggerInfo][{ChaControl.chaFile.parameter?.fullname}] AccTriggerInfo for Coordinate {CoordinateIndex} Slot {TriggerPartsCount} -> {PartsInfoCount - 1}");
                }
                for (int i = 0; i < PartsInfoCount; i++)
                {
                    AccTriggerInfo TriggerPart = TriggerParts.ElementAtOrDefault(i);
                    if ((TriggerPart.Kind != -1) && (PartsInfo[i].type == 120))
                    {
                        CharaTriggerInfo[CoordinateIndex].Parts[i] = new AccTriggerInfo(i);
                        Logger.LogMessage($"AccTriggerInfo for Coordinate {CoordinateIndex} Slot {i + 1:00} has been reset");
                    }
                    else
                    {
                        if (TriggerPart.Kind == -1)
                        {
                            CharaTriggerInfo[CoordinateIndex].Parts[i] = new AccTriggerInfo(i);
                        }
                        else if (MathfEx.RangeEqualOn(0, TriggerPart.Kind, 7))
                        {
                            CharaTriggerInfo[CoordinateIndex].Parts[i].Group = "";
                        }
                        else if (TriggerPart.Kind == 9)
                        {
                            CharaTriggerInfo[CoordinateIndex].Parts[i].Group = PartsInfo[i].parentKey;
                        }
                        else if (TriggerPart.Kind > 9)
                        {
                            CharaTriggerInfo[CoordinateIndex].Parts[i].Group = "custom_" + (TriggerPart.Kind - 9).ToString();
                        }
                    }
                }
            }
Ejemplo n.º 27
0
 public void UpdateCameraSetting()
 {
     foreach (Camera camera in this.camView)
     {
         camera.set_targetDisplay(!this.useAnotherDisplay ? 0 : 1);
     }
     if (Object.op_Inequality((Object)null, (Object)this.camMain))
     {
         ((Behaviour)this.camMain).set_enabled(this.useAnotherDisplay);
     }
     if (MathfEx.RangeEqualOn <int>(0, this.viewType, 3))
     {
         foreach (Behaviour behaviour in this.camView)
         {
             behaviour.set_enabled(false);
         }
         if (this.viewType == 0)
         {
             ((Behaviour)this.camView[0]).set_enabled(true);
             this.camView[0].set_rect(new Rect(0.0f, 0.0f, 1f, 1f));
         }
         else if (this.viewType == 1)
         {
             ((Behaviour)this.camView[1]).set_enabled(true);
             this.camView[1].set_rect(new Rect(0.0f, 0.0f, 1f, 1f));
         }
         else if (this.viewType == 2)
         {
             ((Behaviour)this.camView[2]).set_enabled(true);
             this.camView[2].set_rect(new Rect(0.0f, 0.0f, 1f, 1f));
         }
         else
         {
             if (this.viewType != 3)
             {
                 return;
             }
             ((Behaviour)this.camView[3]).set_enabled(true);
             this.camView[3].set_rect(new Rect(0.0f, 0.0f, 1f, 1f));
         }
     }
     else if (this.viewType == 4)
     {
         foreach (Behaviour behaviour in this.camView)
         {
             behaviour.set_enabled(true);
         }
         this.camView[0].set_rect(new Rect(0.5f, 0.5f, 0.5f, 0.5f));
         this.camView[1].set_rect(new Rect(0.0f, 0.5f, 0.5f, 0.5f));
         this.camView[2].set_rect(new Rect(0.0f, 0.0f, 0.5f, 0.5f));
         this.camView[3].set_rect(new Rect(0.5f, 0.0f, 0.5f, 0.5f));
     }
     else
     {
         foreach (Behaviour behaviour in this.camView)
         {
             behaviour.set_enabled(false);
         }
         if (!Object.op_Inequality((Object)null, (Object)this.camMain))
         {
             return;
         }
         ((Behaviour)this.camMain).set_enabled(true);
     }
 }