static bool PrefixFileSave(AIChara.ChaFileControl __instance, ref string filename, byte sex = 255, bool newFile = false) { Object[] controls = UnityEngine.Resources.FindObjectsOfTypeAll(typeof(CvsO_CharaSave)); if (controls.Length == 0) { /** No UI component, proceed as normal */ return(true); } else { /** Found UI component, read the current directory and save there */ CharaFolderUI ui = ((CvsO_CharaSave)controls[0]).gameObject.GetComponent <CharaFolderUI>(); filename = ui.currentDir + "\\" + filename; return(true); } }
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); }