public static void AddPostfix(ChaControl _female, OICharInfo _info) { if (KK_FBIOpenUp._isenabled) { Patches.ChangeChara(_female); } }
public CharaLoadEventArgs(OICharInfo _chara, CharaLoadMode _mode, CharaLoadState _state) { ChaControl = GetChaControl(_chara); OCIChar = GetOCIChar(_chara); Mode = _mode; State = _state; }
private static void AddObjectChara_Load_Postfix(OICharInfo _info) { // only fires when loading scene Core.DebugLog($"AddObjectChara_Load_Postfix"); OnCharaLoad?.Invoke(null, new CharaLoadEventArgs(_info, CharaLoadMode.Load, CharaLoadState.Post)); Instance.StartCoroutine(AddObjectChara_Coroutine(GetOCIChar(_info), CharaLoadMode.Load)); }
public override void Scene_ImportChara(MsgObject message) { using (var fileStream = new FileStream(message.path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (var binaryReader = new BinaryReader(fileStream)) { long size = 0L; PngAssist.CheckPngData(binaryReader, ref size, true); var version = new Version(binaryReader.ReadString()); var sceneInfo = Studio.Studio.Instance.sceneInfo; var traverse = Traverse.Create(sceneInfo); traverse.Property("dicImport").SetValue(new Dictionary <int, ObjectInfo>()); traverse.Property("dicChangeKey").SetValue(new Dictionary <int, int>()); int num = binaryReader.ReadInt32(); for (int i = 0; i < num; i++) { int value = binaryReader.ReadInt32(); int type = binaryReader.ReadInt32(); if (type == 0) { var objectInfo = new OICharInfo(null, Studio.Studio.GetNewIndex()); objectInfo.Load(binaryReader, version, true, true); sceneInfo.dicObject.Add(objectInfo.dicKey, objectInfo); sceneInfo.dicImport.Add(objectInfo.dicKey, objectInfo); sceneInfo.dicChangeKey.Add(objectInfo.dicKey, value); } else { ObjectInfo objectInfo = null; switch (type) { case 1: objectInfo = new OIItemInfo(-1, Studio.Studio.GetNewIndex()); break; case 2: objectInfo = new OILightInfo(-1, Studio.Studio.GetNewIndex()); break; case 3: objectInfo = new OIFolderInfo(Studio.Studio.GetNewIndex()); break; default: Console.WriteLine($"対象外 : {type}"); break; } objectInfo.Load(binaryReader, version, true, true); } } } } AddObjectAssist.LoadChild(Studio.Studio.Instance.sceneInfo.dicImport, null, null); Studio.Studio.Instance.treeNodeCtrl.RefreshHierachy(); }
static void Postfix(ChaControl _male, OICharInfo _info) { var bmm = _male.human.GetOrAddComponent <BMMHuman>(); bmm.Name = _info.fileStatus.name; //bmm.reset = true; Console.WriteLine("\nBone modified on new male {0}. ", _info.fileStatus.name); }
public static void LoadPostFix(OICharInfo __instance) { if ((__instance.sex == 0 && StudioSimpleColorOnGirls.Force_Reset_Color_Boy.Value) || (__instance.sex == 1 && StudioSimpleColorOnGirls.Force_Reset_Color_Girl.Value)) { __instance.simpleColor = StudioSimpleColorOnGirls.Default_Color.Value; } }
public static OCIChar GetOCIChar(OICharInfo _chara) { if (Instance == null) { throw new InvalidOperationException("Studio is not initialized yet!"); } return(Instance.dicInfo.Values.OfType <OCIChar>().FirstOrDefault(x => x.charInfo.chaFile == _chara.charFile)); }
private static void AddPost(OCIChar __result, OICharInfo _info, bool enableReset) { if (enableReset) { _info.simpleColor = StudioSimpleColorOnGirls.Default_Color.Value; } __result.charInfo.fileStatus.visibleSimple = _info.visibleSimple; __result.charInfo.ChangeSimpleBodyColor(_info.simpleColor); }
private static void AddPostFix(ref OCICharFemale __result, OICharInfo _info) { if (KK_StudioSimpleColorOnGirls.Force_Reset_Color.Value) { _info.simpleColor = KK_StudioSimpleColorOnGirls.Default_Color.Value; } __result.charInfo.fileStatus.visibleSimple = _info.visibleSimple; __result.charInfo.ChangeSimpleBodyColor(_info.simpleColor); }
private static void AddObjectMalePostfix(OICharInfo _info, ChaControl _male, ref bool[] __state) { if (__state[0]) { EnableFKIK(_male); if (__state[1]) _info.activeFK[6] = true; } }
// Edited version of SceneInfo.Import void ImportSceneChara(string path) { using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (var binaryReader = new BinaryReader(fileStream)) { PngFile.SkipPng(binaryReader); var version = new Version(binaryReader.ReadString()); var sceneInfo = Studio.Studio.Instance.sceneInfo; var traverse = Traverse.Create(sceneInfo); traverse.Property("dicImport").SetValue(new Dictionary <int, ObjectInfo>()); traverse.Property("dicChangeKey").SetValue(new Dictionary <int, int>()); int num = binaryReader.ReadInt32(); for (int i = 0; i < num; i++) { int value = binaryReader.ReadInt32(); int type = binaryReader.ReadInt32(); if (type == 0) { var objectInfo = new OICharInfo(null, Studio.Studio.GetNewIndex()); objectInfo.Load(binaryReader, version, true, true); sceneInfo.dicObject.Add(objectInfo.dicKey, objectInfo); sceneInfo.dicImport.Add(objectInfo.dicKey, objectInfo); sceneInfo.dicChangeKey.Add(objectInfo.dicKey, value); } else if (type == 1) { var objectInfo = new OIItemInfo(-1, -1, -1, Studio.Studio.GetNewIndex()); objectInfo.Load(binaryReader, version, true, true); foreach (var item in FindCharacters(objectInfo.child)) { sceneInfo.dicObject.Add(item.dicKey, item); sceneInfo.dicImport.Add(item.dicKey, item); sceneInfo.dicChangeKey.Add(item.dicKey, value); } } else if (type == 3) { var objectInfo = new OIFolderInfo(Studio.Studio.GetNewIndex()); objectInfo.Load(binaryReader, version, true, true); foreach (var item in FindCharacters(objectInfo.child)) { sceneInfo.dicObject.Add(item.dicKey, item); sceneInfo.dicImport.Add(item.dicKey, item); sceneInfo.dicChangeKey.Add(item.dicKey, value); } } else { ObjectInfo objectInfo = null; switch (type) { case 2: objectInfo = new OILightInfo(-1, Studio.Studio.GetNewIndex()); break; case 4: objectInfo = new OIRouteInfo(Studio.Studio.GetNewIndex()); break; case 5: objectInfo = new OICameraInfo(Studio.Studio.GetNewIndex()); break; } objectInfo.Load(binaryReader, version, true, true); } } } } AddObjectAssist.LoadChild(Studio.Studio.Instance.sceneInfo.dicImport, null, null); Studio.Studio.Instance.treeNodeCtrl.RefreshHierachy(); }
private static void AddObjectFemalePrefix(OICharInfo _info, ref bool __state) => __state = _info.enableFK && _info.enableIK;
public static ChaControl GetChaControl(this OICharInfo _self) => CharaStudio.GetChaControl(_self);
private static void AddObjectChara_Load_Prefix(OICharInfo _info) { // only fires when loading scene Core.DebugLog($"AddObjectChara_Load_Prefix"); OnCharaLoad?.Invoke(null, new CharaLoadEventArgs(_info, CharaLoadMode.Load, CharaLoadState.Pre)); }
internal static void AddObjectMalePrefix(OICharInfo _info, ref bool __state) => __state = _info.enableFK && _info.enableIK;
private static void AddObjectMalePrefix(OICharInfo _info, ref bool[] __state) { __state = new bool[2]; __state[0] = _info.enableFK && _info.enableIK; __state[1] = _info.activeFK[6]; }
private List <string> ProcessScene(string pth) { var names = new List <string>(); using (var fileStream = new FileStream(pth, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (var reader = new BinaryReader(fileStream)) { PngFile.SkipPng(reader); var version = new Version(reader.ReadString()); var num = reader.ReadInt32(); var infos = ListPool <ObjectInfo> .Get(); for (var i = 0; i < num; i++) { var dummy = reader.ReadInt32(); var num2 = reader.ReadInt32(); ObjectInfo oICharInfo; switch (num2) { case 0: { oICharInfo = new OICharInfo(null, Studio.Studio.GetNewIndex()); break; } case 1: { oICharInfo = new OIItemInfo(-1, -1, -1, Studio.Studio.GetNewIndex()); break; } case 2: { oICharInfo = new OILightInfo(-1, Studio.Studio.GetNewIndex()); break; } case 3: { oICharInfo = new OIFolderInfo(Studio.Studio.GetNewIndex()); break; } case 4: { oICharInfo = new OIRouteInfo(Studio.Studio.GetNewIndex()); break; } case 5: { oICharInfo = new OICameraInfo(Studio.Studio.GetNewIndex()); break; } default: continue; } ResetHspe(); oICharInfo.Load(reader, version, true); infos.Add(oICharInfo); CollectNames(oICharInfo, ref names); } while (infos.Count > 0) { var info = infos[0]; infos.RemoveAt(0); info.DeleteKey(); } ListPool <ObjectInfo> .Release(infos); } } return(names); }
public static void AddPostFix2(ref OCICharMale __result, OICharInfo _info) => AddPost(__result, _info, StudioSimpleColorOnGirls.Force_Reset_Color_Boy.Value);