Пример #1
0
            private static void LoadFacePresetPrefix(ChaFileControl __instance, ref HeadPresetInfo __state)
            {
                __state = null;
                int headID = __instance.custom.face.headId;

                if (headID >= BaseSlotID)
                {
                    ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
                    ListInfoBase   listInfo    = chaListCtrl.GetListInfo(__instance.parameter.sex == 0 ? ChaListDefine.CategoryNo.mo_head : ChaListDefine.CategoryNo.fo_head, __instance.custom.face.headId);
                    string         preset      = listInfo.GetInfo(ChaListDefine.KeyType.Preset);

                    var resolveinfo = TryGetResolutionInfo(__instance.parameter.sex == 0 ? ChaListDefine.CategoryNo.mo_head : ChaListDefine.CategoryNo.fo_head, __instance.custom.face.headId);
                    if (resolveinfo == null)
                    {
                        return;
                    }

                    var headPresetInfo = TryGetHeadPresetInfo(resolveinfo.Slot, resolveinfo.GUID, preset);
                    __state = headPresetInfo;
                }
                else
                {
                    ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
                    ListInfoBase   listInfo    = chaListCtrl.GetListInfo(__instance.parameter.sex == 0 ? ChaListDefine.CategoryNo.mo_head : ChaListDefine.CategoryNo.fo_head, __instance.custom.face.headId);
                    string         preset      = listInfo.GetInfo(ChaListDefine.KeyType.Preset);

                    var headPresetInfo = TryGetHeadPresetInfo(headID, null, preset);
                    __state = headPresetInfo;
                }
            }
Пример #2
0
 private static void loadListInternal(this ChaListControl instance, Dictionary <int, ListInfoBase> dictData, ChaListData chaListData)
 {
     foreach (KeyValuePair <int, List <string> > keyValuePair in chaListData.dictList)
     {
         ListInfoBase listInfoBase = new ListInfoBase();
         if (listInfoBase.Set(chaListData.categoryNo, chaListData.distributionNo, chaListData.lstKey, keyValuePair.Value))
         {
             if (!dictData.ContainsKey(listInfoBase.Id))
             {
                 dictData[listInfoBase.Id] = listInfoBase;
                 int infoInt = listInfoBase.GetInfoInt(ChaListDefine.KeyType.Possess);
                 int item    = (listInfoBase.Category * CategoryMultiplier) + listInfoBase.Id;
                 if (infoInt == 1)
                 {
                     var lstItemIsInit = r_lstItemIsInit.GetValue <List <int> >(instance);
                     lstItemIsInit.Add(item);
                 }
                 else if (infoInt == 2)
                 {
                     var lstItemIsNew = r_lstItemIsNew.GetValue <List <int> >(instance);
                     lstItemIsNew.Add(item);
                 }
             }
         }
     }
 }
Пример #3
0
        /// <summary>
        /// Try to get the primary asset by trying various things
        /// </summary>
        /// <param name="listInfoBase"></param>
        /// <returns>Null if the main asset wasn't found</returns>
        private static string TryGetMainAsset(ListInfoBase listInfoBase)
        {
            string asset = listInfoBase.GetInfo(ChaListDefine.KeyType.MainData);

            if (!asset.IsNullOrEmpty() && asset != "0")
            {
                return(asset);
            }
            asset = listInfoBase.GetInfo(ChaListDefine.KeyType.MainTex);
            if (!asset.IsNullOrEmpty() && asset != "0")
            {
                return(asset);
            }
            asset = listInfoBase.GetInfo(ChaListDefine.KeyType.PaintTex);
            if (!asset.IsNullOrEmpty() && asset != "0")
            {
                return(asset);
            }
            asset = listInfoBase.GetInfo(ChaListDefine.KeyType.NipTex);
            if (!asset.IsNullOrEmpty() && asset != "0")
            {
                return(asset);
            }
            asset = listInfoBase.GetInfo(ChaListDefine.KeyType.SunburnTex);
            if (!asset.IsNullOrEmpty() && asset != "0")
            {
                return(asset);
            }
            asset = listInfoBase.GetInfo(ChaListDefine.KeyType.UnderhairTex);
            if (!asset.IsNullOrEmpty() && asset != "0")
            {
                return(asset);
            }
            return(null);
        }
Пример #4
0
 void SetGroup(string name)
 {
     partName     = name;
     color        = null;
     hasSlider    = hasPartList = false;
     listAllParts = new ListInfoBase[0];
 }
