public static void post_PauseRegistrationList_InitList(PauseRegistrationList __instance) { if (v_prefabNode == null) { v_prefabNode = (GameObject)AccessTools.Field(typeof(PauseRegistrationList), "prefabNode").GetValue(__instance); v_transformRoot = (Transform)AccessTools.Field(typeof(PauseRegistrationList), "transformRoot").GetValue(__instance); } foreach (var subDir in CurrentDirectory.GetDirectories().Reverse()) { AddListButton($"[{subDir.Name}]", () => { CurrentDirectory = subDir; Traverse.Create(__instance).Method("InitList").GetValue(); }).SetAsFirstSibling(); } var fn = CurrentDirectory.FullName; if (fn.Length > DefaultRootLength) { AddListButton("..", () => { CurrentDirectory = CurrentDirectory.Parent; Traverse.Create(__instance).Method("InitList").GetValue(); }).SetAsFirstSibling(); } }
private static void OnClickSelect(PauseRegistrationList __instance) { if (PoseQuickLoad.Enabled.Value) { Traverse.Create(__instance).Method("OnClickLoad").GetValue(); } }
private static void PauseRegistrationList_InitList_Postfix(PauseRegistrationList __instance) { if (v_prefabNode == null) { v_prefabNode = __instance.prefabNode; v_transformRoot = __instance.transformRoot; } var dirs = CurrentDirectory.GetDirectories(); for (var i = dirs.Length - 1; i >= 0; i--) { var subDir = dirs[i]; AddListButton($"[{subDir.Name}]", () => { CurrentDirectory = subDir; __instance.InitList(); }).SetAsFirstSibling(); } var fn = CurrentDirectory.FullName; if (fn.Length > DefaultRootLength) { AddListButton("..", () => { CurrentDirectory = CurrentDirectory.Parent; __instance.InitList(); }).SetAsFirstSibling(); } }
public static void PoseLoadPatch(PauseRegistrationList __instance) { var traverse = Traverse.Create(__instance); var listPath = traverse.Field("listPath").GetValue <List <string> >(); var select = traverse.Field("select").GetValue <int>(); foreach (var chara in Utils.GetSelectedCharacters().Where((chara) => chara != __instance.ociChar)) { PauseCtrl.Load(chara, listPath[select]); } }
private static void OnClickSelect(PauseRegistrationList __instance) { if (PoseQuickLoad.ConfigPoseQuickLoad.Value == PoseQuickLoad.QuickLoad.Enabled) { __instance.OnClickLoad(); } else if (PoseQuickLoad.ConfigPoseQuickLoad.Value == PoseQuickLoad.QuickLoad.EnabledWithShift) { if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) { __instance.OnClickLoad(); } } }
private static bool PauseRegistrationList_InitList_Prefix(PauseRegistrationList __instance) { for (int i = 0; i < __instance.transformRoot.childCount; i++) { UnityEngine.Object.Destroy(__instance.transformRoot.GetChild(i).gameObject); } __instance.transformRoot.DetachChildren(); __instance.select = -1; __instance.buttonLoad.interactable = false; __instance.buttonDelete.interactable = false; List <string> files = new List <string>(); files.AddRange(Directory.GetFiles(UserData.Create(GetFolder()), "*.dat").ToList()); files.AddRange(Directory.GetFiles(UserData.Create(GetFolder()), "*.png")); if (ConfigOrderBy.Value == OrderBy.Filename) { files.Sort(); } __instance.listPath = files; __instance.dicNode.Clear(); for (int j = 0; j < __instance.listPath.Count; j++) { GameObject gameObject = UnityEngine.Object.Instantiate(__instance.prefabNode); gameObject.transform.SetParent(__instance.transformRoot, false); StudioNode component = gameObject.GetComponent <StudioNode>(); component.active = true; int no = j; component.addOnClick = delegate { __instance.OnClickSelect(no); }; component.text = PauseCtrl.LoadName(__instance.listPath[j]); __instance.dicNode.Add(j, component); } return(false); }