public static void UpdateTexture(ChaControl cc, TexType type)
        {
            if (cc == null)
            {
                return;
            }
            if (cc.customTexCtrlBody == null || cc.customTexCtrlFace == null)
            {
                return;
            }

            switch (type)
            {
            case TexType.BodyOver:
            case TexType.BodyUnder:
                cc.AddUpdateCMBodyTexFlags(true, true, true, true);
                cc.CreateBodyTexture();
                break;

            case TexType.FaceOver:
            case TexType.FaceUnder:
                cc.AddUpdateCMFaceTexFlags(true, true, true, true, true, true, true);
                cc.CreateFaceTexture();
                break;

            default:
                cc.AddUpdateCMBodyTexFlags(true, true, true, true);
                cc.CreateBodyTexture();
                cc.AddUpdateCMFaceTexFlags(true, true, true, true, true, true, true);
                cc.CreateFaceTexture();
                break;
            }
        }
            /// <summary>
            /// Rebuild the character's skin textures
            /// </summary>
            private void UpdateSkin()
            {
                //Method changed number of parameters, check number of parameters for compatibility
                if (typeof(ChaControl).GetMethod("InitBaseCustomTextureBody", AccessTools.all).GetParameters().Count() == 0)
                {
                    Traverse.Create(ChaControl).Method("InitBaseCustomTextureBody").GetValue();
                }
                else
                {
                    Traverse.Create(ChaControl).Method("InitBaseCustomTextureBody", new object[] { BodyData?.Sex ?? ChaControl.sex }).GetValue();
                }

#if KK || EC
                ChaControl.AddUpdateCMBodyTexFlags(true, true, true, true, true);
                ChaControl.AddUpdateCMBodyColorFlags(true, true, true, true, true, true);
#else
                ChaControl.AddUpdateCMBodyTexFlags(true, true, true, true);
                ChaControl.AddUpdateCMBodyColorFlags(true, true, true, true);
                ChaControl.AddUpdateCMBodyGlossFlags(true, true);
#endif
                ChaControl.AddUpdateCMBodyLayoutFlags(true, true);
                ChaControl.SetBodyBaseMaterial();
                ChaControl.CreateBodyTexture();
                ChaControl.ChangeCustomBodyWithoutCustomTexture();
            }
Beispiel #3
0
            /// <summary>
            /// Rebuild the character's skin textures
            /// </summary>
            private void UpdateSkin()
            {
                //Method changed number of parameters, check number of parameters for compatibility with game versions prior to Darkness (KK)
                if (!typeof(ChaControl).GetMethod("InitBaseCustomTextureBody", AccessTools.all).GetParameters().Any())
                {
                    Traverse.Create(ChaControl).Method("InitBaseCustomTextureBody").GetValue();
                }
                else
                {
                    Traverse.Create(ChaControl).Method("InitBaseCustomTextureBody", BodyData?.Sex ?? ChaControl.sex).GetValue();
                }

#if KK || EC || KKS
                ChaControl.AddUpdateCMBodyTexFlags(true, true, true, true, true);
                ChaControl.AddUpdateCMBodyColorFlags(true, true, true, true, true, true);
#else
                ChaControl.AddUpdateCMBodyTexFlags(true, true, true, true);
                ChaControl.AddUpdateCMBodyColorFlags(true, true, true, true);
                ChaControl.AddUpdateCMBodyGlossFlags(true, true);
#endif
                ChaControl.AddUpdateCMBodyLayoutFlags(true, true);
                ChaControl.SetBodyBaseMaterial();
                ChaControl.CreateBodyTexture();
                ChaControl.ChangeCustomBodyWithoutCustomTexture();
            }
 /// <summary>
 /// Rebuild the character's skin textures
 /// </summary>
 internal static void UpdateSkin(ChaControl chaControl, BodyData bodyData)
 {
     Traverse.Create(chaControl).Method("InitBaseCustomTextureBody", new object[] { bodyData?.Sex ?? chaControl.sex }).GetValue();
     chaControl.AddUpdateCMBodyTexFlags(true, true, true, true, true);
     chaControl.AddUpdateCMBodyColorFlags(true, true, true, true, true, true);
     chaControl.AddUpdateCMBodyLayoutFlags(true, true);
     chaControl.SetBodyBaseMaterial();
     chaControl.CreateBodyTexture();
     chaControl.ChangeCustomBodyWithoutCustomTexture();
 }
                /// <summary>
                /// Rebuild the character's skin textures
                /// </summary>
                internal static void UpdateSkin(ChaControl chaControl, BodyData bodyData)
                {
                    //Method changed number of parameters, check number of parameters for compatibility
                    if (typeof(ChaControl).GetMethod("InitBaseCustomTextureBody", AccessTools.all).GetParameters().Count() == 0)
                    {
                        Traverse.Create(chaControl).Method("InitBaseCustomTextureBody").GetValue();
                    }
                    else
                    {
                        Traverse.Create(chaControl).Method("InitBaseCustomTextureBody", new object[] { bodyData?.Sex ?? chaControl.sex }).GetValue();
                    }

                    chaControl.AddUpdateCMBodyTexFlags(true, true, true, true, true);
                    chaControl.AddUpdateCMBodyColorFlags(true, true, true, true, true, true);
                    chaControl.AddUpdateCMBodyLayoutFlags(true, true);
                    chaControl.SetBodyBaseMaterial();
                    chaControl.CreateBodyTexture();
                    chaControl.ChangeCustomBodyWithoutCustomTexture();
                }