Пример #5
0
 public HairAcs()
 {
     partName     = "Hair Accessory";
     hasPartList  = false;
     color        = chara.femaleCustomInfo.hairAcsColor[0];
     listAllParts = new ListInfoBase[0];
 }
Пример #6
0
 public EyeWhites()
 {
     partName     = "Eye Whites";
     hasPartList  = false;
     color        = chara.femaleCustomInfo.eyeWColor;
     listAllParts = new ListInfoBase[0];
 }
Пример #7
0
 public Nails()
 {
     partName     = "Nails";
     hasPartList  = false;
     color        = chara.femaleCustomInfo.nailColor;
     listAllParts = new ListInfoBase[0];
 }
Пример #8
0
 private static int SafeGetKind(ListInfoBase instance)
 {
     if (instance == null)
     {
         return(-9999);
     }
     return(instance.Kind);
 }
Пример #9
0
            private static bool ChaControl_ChangeAccessoryParent_Prefix(ChaControl __instance, int slotNo, string parentStr, ref bool __result)
            {
                if (slotNo >= __instance.objAccessory.Length)
                {
                    __result = false;
                    return(false);
                }

                GameObject gameObject = __instance.objAccessory[slotNo];

                if (gameObject == null)
                {
                    __result = false;
                    return(false);
                }
                if (parentStr == "none")
                {
                    gameObject.transform.SetParent(null, worldPositionStays: false);
                    __result = true;
                    return(false);
                }
                ListInfoBase listInfoBase = __instance.infoAccessory[slotNo];

                if (listInfoBase != null)
                {
                    listInfoBase = gameObject.GetComponent <ListInfoComponent>().data;
                }
                if (listInfoBase.GetInfo(ChaListDefine.KeyType.Parent) == "0")
                {
                    __result = false;
                    return(false);
                }
                try
                {
                    /*
                     * ChaReference.RefObjKey key = (ChaReference.RefObjKey) Enum.Parse(typeof(ChaReference.RefObjKey), parentStr);
                     * GameObject referenceInfo = __instance.GetReferenceInfo(key);
                     */
                    GameObject referenceInfo = __instance.GetComponentsInChildren <Transform>(true).FirstOrDefault(x => x.name == parentStr)?.gameObject;
                    if (referenceInfo == null)
                    {
                        __result = false;
                        return(false);
                    }
                    gameObject.transform.SetParent(referenceInfo.transform, worldPositionStays: false);
                    __instance.nowCoordinate.accessory.parts[slotNo].parentKey   = parentStr;
                    __instance.nowCoordinate.accessory.parts[slotNo].partsOfHead = ChaAccessoryDefine.CheckPartsOfHead(parentStr);
                }
                catch (ArgumentException)
                {
                    __result = false;
                    return(false);
                }
                __result = true;
                return(false);
            }
Пример #10
0
        public void ChangePatternImage()
        {
            ListInfoBase listInfo  = this.chaCtrl.lstCtrl.GetListInfo(ChaListDefine.CategoryNo.st_pattern, this.nowClothes.parts[this.parts].colorInfo[this.idx].pattern);
            Texture2D    texture2D = CommonLib.LoadAsset <Texture2D>(listInfo.GetInfo(ChaListDefine.KeyType.ThumbAB), listInfo.GetInfo(ChaListDefine.KeyType.ThumbTex), false, string.Empty);

            if (!Object.op_Implicit((Object)texture2D))
            {
                return;
            }
            this.imgPattern.set_sprite(Sprite.Create(texture2D, new Rect(0.0f, 0.0f, (float)((Texture)texture2D).get_width(), (float)((Texture)texture2D).get_height()), new Vector2(0.5f, 0.5f)));
        }
Пример #11
0
 public void CalculateUI()
 {
     for (int index = 0; index < 20; ++index)
     {
         ListInfoBase listInfo = this.chaCtrl.lstCtrl.GetListInfo((ChaListDefine.CategoryNo) this.nowAcs.parts[index].type, this.nowAcs.parts[index].id);
         if (listInfo == null)
         {
             this.textDst[index].set_text("なし");
             this.textSrc[index].set_text("なし");
         }
         else
         {
             TextCorrectLimit.Correct(this.textDst[index], listInfo.Name, "…");
             this.textSrc[index].set_text(this.textDst[index].get_text());
         }
     }
 }
