/// <summary> /// Returns a ChaFileControl instance from the selected character in CharaMaker. /// </summary> public static ChaFileControl GetSelectedCharacter() { ChaCustom.CustomFileInfoComponent selected = Singleton <ChaCustom.CustomFileListCtrl> .Instance.GetSelectTopItem(); if (selected != null) { ChaFileControl tmp = new ChaFileControl(); tmp.LoadCharaFile(selected.info.FullPath, byte.MaxValue); return(tmp); } else { return(null); } }
/// <summary> /// Returns a ChaFileCoordinate instance from the selected coordinate in CharaMaker. /// </summary> public static ChaFileCoordinate GetSelectedCoordinate() { ChaCustom.CustomCoordinateFile clothesFile = Singleton <ChaCustom.CustomCoordinateFile> .Instance; ChaCustom.CustomFileListCtrl listCtrl = Traverse.Create(clothesFile).Field("listCtrl").GetValue <ChaCustom.CustomFileListCtrl>(); ChaCustom.CustomFileInfoComponent selected = listCtrl.GetSelectTopItem(); if (selected != null) { string fullPath = selected.info.FullPath; ChaFileCoordinate tmp = new ChaFileCoordinate(); tmp.LoadFile(fullPath); return(tmp); } else { return(null); } }