/// <summary> /// Used to increment the selected character / coordinate in the maker. /// </summary> public static void IncrementSelectIndex() { if (KK_Archetypes.IncrementFlag) { // Increment character select index if (KK_Archetypes._loadCharaToggle.isOn && (Body.AnyToggles() || Face.AnyToggles() || Hair.AnyToggles())) { ChaCustom.CustomFileListCtrl listControl = Singleton <ChaCustom.CustomFileListCtrl> .Instance; List <ChaCustom.CustomFileInfo> fileInfos = Traverse.Create(listControl).Field("lstFileInfo").GetValue <List <ChaCustom.CustomFileInfo> >(); if (fileInfos != null) { int nextindex = fileInfos.IndexOf(fileInfos.Find(x => x.index == listControl.GetSelectIndex()[0])) + 1; listControl.ToggleAllOff(); if (nextindex < listControl.GetInclusiveCount()) { listControl.SelectItem(fileInfos[nextindex].index); } } } // Increment coordinate select index if (KK_Archetypes._loadCosToggle.isOn && Clothes._toggleClothes.Value) { ChaCustom.CustomCoordinateFile clothesFile = Singleton <ChaCustom.CustomCoordinateFile> .Instance; ChaCustom.CustomFileListCtrl listControl = Traverse.Create(clothesFile).Field("listCtrl").GetValue <ChaCustom.CustomFileListCtrl>(); List <ChaCustom.CustomFileInfo> fileInfos = Traverse.Create(listControl).Field("lstFileInfo").GetValue <List <ChaCustom.CustomFileInfo> >(); if (fileInfos != null) { int nextindex = fileInfos.IndexOf(fileInfos.Find(x => x.index == listControl.GetSelectIndex()[0])) + 1; listControl.ToggleAllOff(); if (nextindex < listControl.GetInclusiveCount()) { listControl.SelectItem(fileInfos[nextindex].index); } } } } }