Пример #12
0
        internal static void loadListInternal(this ChaListControl instance, Dictionary <int, ListInfoBase> dictData, ChaListData chaListData)
        {
            foreach (KeyValuePair <int, List <string> > keyValuePair in chaListData.dictList)
            {
                ListInfoBase listInfoBase = new ListInfoBase();

                if (listInfoBase.Set(chaListData.categoryNo, chaListData.distributionNo, chaListData.lstKey, keyValuePair.Value))
                {
                    if (!dictData.ContainsKey(listInfoBase.Id))
                    {
                        dictData[listInfoBase.Id] = listInfoBase;
                        int infoInt = listInfoBase.GetInfoInt(ChaListDefine.KeyType.Possess);
                        int item    = CalculateGlobalID(listInfoBase.Category, listInfoBase.Id);
                        instance.AddItemID(item, (byte)infoInt);
                    }
                }
            }
        }
Пример #13
0
 override public void OnSetListInfo(ListInfoBase lib)
 {
     if ((lib.Category < (int)CategoryNo.bo_head) && (lib.Category != (int)CategoryNo.bodypaint_layout && lib.Category != (int)CategoryNo.facepaint_layout))
     {
         return;
     }
     if (lib.Category == (int)CategoryNo.mt_ramp)
     {
         return;
     }
     if (((lib.Category >= (int)CategoryNo.ao_none) || (lib.Category <= (int)CategoryNo.ao_kokan)) && lib.Id == 0)
     {
         return;
     }
     if (lib.Id == 0)
     {
         return;
     }
     lib.Id = idMap.NewFake(lib.Category, lib.Id, lib.Clone());
 }
Пример #14
0
        private string GetMakerGrouping(ListInfoBase listInfoBase)
        {
            var fallback = "0";

            foreach (var key in MakerGroupingKeys)
            {
                var result = listInfoBase.GetInfo(key);
                if (!string.IsNullOrEmpty(result) && result != "0")
                {
                    if (result.Contains("/"))
                    {
                        return(result);
                    }
                    if (result.Length > fallback.Length)
                    {
                        fallback = result;
                    }
                }
            }

            return(fallback);
        }
Пример #15
0
        public int NewFake(int cat, int realid, ListInfoBase data)
        {
            var        realpair = new RealPair(cat, realid);
            List <int> fakeids;

            if (!real2fake.TryGetValue(realpair, out fakeids))
            {
                fakeids = real2fake[realpair] = new List <int>();
            }
            foreach (var item in fakeids)
            {
                if (fake2real[item].Distribution2 == data.Distribution2)
                {
                    return(item);
                }
            }
            int fakeid = --counter;

            fakeids.Add(fakeid);
            fake2real[fakeid] = data;
            return(fakeid);
        }
Пример #16
0
            private void DrawItemRaw(int _slotIndex, ChaFileAccessory.PartsInfo _part)
            {
                if (!_checkboxList.ContainsKey(_slotIndex))
                {
                    _checkboxList[_slotIndex] = false;
                }

                if (_checkboxList[_slotIndex])
                {
                    _checked++;
                }

                if (_part.type != 120)
                {
                    _parents.Add(_part.parentKey);
                }
                else
                {
                    _checkboxList[_slotIndex] = false;
                    return;
                }

                GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
                {
                    GameObject   _gameObject = _chaCtrl.GetAccessoryObject(_slotIndex);
                    ListInfoBase _data       = _gameObject?.GetComponent <ListInfoComponent>()?.data;
                    bool         _value      = _checkboxList[_slotIndex];
                    _checkboxList[_slotIndex] = GUILayout.Toggle(_checkboxList[_slotIndex], "", _gloButtonS);
                    if (_value != _checkboxList[_slotIndex])
                    {
                        _needRefreshRefNode = true;
                    }
                    GUILayout.Label($"{_slotIndex + 1:00}:", _textFieldLabel);
                    GUILayout.TextField($"{_data?.Name}", _textFieldLabel, _gloItemName, GUILayout.ExpandWidth(false));
                    GUILayout.FlexibleSpace();
                }
                GUILayout.EndHorizontal();
            }
Пример #17
0
 public virtual void OnLoadFBX(ChaControl ctrl, ref GameObject go, string ab = null, string ass = null, ListInfoBase lib = null)
 {
 }
