Exemplo n.º 1
0
 /// <summary>
 /// Strip the "addStr" and attempt to get the texture again. This fixes head types missing eyeliners if they don't have one defined for that specific head.
 /// </summary>
 public static void GetTexture(ChaListDefine.CategoryNo type, int id, ChaListDefine.KeyType assetBundleKey, ChaListDefine.KeyType assetKey, string addStr, ChaControl __instance, ref Texture2D __result)
 {
     if (__result == null && !addStr.IsNullOrEmpty())
     {
         __result = Traverse.Create(__instance).Method("GetTexture", type, id, assetBundleKey, assetKey, "").GetValue() as Texture2D;
     }
 }
Exemplo n.º 2
0
        public static List <CustomSelectInfo> CreateSelectList(
            ChaListDefine.CategoryNo cateNo,
            ChaListDefine.KeyType limitKey = ChaListDefine.KeyType.Unknown)
        {
            ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
            Dictionary <int, ListInfoBase> categoryInfo = chaListCtrl.GetCategoryInfo(cateNo);

            int[] array = categoryInfo.Keys.ToArray <int>();
            List <CustomSelectInfo> customSelectInfoList = new List <CustomSelectInfo>();

            for (int index = 0; index < categoryInfo.Count; ++index)
            {
                if (categoryInfo[array[index]].GetInfoInt(ChaListDefine.KeyType.Possess) != 99)
                {
                    bool flag = false;
                    if (chaListCtrl.CheckItemID(categoryInfo[array[index]].Category, categoryInfo[array[index]].Id) == (byte)1)
                    {
                        flag = true;
                    }
                    customSelectInfoList.Add(new CustomSelectInfo()
                    {
                        category    = categoryInfo[array[index]].Category,
                        id          = categoryInfo[array[index]].Id,
                        limitIndex  = limitKey != ChaListDefine.KeyType.Unknown ? categoryInfo[array[index]].GetInfoInt(limitKey) : -1,
                        name        = categoryInfo[array[index]].Name,
                        assetBundle = categoryInfo[array[index]].GetInfo(ChaListDefine.KeyType.ThumbAB),
                        assetName   = categoryInfo[array[index]].GetInfo(ChaListDefine.KeyType.ThumbTex),
                        newItem     = flag
                    });
                }
            }
            return(customSelectInfoList);
        }
Exemplo n.º 3
0
 private static void ChaControl_ChangeTexture(Material mat, ChaListDefine.KeyType assetKey)
 {
     if (assetKey == ChaListDefine.KeyType.NormallMapDetail)
     {
         MaterialEditorPlugin.ConvertNormalMap(mat, "NormalMapDetail");
     }
 }
Exemplo n.º 4
0
 public static void LoadAsyncPrefix(ChaListDefine.KeyType keyType, ref int __result)
 {
     if (keyType == ChaListDefine.KeyType.Sex)
     {
         __result = 1;
     }
 }
            internal static void GetInfoPostfix(ChaListDefine.KeyType keyType, ref string __result)
            {
                var value = CheckOverride(keyType);

                if (value != null)
                {
                    __result = value;
                }
            }
 public static void GetInfoIntPostfix(ChaListDefine.KeyType keyType, ref int __result)
 {
     if (keyType == ChaListDefine.KeyType.Sex && EnableCrossdressing.Value)
     {
         __result = 1;
     }
     if (keyType == ChaListDefine.KeyType.NotBra && EnableBras.Value)
     {
         __result = 0;
     }
     if (keyType == ChaListDefine.KeyType.Coordinate && EnableSkirts.Value)
     {
         __result = 0;
     }
 }
 internal static void GetInfoIntPostfix(ChaListDefine.KeyType keyType, ref int __result)
 {
     if (keyType == ChaListDefine.KeyType.Sex && EnableCrossdressing.Value)
     {
         __result = 1;
     }
     else
     {
         var value = CheckOverride(keyType);
         if (value != null)
         {
             __result = int.Parse(value);
         }
     }
 }
 /// <summary>
 /// Return 0 to override, null if not
 /// </summary>
 private static string CheckOverride(ChaListDefine.KeyType keyType)
 {
     if (keyType == ChaListDefine.KeyType.NotBra || keyType == ChaListDefine.KeyType.Coordinate || keyType == ChaListDefine.KeyType.HideShorts)
     {
         if (chaControl == null)
         {
             return(null);
         }
         var controller = GetController(chaControl);
         if (controller == null)
         {
             return(null);
         }
         if (controller.GetClothingUnlocked())
         {
             return("0");
         }
     }
     return(null);
 }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
        public int GetInfoInt(ChaListDefine.KeyType keyType)
        {
            int result;

            return(!int.TryParse(this.GetInfo(keyType), out result) ? -1 : result);
        }
Exemplo n.º 11
0
        public string GetInfo(ChaListDefine.KeyType keyType)
        {
            string str;

            return(!this._dictInfo.TryGetValue((int)keyType, out str) ? "0" : str);
        }
Exemplo n.º 12
0
        public float GetInfoFloat(ChaListDefine.KeyType keyType)
        {
            float result;

            return(!float.TryParse(this.GetInfo(keyType), out result) ? -1f : result);
        }