예제 #1
0
        private void SetupEyeInterface(RegisterSubCategoriesEvent e, KK_CharaOverlaysBasedOnCoordinate owner)
        {
            CharaOverlaysBasedOnCoordinateController controller = MakerAPI.GetCharacterControl().gameObject.GetComponent <CharaOverlaysBasedOnCoordinateController>();
            KoiSkinOverlayController KSOXController             = MakerAPI.GetCharacterControl().gameObject.GetComponent <KoiSkinOverlayController>();

            MakerCategory irisCategory = MakerConstants.Face.Iris;
            MakerCategory eyeCategory  = new MakerCategory(irisCategory.CategoryName, "tglEyeOverlayKSOX", irisCategory.Position + 5, "Iris Overlays");

            e.AddSubCategory(eyeCategory);

            e.AddControl(new MakerButton("Copy iris overlay to all outfits", eyeCategory, owner))
            .OnClick.AddListener(delegate() {
                controller.CopyOverlayToAllOutfits(TexType.EyeOver);
                controller.CopyOverlayToAllOutfits(TexType.EyeUnder);
                Logger.LogMessage("[Chara Overlays Based On Coordinate] Successfully copied iris overlay");
            }
                                 );
            IrisSideRadioBtn = new MakerRadioButtons(eyeCategory, owner, "Side to display", "Both", "Left", "Right");
            e.AddControl(IrisSideRadioBtn)
            .ValueChanged.Subscribe(side => {
                controller.ChangeIrisDisplayside(side);
                //Logger.LogDebug("Changed RadioBtn: " + side);
            }
                                    );
        }
예제 #2
0
        public static void RebuildTexPostfix(CustomTextureCreate __instance, ref bool __state)
        {
            if (!__state)
            {
                return;
            }

            CharaOverlaysBasedOnCoordinateController controller = __instance.trfParent?.GetComponent <CharaOverlaysBasedOnCoordinateController>();

            if (null != controller)
            {
                foreach (KeyValuePair <TexType, byte[]> kvp in EyeTexture)
                {
                    controller.OverwriteOverlayWithoutUpdate(kvp.Key, kvp.Value);
                }
                Extension.Extension.TryGetPluginInstance("KSOX_GUI").Invoke("OnChaFileLoaded");
            }
        }
예제 #3
0
        public static void RebuildTexPrefix(CustomTextureCreate __instance, ref bool __state)
        {
            __state = false;
            CharaOverlaysBasedOnCoordinateController controller = __instance.trfParent?.GetComponent <CharaOverlaysBasedOnCoordinateController>();

            if (null == controller || controller.LoadingLock)
            {
                return;
            }

            CustomTextureCreate toCompare;

            switch (controller.IrisDisplaySide[(int)controller.CurrentCoordinate.Value])
            {
            case 1:
                toCompare = controller.ChaControl.ctCreateEyeL;
                break;

            case 2:
                toCompare = controller.ChaControl.ctCreateEyeR;
                break;

            default:
                //Not Display Both
                return;
            }

            //要保留的那邊return
            if (toCompare == __instance)
            {
                return;
            }

            __state = true;
            foreach (KeyValuePair <TexType, byte[]> kvp in controller.GetOverlayLoaded(new TexType[] { TexType.EyeOver, TexType.EyeUnder }))
            {
                EyeTexture[kvp.Key] = kvp.Value;
                controller.OverwriteOverlayWithoutUpdate(kvp.Key, new byte[] { });
            }
        }
예제 #4
0
        private void SetupBodyInterface(RegisterSubCategoriesEvent e, KK_CharaOverlaysBasedOnCoordinate owner)
        {
            CharaOverlaysBasedOnCoordinateController controller = MakerAPI.GetCharacterControl().gameObject.GetComponent <CharaOverlaysBasedOnCoordinateController>();
            MakerCategory paintCategory = MakerConstants.Body.Paint;
            MakerCategory makerCategory = new MakerCategory(paintCategory.CategoryName, "tglOverlayKSOX", paintCategory.Position + 5, "Skin Overlays");

            e.AddSubCategory(makerCategory);

            e.AddControl(new MakerButton("Copy face overlay to all outfits", makerCategory, owner))
            .OnClick.AddListener(delegate() {
                controller.CopyOverlayToAllOutfits(TexType.FaceOver);
                controller.CopyOverlayToAllOutfits(TexType.FaceUnder);
                Logger.LogMessage("[Chara Overlays Based On Coordinate] Successfully copied face overlay");
            }
                                 );
            e.AddControl(new MakerButton("Copy body overlay to all outfits", makerCategory, owner))
            .OnClick.AddListener(delegate() {
                controller.CopyOverlayToAllOutfits(TexType.BodyOver);
                controller.CopyOverlayToAllOutfits(TexType.BodyUnder);
                Logger.LogMessage("[Chara Overlays Based On Coordinate] Successfully copied body overlay");
            }
                                 );
        }