Пример #18
0
    public override void OnLoadFBX(ChaControl ctrl, ref GameObject go, string ab = null, string ass = null, ListInfoBase lib = null)
    {
        if (go == null)
        {
            return;
        }
        try
        {
            if (go.name == "p_cf_body_bone")
            {
                TweakBody(ctrl, go);
            }

            else if (ass.StartsWith("p_o_bot_skirt"))
            {
                TweakSkirt(ctrl, go);
            }
            // XXX: maybe other clothing pieces with db's too?
            //print(ass);
        }
        catch (System.Exception ex)
        {
            print(ex);
        }
    }
Пример #19
0
        public void PlayVoice()
        {
            if (!this.customBase.playVoiceBackup.playSampleVoice)
            {
                this.customBase.playVoiceBackup.backEyebrowPtn = this.chaCtrl.fileStatus.eyebrowPtn;
                this.customBase.playVoiceBackup.backEyesPtn    = this.chaCtrl.fileStatus.eyesPtn;
                this.customBase.playVoiceBackup.backBlink      = this.chaCtrl.fileStatus.eyesBlink;
                this.customBase.playVoiceBackup.backEyesOpen   = this.chaCtrl.fileStatus.eyesOpenMax;
                this.customBase.playVoiceBackup.backMouthPtn   = this.chaCtrl.fileStatus.mouthPtn;
                this.customBase.playVoiceBackup.backMouthFix   = this.chaCtrl.fileStatus.mouthFixed;
                this.customBase.playVoiceBackup.backMouthOpen  = this.chaCtrl.fileStatus.mouthOpenMax;
            }
            ListInfoBase listInfo = Singleton <Character> .Instance.chaListCtrl.GetListInfo(ChaListDefine.CategoryNo.cha_sample_voice, this.parameter.personality);

            if (listInfo == null)
            {
                return;
            }
            ChaListDefine.KeyType[] keyTypeArray1 = new ChaListDefine.KeyType[3]
            {
                ChaListDefine.KeyType.Eyebrow01,
                ChaListDefine.KeyType.Eyebrow02,
                ChaListDefine.KeyType.Eyebrow03
            };
            ChaListDefine.KeyType[] keyTypeArray2 = new ChaListDefine.KeyType[3]
            {
                ChaListDefine.KeyType.Eye01,
                ChaListDefine.KeyType.Eye02,
                ChaListDefine.KeyType.Eye03
            };
            ChaListDefine.KeyType[] keyTypeArray3 = new ChaListDefine.KeyType[3]
            {
                ChaListDefine.KeyType.EyeMax01,
                ChaListDefine.KeyType.EyeMax02,
                ChaListDefine.KeyType.EyeMax03
            };
            ChaListDefine.KeyType[] keyTypeArray4 = new ChaListDefine.KeyType[3]
            {
                ChaListDefine.KeyType.Mouth01,
                ChaListDefine.KeyType.Mouth02,
                ChaListDefine.KeyType.Mouth03
            };
            ChaListDefine.KeyType[] keyTypeArray5 = new ChaListDefine.KeyType[3]
            {
                ChaListDefine.KeyType.MouthMax01,
                ChaListDefine.KeyType.MouthMax02,
                ChaListDefine.KeyType.MouthMax03
            };
            ChaListDefine.KeyType[] keyTypeArray6 = new ChaListDefine.KeyType[3]
            {
                ChaListDefine.KeyType.EyeHiLight01,
                ChaListDefine.KeyType.EyeHiLight02,
                ChaListDefine.KeyType.EyeHiLight03
            };
            ChaListDefine.KeyType[] keyTypeArray7 = new ChaListDefine.KeyType[3]
            {
                ChaListDefine.KeyType.Data01,
                ChaListDefine.KeyType.Data02,
                ChaListDefine.KeyType.Data03
            };
            int index = this.voiceCnt[this.parameter.personality] = (this.voiceCnt[this.parameter.personality] + 1) % keyTypeArray1.Length;

            this.chaCtrl.ChangeEyebrowPtn(listInfo.GetInfoInt(keyTypeArray1[index]), true);
            this.chaCtrl.ChangeEyesPtn(listInfo.GetInfoInt(keyTypeArray2[index]), true);
            this.chaCtrl.HideEyeHighlight("0" == listInfo.GetInfo(keyTypeArray6[index]));
            this.chaCtrl.ChangeEyesBlinkFlag(false);
            this.chaCtrl.ChangeEyesOpenMax(listInfo.GetInfoFloat(keyTypeArray3[index]));
            this.chaCtrl.ChangeMouthPtn(listInfo.GetInfoInt(keyTypeArray4[index]), true);
            this.chaCtrl.ChangeMouthFixed(false);
            this.chaCtrl.ChangeMouthOpenMax(listInfo.GetInfoFloat(keyTypeArray5[index]));
            this.customBase.playVoiceBackup.playSampleVoice = true;
            Singleton <Manager.Sound> .Instance.Stop(Manager.Sound.Type.SystemSE);

            Transform trfVoice = Illusion.Game.Utils.Sound.Play(new Illusion.Game.Utils.Sound.Setting()
            {
                type            = Manager.Sound.Type.SystemSE,
                assetBundleName = listInfo.GetInfo(ChaListDefine.KeyType.MainAB),
                assetName       = listInfo.GetInfo(keyTypeArray7[index])
            });

            this.audioSource = (AudioSource)((Component)trfVoice).GetComponent <AudioSource>();
            this.audioSource.set_pitch(this.parameter.voicePitch);
            this.chaCtrl.SetVoiceTransform(trfVoice);
        }
