public static void CustomClothesWindow_ButtonClickedHook(CustomClothesWindow ___clothesLoadWin, ref IEnumerator __result)
 {
     __result = __result.AppendCo(() =>
     {
         ___clothesLoadWin.onClick01 = (info => CoordinateButtonClicked = 1) + ___clothesLoadWin.onClick01;
         ___clothesLoadWin.onClick02 = (info => CoordinateButtonClicked = 2) + ___clothesLoadWin.onClick02;
         ___clothesLoadWin.onClick03 = (info => CoordinateButtonClicked = 3) + ___clothesLoadWin.onClick03;
     });
 }
Ejemplo n.º 2
0
 static void Start(CustomClothesWindow __instance)
 {
     Helpers.UI.ModifyGameMenu(__instance, "coordinate/female", () =>
     {
         Logger.Log("Action running!");
         // TODO last parameter is false on load, true on save
         __instance.UpdateWindow(true, 1, true);
     });
 }
Ejemplo n.º 3
0
        public static void CustomClothesWindow_Sort_ApplyScroll(CustomClothesWindow __instance, float __state)
        {
            if (__state == 1f || !KKAPI.Maker.MakerAPI.InsideAndLoaded)
            {
                return;
            }

            var scrollObj = __instance.transform.Find("Scroll View/Scrollbar Vertical");
            var scrollbar = scrollObj.GetComponent <Scrollbar>();

            AI_MakerAdditions.instance.StartCoroutine(Tools.ApplyScroller(scrollbar, __state));
        }
Ejemplo n.º 4
0
        public IEnumerator CreateSaveButton()
        {
            CustomClothesWindow window = Helpers.Field <CustomClothesWindow>(this.clothesSave, "clothesLoadWin");

            Transform   saveBtnTransform = this.clothesSave.transform.Find("buttons/btn02");
            UI_ButtonEx saveBtn          = saveBtnTransform.GetComponent <UI_ButtonEx>();
            Transform   saveBtnCopy      = UnityEngine.MonoBehaviour.Instantiate(saveBtn.transform, saveBtn.transform.parent);

            UnityEngine.MonoBehaviour.Destroy(saveBtnCopy.GetComponent <UI_ButtonEx>());

            UnityEngine.UI.Text text = saveBtnCopy.transform.Find("Text").GetComponent <UnityEngine.UI.Text>();
            text.color = Color.black;

            yield return(new WaitForSeconds(1));

            UI_ButtonEx newBtn = saveBtnCopy.gameObject.AddComponent <UI_ButtonEx>();

            UnityEngine.UI.Image image = newBtn.transform.Find("imgSelect").GetComponent <UnityEngine.UI.Image>();
            FieldInfo            info  = newBtn.GetType().GetField("overImage", BindingFlags.Instance | BindingFlags.NonPublic);

            info.SetValue(newBtn, image);

            newBtn.onClick.AddListener(() => {
                Illusion.Game.Utils.Sound.Play(Illusion.Game.SystemSE.ok_s);

                CvsC_ClothesInput input = Helpers.Field <CvsC_ClothesInput>(this.clothesSave, "clothesNameInput");
                CvsC_CreateCoordinateFile createFile = Helpers.Field <CvsC_CreateCoordinateFile>(this.clothesSave, "createCoordinateFile");

                if (null != input)
                {
                    input.SetupInputCoordinateNameWindow("");
                    input.actEntry = delegate(string buf)
                    {
                        string name     = "HS2CoordeF_" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
                        string fullPath = this.currentDir + "/" + name + ".png";
                        createFile.CreateCoordinateFile(fullPath, buf, true);
                    };
                }
            });

            saveBtn.gameObject.SetActive(false);

            Debug.Log("CharaSelect :: FINISH SAVE REPLACE");
        }
Ejemplo n.º 5
0
        static bool Prefix(CustomClothesWindow __instance, bool modeNew, int sex, bool save)
        {
            Type      t    = __instance.GetType();
            FieldInfo info = t.GetField("lstClothes", BindingFlags.Instance | BindingFlags.NonPublic);
            List <CustomClothesFileInfo> list = new List <CustomClothesFileInfo>();

            CharaFolderUI plugin = __instance.gameObject.GetComponent <CharaFolderUI>();
            string        path   = plugin.currentDir;
            int           num    = 0;
            Type          atype  = typeof(CustomClothesFileInfoAssist);
            MethodInfo    minfo  = atype.GetMethod("AddList", BindingFlags.Static | BindingFlags.NonPublic);

            Logger.Log("CharaSelect :: TRYING TO INVOKE STATIC METHOD! CLOTHES");
            byte sexb = (byte)sex;

            minfo.Invoke(null, new object[] { list, path, sexb, !save, num });
            info.SetValue(__instance, list);
            __instance.Sort();
            return(false);
        }
Ejemplo n.º 6
0
 public static void CustomClothesWindow_ButtonClickedHook(CustomClothesWindow __instance)
 {
     __instance.onClick01 = (info => CoordinateButtonClicked = 1) + __instance.onClick01;
     __instance.onClick02 = (info => CoordinateButtonClicked = 2) + __instance.onClick02;
     __instance.onClick03 = (info => CoordinateButtonClicked = 3) + __instance.onClick03;
 }
Ejemplo n.º 7
0
        public static void CustomClothesWindow_Sort_SaveScroll(CustomClothesWindow __instance, out float __state)
        {
            var scrollObj = __instance.transform.Find("Scroll View/Scrollbar Vertical");

            __state = scrollObj.GetComponent <Scrollbar>().value;
        }