/// <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();
            }
예제 #2
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();
            }