Пример #20
0
 private static bool IsMod(ListInfoBase listInfo)
 {
     return(IsMod(listInfo.Id));
 }
Пример #21
0
    public override void OnLoadFBX(ChaControl ctrl, ref GameObject go, string ab = null, string ass = null, ListInfoBase lib = null)
    {
        if (go == null)
        {
            return;
        }
        fbx[go.name] = go;
        sb.Length    = 0;

        foreach (var r in go.GetComponentsInChildren <Renderer>())
        {
            mat = r.material;
            var mname = mat.name.Replace(" (Instance)", "");
            dest = Dir.mat + mname + "/";
            Directory.CreateDirectory(dest);
            foreach (var tname in texNames)
            {
                var pngname = dest + tname + ".png";
                if (File.Exists(pngname))                 // avoid slowness
                {
                    continue;
                }
                var n   = "_" + tname;
                var tex = mat.GetTexture(n);
                if (tex == null)
                {
                    continue;
                }
                var save = RenderTexture.active;
                var tmp  = RenderTexture.GetTemporary(tex.width, tex.height);
                Graphics.Blit(tex, tmp);
                RenderTexture.active = tmp;
                Texture2D ntex = new Texture2D(tex.width, tex.height);
                ntex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0);
                RenderTexture.active = save;
                File.WriteAllBytes(pngname, ntex.EncodeToPNG());
            }


            SaveCSV("float", "Name,Value", floatNames, (x) => sb.AppendLine(mat.GetFloat(x).ToString()));
            SaveCSV("vector", "Name,X,Y,Z,W", vectorNames, (x) =>
            {
                var v = mat.GetVector(x);
                sb.AppendLine($"{v.x},{v.y},{v.z},{v.w}");
            });
            SaveCSV("color", "Name,R,G,B,A", colorNames, (x) =>
            {
                var v = mat.GetColor(x);
                sb.AppendLine($"{v.r},{v.g},{v.b},{v.a}");
            });
            SaveCSV("matrix", "Name,X,Y,Z,T", matrixNames, (x) =>
            {
                var m = mat.GetMatrix(x);
                for (int i = 0; i < 4; i++)
                {
                    if (i > 0)
                    {
                        sb.Append(",");
                    }
                    sb.AppendLine($"{m[i, 0]},{m[i, 1]},{m[i, 2]},{m[i, 3]}");
                }
            });
            if (Directory.GetFiles(dest).Length == 0)
            {
                Directory.Delete(dest);
            }
        }
    }
Пример #22
0
 private static int SafeGetKind(ListInfoBase instance) => instance == null ? -9999 : instance.Kind;