Beispiel #6
0
        public static void UpdateTexture(ChaControl cc, TexType type)
        {
            if (cc == null)
            {
                return;
            }
            if (cc.customTexCtrlBody == null || cc.customTexCtrlFace == null)
            {
                return;
            }
#if KK || EC
            switch (type)
            {
            case TexType.BodyOver:
            case TexType.BodyUnder:
                cc.AddUpdateCMBodyTexFlags(true, true, true, true, true);
                cc.CreateBodyTexture();
                break;

            case TexType.FaceOver:
            case TexType.FaceUnder:
                cc.AddUpdateCMFaceTexFlags(true, true, true, true, true, true, true);
                cc.CreateFaceTexture();
                break;

            case TexType.EyeUnder:
            case TexType.EyeOver:
            case TexType.EyeUnderL:
            case TexType.EyeOverL:
            case TexType.EyeUnderR:
            case TexType.EyeOverR:
                cc.ChangeSettingEye(true, true, true);
                break;

            default:
                cc.AddUpdateCMBodyTexFlags(true, true, true, true, true);
                cc.CreateBodyTexture();
                cc.AddUpdateCMFaceTexFlags(true, true, true, true, true, true, true);
                cc.CreateFaceTexture();
                cc.ChangeSettingEye(true, true, true);
                break;
            }
#elif AI || HS2
            switch (type)
            {
            case TexType.BodyOver:
            case TexType.BodyUnder:
                cc.AddUpdateCMBodyTexFlags(true, true, true, true);
                cc.CreateBodyTexture();
                break;

            case TexType.FaceOver:
            case TexType.FaceUnder:
                cc.AddUpdateCMFaceTexFlags(true, true, true, true, true, true, true);
                cc.CreateFaceTexture();
                break;

            case TexType.EyeUnderL:
            case TexType.EyeOverL:
                cc.ChangeEyesKind(0);     //todo test sides
                break;

            case TexType.EyeUnderR:
            case TexType.EyeOverR:
                cc.ChangeEyesKind(1);
                break;

            case TexType.EyeUnder:
            case TexType.EyeOver:
                cc.ChangeEyesKind(2);
                break;

            default:
                cc.AddUpdateCMBodyTexFlags(true, true, true, true);
                cc.CreateBodyTexture();
                cc.AddUpdateCMFaceTexFlags(true, true, true, true, true, true, true);
                cc.CreateFaceTexture();
                cc.ChangeEyesKind(2);
                break;
            }
#endif
        }