Пример #23
0
 public override void OnGetListInfo(ref ListInfoBase lib, int cat, int id)
 {
     lib = lib ?? GetInfos(cat, id).FirstOrDefault();
 }
        public void Initialize(ChaControl owner, ChaClothesComponent clothesComponent, ChaAccessoryComponent accessoryComponent, ListInfoBase listInfoBase, ChaListDefine.CategoryNo kind)
        {
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }
            if (clothesComponent == null)
            {
                throw new ArgumentNullException(nameof(clothesComponent));
            }
            if (accessoryComponent == null)
            {
                throw new ArgumentNullException(nameof(accessoryComponent));
            }
            if (listInfoBase == null)
            {
                throw new ArgumentNullException(nameof(listInfoBase));
            }
            ClothesComponent   = clothesComponent;
            AccessoryComponent = accessoryComponent;
            Owner    = owner;
            InfoBase = listInfoBase;
            _kind    = kind;

            // Treat top parts as normal tops
            if (kind >= ChaListDefine.CategoryNo.cpo_sailor_a)
            {
                _clothingKind = 0;
            }
            else
            {
                _clothingKind = kind - ChaListDefine.CategoryNo.co_top;
            }

            var firstInstanceForCharacter = false;

            AllInstances.TryGetValue(owner, out var instances);
            if (instances == null)
            {
                // + 1 for inner shoes. Only outer / index 7 are used, but some hooks can look for index 8
                instances                 = Enumerable.Range(0, 8 /*+ 1*/).Select(i => new List <ClothesToAccessoriesAdapter>()).ToArray();
                AllInstances[Owner]       = instances;
                firstInstanceForCharacter = true;
            }
            instances[_clothingKind].Add(this);

            Reference = gameObject.AddComponent <ChaReference>();
            Reference.CreateReferenceInfo((ulong)(_clothingKind + 5), gameObject);

            if (_kind == ChaListDefine.CategoryNo.co_gloves || _kind == ChaListDefine.CategoryNo.co_shoes || _kind == ChaListDefine.CategoryNo.co_socks)
            {
                AllObjects = AccessoryComponent.rendNormal.Select(x => x.transform.parent.gameObject).Distinct().ToArray();
            }

            _colorRend = AccessoryComponent.rendNormal.FirstOrDefault(x => x != null) ?? AccessoryComponent.rendAlpha.FirstOrDefault(x => x != null) ?? AccessoryComponent.rendHair.FirstOrDefault(x => x != null);

            if (!InitializeCreateTextures())
            {
                ClothesToAccessoriesPlugin.Logger.LogWarning($"InitializeCreateTextures failed for kind={kind} id={listInfoBase.Id}");
            }

            // If there's already a bra mask active it needs to be applied again to a newly loaded accessory bra
            if (_kind == ChaListDefine.CategoryNo.co_bra)
            {
                // If this bra is the first clothing accessory added to the character, LastTopState needs to be calculated by UpdateVisibleAccessoryClothes before it can be used below
                if (firstInstanceForCharacter)
                {
                    ClothesToAccessoriesPlugin.UpdateVisibleAccessoryClothes(Owner);
                }

                if (ClothesToAccessoriesPlugin.LastTopState.TryGetValue(Owner, out var topState))
                {
                    ChangeAlphaMask(ClothesToAccessoriesPlugin.alphaState[topState, 0], ClothesToAccessoriesPlugin.alphaState[topState, 1]);
                }
            }

            // bug: if multipe clothes with skirt dynamic bones are spawned then their dynamic bone components all work at the same time on the same body bones, which can cause some weird physics effects
        }
    public void SetAccessoryCharacter(bool init = false)
    {
        if (!init && !((Component)this).get_gameObject().get_activeSelf())
        {
            return;
        }
        Color color1 = (Color)null;

        for (int index1 = 0; index1 < this.AccessorySlots.GetToggleNum(); ++index1)
        {
            this.sbAcsName.Clear();
            int                 index2              = index1;
            ListInfoBase        listInfoBase        = this.hSceneManager.numFemaleClothCustom >= 2 ? this.Males[this.hSceneManager.numFemaleClothCustom - 2].infoAccessory[index2] : this.females[this.hSceneManager.numFemaleClothCustom].infoAccessory[index2];
            UnityEngine.UI.Text componentInChildren = (UnityEngine.UI.Text)((Component)this.AccessorySlots.lstToggle[index2]).GetComponentInChildren <UnityEngine.UI.Text>();
            if (listInfoBase != null)
            {
                this.sbAcsName.Append(listInfoBase.Name);
                ((Graphic)((Component)this.AccessorySlots.lstToggle[index2]).GetComponent <Image>()).set_raycastTarget(true);
                if (this.hSceneManager.numFemaleClothCustom < 2)
                {
                    this.AccessorySlots.lstToggle[index2].set_isOn(this.females[this.hSceneManager.numFemaleClothCustom].fileStatus.showAccessory[index2]);
                }
                else
                {
                    this.AccessorySlots.lstToggle[index2].set_isOn(this.Males[this.hSceneManager.numFemaleClothCustom - 2].fileStatus.showAccessory[index2]);
                }
                if (this.AccessorySlots.lstToggle[index2].get_isOn())
                {
                    Define.Set(ref color1, Colors.White, false);
                    ((Graphic)componentInChildren).set_color(color1);
                }
                else
                {
                    ((Graphic)componentInChildren).set_color(Color32.op_Implicit(new Color32((byte)141, (byte)136, (byte)129, byte.MaxValue)));
                }
            }
            else
            {
                this.sbAcsName.AppendFormat("スロット{0}", (object)index2);
                ((Graphic)((Component)this.AccessorySlots.lstToggle[index2]).GetComponent <Image>()).set_raycastTarget(false);
                ((Graphic)componentInChildren).set_color(Color32.op_Implicit(new Color32((byte)141, (byte)136, (byte)129, byte.MaxValue)));
            }
            componentInChildren.set_text(this.sbAcsName.ToString());
        }
        if (this.hSceneManager.numFemaleClothCustom < 2)
        {
            this.AccessorySlots.SetActive(Object.op_Inequality((Object)this.females[this.hSceneManager.numFemaleClothCustom].objBodyBone, (Object)null) && this.females[this.hSceneManager.numFemaleClothCustom].visibleAll, -1);
        }
        else
        {
            this.AccessorySlots.SetActive(Object.op_Inequality((Object)this.Males[this.hSceneManager.numFemaleClothCustom - 2].objBodyBone, (Object)null) && this.Males[this.hSceneManager.numFemaleClothCustom - 2].visibleAll, -1);
        }
        if (this.hSceneManager.numFemaleClothCustom > 1 || Object.op_Inequality((Object)this.hSceneManager.Player, (Object)null) && Object.op_Equality((Object)this.hSceneManager.Player.ChaControl, (Object)this.females[this.hSceneManager.numFemaleClothCustom]))
        {
            if (!Manager.Config.HData.Accessory)
            {
                this.AllChange.set_isOn(false);
            }
            else
            {
                this.AllChange.set_isOn(true);
            }
        }
        else
        {
            this.AllChange.set_isOn(true);
        }
        this.allState[this.hSceneManager.numFemaleClothCustom] = this.AllChange.get_isOn();
        UnityEngine.UI.Text componentInChildren1 = (UnityEngine.UI.Text)((Component)this.AllChange).GetComponentInChildren <UnityEngine.UI.Text>();
        Color color2 = ((Graphic)componentInChildren1).get_color();

        if (this.allState[this.hSceneManager.numFemaleClothCustom])
        {
            Define.Set(ref color2, Colors.White, false);
        }
        else
        {
            color2 = Color32.op_Implicit(new Color32((byte)141, (byte)136, (byte)129, byte.MaxValue));
        }
        ((Graphic)componentInChildren1).set_color(color2);
        AgentActor agentActor = (AgentActor)null;

        if (this.hSceneManager.numFemaleClothCustom < 2)
        {
            if (Object.op_Inequality((Object)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom], (Object)null))
            {
                agentActor = (AgentActor)((Component)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom]).GetComponent <AgentActor>();
            }
        }
        else if (Object.op_Inequality((Object)this.hSceneManager.male, (Object)null))
        {
            agentActor = (AgentActor)((Component)this.hSceneManager.male).GetComponent <AgentActor>();
        }
        AgentData agentData = !Object.op_Inequality((Object)agentActor, (Object)null) ? (AgentData)null : agentActor.AgentData;
        bool      flag1     = false;
        bool      flag2     = false;
        bool      flag3     = false;
        bool      flag4     = false;

        if (agentData != null)
        {
            this.player = false;
            flag1       = agentData.EquipedHeadItem != null && agentData.EquipedHeadItem.ID != -1;
            flag2       = agentData.EquipedBackItem != null && agentData.EquipedBackItem.ID != -1;
            flag3       = agentData.EquipedNeckItem != null && agentData.EquipedNeckItem.ID != -1;
            flag4       = agentData.EquipedLampItem != null && agentData.EquipedLampItem.ID != -1;
        }
        else
        {
            PlayerActor playerActor = (PlayerActor)null;
            if (this.hSceneManager.numFemaleClothCustom < 2)
            {
                if (Object.op_Inequality((Object)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom], (Object)null))
                {
                    playerActor = (PlayerActor)((Component)this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom]).GetComponent <PlayerActor>();
                }
            }
            else if (Object.op_Inequality((Object)this.hSceneManager.male, (Object)null))
            {
                playerActor = (PlayerActor)((Component)this.hSceneManager.male).GetComponent <PlayerActor>();
            }
            PlayerData playerData = !Object.op_Inequality((Object)playerActor, (Object)null) ? (PlayerData)null : playerActor.PlayerData;
            if (playerData != null)
            {
                this.player = true;
                flag1       = playerData.EquipedHeadItem != null && playerData.EquipedHeadItem.ID != -1;
                flag2       = playerData.EquipedBackItem != null && playerData.EquipedBackItem.ID != -1;
                flag3       = playerData.EquipedNeckItem != null && playerData.EquipedNeckItem.ID != -1;
                flag4       = playerData.EquipedLampItem != null && playerData.EquipedLampItem.ID != -1;
            }
        }
        if (this.hSceneManager.numFemaleClothCustom < 2)
        {
            this.EquipBts[0].chara = this.females[this.hSceneManager.numFemaleClothCustom];
            this.EquipBts[1].chara = this.females[this.hSceneManager.numFemaleClothCustom];
            this.EquipBts[2].chara = this.females[this.hSceneManager.numFemaleClothCustom];
            this.EquipBts[3].chara = this.females[this.hSceneManager.numFemaleClothCustom];
        }
        else
        {
            this.EquipBts[0].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2];
            this.EquipBts[1].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2];
            this.EquipBts[2].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2];
            this.EquipBts[3].chara = this.Males[this.hSceneManager.numFemaleClothCustom - 2];
        }
        this.EquipBts[0].Base.SetActive(flag1);
        this.EquipBts[1].Base.SetActive(flag2);
        this.EquipBts[2].Base.SetActive(flag3);
        this.EquipBts[3].Base.SetActive(flag4);
        this.EquipBts[0].id = 0;
        this.EquipBts[1].id = 1;
        this.EquipBts[2].id = 2;
        this.EquipBts[3].id = 3;
        if (Object.op_Inequality((Object)this.EquipBts[0].chara, (Object)null) && Object.op_Inequality((Object)this.EquipBts[0].chara.objExtraAccessory[0], (Object)null) && this.EquipBts[0].chara.objExtraAccessory[0].get_activeSelf() != this.EquipBts[0].active)
        {
            this.EquipBts[0].ChangeState();
        }
        if (Object.op_Inequality((Object)this.EquipBts[1].chara, (Object)null) && Object.op_Inequality((Object)this.EquipBts[1].chara.objExtraAccessory[1], (Object)null) && this.EquipBts[1].chara.objExtraAccessory[1].get_activeSelf() != this.EquipBts[1].active)
        {
            this.EquipBts[1].ChangeState();
        }
        if (Object.op_Inequality((Object)this.EquipBts[2].chara, (Object)null) && Object.op_Inequality((Object)this.EquipBts[2].chara.objExtraAccessory[2], (Object)null) && this.EquipBts[2].chara.objExtraAccessory[2].get_activeSelf() != this.EquipBts[2].active)
        {
            this.EquipBts[2].ChangeState();
        }
        if (Object.op_Inequality((Object)this.EquipBts[3].chara, (Object)null))
        {
            GameObject gameObject = (GameObject)null;
            if (!this.player)
            {
                gameObject = this.EquipBts[3].chara.objExtraAccessory[3];
            }
            else if (this.hSceneManager.numFemaleClothCustom < 2)
            {
                if (this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom].EquipedItem != null)
                {
                    gameObject = this.hSceneManager.females[this.hSceneManager.numFemaleClothCustom].EquipedItem.AsGameObject;
                }
            }
            else if (this.hSceneManager.male.EquipedItem != null)
            {
                gameObject = this.hSceneManager.male.EquipedItem.AsGameObject;
            }
            if (Object.op_Inequality((Object)gameObject, (Object)null) && gameObject.get_activeSelf() != this.EquipBts[3].active)
            {
                this.EquipBts[3].ChangeState();
            }
        }
        if (!this.hSceneSpriteChaChoice.Content.get_activeSelf())
        {
            return;
        }
        this.hSceneSpriteChaChoice.Content.SetActive(false);
    }
Пример #26
0
 /// <summary>
 /// A category item is being added.
 /// </summary>
 /// <param name="lib">Item entry, can be mutated</param>
 public virtual void OnSetListInfo(ListInfoBase lib)
 {
 }
Пример #27
0
 /// <summary>
 /// A category item is being queried.
 /// </summary>
 /// <param name="lib">Item entry, can be mutated</param>
 public virtual void OnGetListInfo(ref ListInfoBase lib, int cat, int id)
 {
 }