public static void HScene_SetStartVoice_ApplyClothesConfig(HScene __instance) { hScene = __instance; var hData = Manager.Config.HData; var males = __instance.GetMales(); if (males[0] != null) { foreach (var kind in clothesKindList.Where(kind => males[0].IsClothesStateKind(kind))) { males[0].SetClothesState(kind, (byte)(hData.Cloth ? 0 : 2)); } males[0].SetAccessoryStateAll(hData.Accessory); males[0].SetClothesState(7, (byte)(!hData.Shoes ? 2 : 0)); } if (males[1] != null) { foreach (var kind in clothesKindList.Where(kind => males[1].IsClothesStateKind(kind))) { males[1].SetClothesState(kind, (byte)(hData.Cloth ? 0 : 2)); } males[1].SetAccessoryStateAll(hData.Accessory); males[1].SetClothesState(7, (byte)(!hData.Shoes ? 2 : 0)); } }
protected override void OnLevel(int level) { base.OnLevel(level); Scene = GameObject.FindObjectOfType <HScene>(); StartCoroutine(DelayedInit()); }
private static void HScene_sceneUnloaded() { if (!patched) { return; } CoreGame.OnEndScene(); harmony.UnpatchAll(nameof(AI_BetterPenetration)); patched = false; inHScene = false; loadingCharacter = false; if (hScene == null) { return; } foreach (var lookat in hScene.ctrlLookAts) { if (lookat == null) { continue; } lookat.transLookAtNull = null; } hScene = null; }
void WindowFunc(int id) { if (hscene == null) { var obj = GameObject.Find("CommonSpace/HSceneSet/HScene"); if (obj) { hscene = obj.GetComponent <HScene>(); } GUILayout.Label("没有开始H"); } else { try { ListGUI(); GlobalMethod.setCameraMoveFlag(hscene.ctrlFlag.cameraCtrl, false); } catch (Exception e) { Logger.LogWarning(e.Message); } } GUI.DragWindow(); }
public void PrevScene2() { int index = int.Parse(curNum.text) - 1; if (index > 0) { SaveScene(list[index]); LoadScene(list[index - 1]); sn.Prev(); curNum.text = index + ""; } else if (index == 0) { HScene newScene = new HScene(); SaveScene(list[index]); LoadScene(newScene); list.Insert(index, newScene); sn.Add(0); curNum.text = 1 + ""; num.text = list.Count + ""; } }
public static void HScene_SetStartVoice_Patch(HScene __instance) { inHScene = true; Tools.SetupVariables(__instance); if (map != null && disableMap.Value) { map.SetActive(false); mapShouldEnable = true; } if (mapSimulation != null && disableMapSimulation.Value) { mapSimulation.SetActive(false); mapSimulationShouldEnable = true; } if (hCamera != null && unlockCamera.Value) { hCamera.isLimitDir = false; hCamera.isLimitPos = false; } if (hPointSearchRange.Value != 60 && hSprite != null) { hSprite.HpointSearchRange = hPointSearchRange.Value; } HScene_StripClothes(stripMaleClothes.Value == Tools.OffHStartAnimChange.OnHStart || stripFemaleClothes.Value == Tools.OffHStartAnimChange.OnHStart); }
public bool Init(ChaControl _female, int id) { this.Release(); this.ID = id; this.chaFemale = _female; this.NeckTrs = this.chaFemale.neckLookCtrl.neckLookScript.aBones[0].neckBone; this.HeadTrs = this.chaFemale.neckLookCtrl.neckLookScript.aBones[1].neckBone; this.EyeTrs = new Transform[2] { this.chaFemale.eyeLookCtrl.eyeLookScript.eyeObjs[0].eyeTransform, this.chaFemale.eyeLookCtrl.eyeLookScript.eyeObjs[1].eyeTransform }; this.BackUpNeck = this.NeckTrs.get_localRotation(); this.BackUpHead = this.HeadTrs.get_localRotation(); this.BackUpEye = new Quaternion[2] { this.EyeTrs[0].get_localRotation(), this.EyeTrs[1].get_localRotation() }; this.objGenitalSelf = (GameObject)null; if (Object.op_Implicit((Object)this.chaFemale) && Object.op_Implicit((Object)this.chaFemale.objBodyBone)) { this.LoopParent = this.chaFemale.objBodyBone.get_transform(); if (this.strFemaleGenital != string.Empty) { this.objGenitalSelf = this.GetObjectName(this.LoopParent, this.strFemaleGenital); } } if (Object.op_Equality((Object)this.hscene, (Object)null)) { this.hscene = (HScene)Singleton <HSceneManager> .Instance.HSceneSet.GetComponentInChildren <HScene>(); } return(true); }
static void HSceneEnd(HScene __instance, ChaControl[] ___chaFemales, ChaControl[] ___chaMales) { try { #if DEBUG AdditionalAccessoryControlsPlugin.Instance.Log.LogInfo("HScene End Event"); #endif foreach (ChaControl female in ___chaFemales) { if (female == null) { continue; } AdditionalAccessoryControlsController aacController = female.gameObject.GetComponent <AdditionalAccessoryControlsController>(); aacController.HandleVisibilityRules(hend: true); } foreach (ChaControl male in ___chaMales) { if (male == null) { continue; } AdditionalAccessoryControlsController aacController = male.gameObject.GetComponent <AdditionalAccessoryControlsController>(); aacController.HandleVisibilityRules(hend: true); } } catch (Exception e) { AdditionalAccessoryControlsPlugin.Instance.Log.LogWarning($"Exception in AACP Hook, Visibility Updates Not Thrown. {e.Message} {e.StackTrace}"); } }
private static void HScene_PostSetStartVoice(HScene __instance) { hScene = __instance; List <DanOptions> danOptions = PopulateDanOptionsList(); List <CollisionOptions> collisionOptions = PopulateCollisionOptionsList(); ChaControl[] femaleArray = hScene.GetFemales(); List <ChaControl> femaleList = new List <ChaControl>(); foreach (var character in femaleArray) { if (character == null) { continue; } femaleList.Add(character); } ChaControl[] maleArray = hScene.GetMales(); List <ChaControl> maleList = new List <ChaControl>(); foreach (var character in maleArray) { if (character == null) { continue; } maleList.Add(character); } CoreGame.InitializeAgents(maleList, femaleList, danOptions, collisionOptions); inHScene = true; }
static void HSceneLoad(HScene __instance, ChaControl[] ___chaFemales, ChaControl[] ___chaMales) { #if DEBUG AdditionalAccessoryControlsPlugin.Instance.Log.LogInfo("HScene Load Event"); #endif HStartInit = true; }
private void LoadScene(HScene scene) { sf.Reset(); ac.Init(); string[] onHolds = scene.GetOnHolds(); for (int i = (int)AvatarControl.BODYS.RH; i <= (int)AvatarControl.BODYS.LF; i++) { if (!string.IsNullOrEmpty(onHolds[i])) { Transform t = holds.Find(onHolds[i]); if (t != null) { Hold hold = t.gameObject.GetComponent <Hold>(); sf.SetFocusHold(i, hold); ac.SetFixed(i, true); } } } cs.SetComments(scene.GetComments()); if (scene.IsPose()) { ik.SetPose(scene.GetPose(), scene.GetPRotate()); } else { ik.InitAvatar(); } }
private void SaveScene(HScene scene) { scene.SaveOnHolds(sf.GetFocusHold()); scene.SaveComments(cs.GetComments()); scene.SavePose(ik.GetPosition()); scene.SavePRotate(ik.GetRotation()); }
public void RemoveScene() { int index = int.Parse(curNum.text) - 1; int nextIndex; int n = int.Parse(num.text); HScene next; if (n == 1) { next = new HScene(); list.Add(next); sn.Add(1); nextIndex = 1; } else if (index == 0) { next = list[1]; nextIndex = 1; } else { next = list[index - 1]; nextIndex = index; } list.RemoveAt(index); LoadScene(next); sn.Remove(index); curNum.text = nextIndex + ""; num.text = list.Count + ""; }
private static void OnHEnd(HScene proc) { foreach (var behaviour in _registeredHandlers) { try { behaviour.Key.OnEndH(proc, false); } catch (Exception e) { KoikatuAPI.Logger.LogError(e); } } try { EndH?.Invoke(KoikatuAPI.Instance, EventArgs.Empty); } catch (Exception e) { KoikatuAPI.Logger.LogError(e); } InsideHScene = false; }
public void Mimic(GameObject cam) { scene = GameObject.FindObjectOfType <BaseScene>(); if (cam == null) { ApplyToCameras(ovrCamera => { ovrCamera.nearClipPlane = Mathf.Clamp(0.01f, 0.001f, 0.01f); ovrCamera.farClipPlane = Mathf.Clamp(50f, 50f, 200f); ovrCamera.cullingMask = LayerMask.GetMask(QUAD_LAYER); ovrCamera.backgroundColor = Color.white; ovrCamera.clearFlags = CameraClearFlags.Skybox; }); transform.parent = null; GUI.UpdateGUI(false, false); follow = null; Base = transform; } else { var backCamera = GameObject.Find("BackCamera"); ApplyToCameras(ovrCamera => { ovrCamera.nearClipPlane = Mathf.Clamp(0.01f, 0.001f, 0.01f); ovrCamera.farClipPlane = Mathf.Clamp(100f, 50f, 200f); ovrCamera.cullingMask = cam.camera.cullingMask; ovrCamera.clearFlags = CameraClearFlags.Color; if (backCamera != null) { ovrCamera.backgroundColor = backCamera.camera.backgroundColor; } //Console.WriteLine(ovrCamera.clearFlags); //var skybox = cam.GetComponent<Skybox>(); //if (skybox != null) //{ // var ovrSkybox = ovrCamera.gameObject.GetComponent<Skybox>(); // if (ovrSkybox == null) ovrSkybox = ovrSkybox.gameObject.AddComponent<Skybox>(); // ovrSkybox.material = skybox.material; //} }); hscene = GameObject.FindObjectOfType <HScene>(); transform.parent = null; cam.camera.cullingMask = 0; GUI.UpdateGUI(true, hscene == null); follow = cam.transform; Base = follow; } transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; SetRotationLock(lockRotation); }
public override void OnStart() { base.OnStart(); _HScene = GameObject.FindObjectOfType <HScene>(); //VRLog.Info("Got HScene object: {0}", _HScene != null); VRLog.Info("Starting HSceneInterpreter."); }
public static void EndProc(HScene __instance) { savedOffset = Vector3.zero; for (int i = 0; i < savedControls.Length; i++) { savedControls[i] = null; } }
public static void HScene_OnDisable_HeightPostfix(HScene __instance) { AI_UnlockPlayerHeight.inH = false; if (__instance != null && AI_UnlockPlayerHeight.actor != null) { AI_UnlockPlayerHeight.ApplySettings(AI_UnlockPlayerHeight.actor); } }
public static void HSceneSetStartVoicePrefix(HScene __instance) { if (__instance == null) { return; } StartHScene(__instance); }
public static void HScene_InitCoroutine_HeightPostfix(HScene __instance) { AI_UnlockPlayerHeight.inH = true; if (__instance != null && AI_UnlockPlayerHeight.actor != null) { AI_UnlockPlayerHeight.ApplySettings(AI_UnlockPlayerHeight.actor); } }
private static void HScene_ChangeAnimation(HScene __instance, HScene.AnimationListInfo _info) { if (!inHScene) { return; } changingAnimations = true; }
public void Init() { this.hScene = (HScene)((Component)Singleton <HSceneFlagCtrl> .Instance).GetComponent <HScene>(); this.hSceneManager = Singleton <HSceneManager> .Instance; this.females = this.hScene.GetFemales(); this.SetClothCharacter(true); // ISSUE: method pointer this.hSceneSpriteChaChoice.SetAction(new UnityAction((object)this, __methodptr(\u003CInit\u003Em__0))); }
public static void HScene_SetStartAnimationInfo_HeightPostfix(HScene __instance, HSceneManager ___hSceneManager) { manager = ___hSceneManager; males = __instance.GetMales(); HS2_UnlockPlayerHeight.chara = males[0]; HS2_UnlockPlayerHeight.chara2nd = males[1]; HS2_UnlockPlayerHeight.cardHeightValue = 0.75f; HS2_UnlockPlayerHeight.cardHeightValue2nd = 0.75f; var png1 = manager.pngMale; if (HS2_UnlockPlayerHeight.chara != null && png1 != null) { if (png1 == "") { png1 = HS2_UnlockPlayerHeight.chara.chaFile.charaFileName; if (png1 == "") { png1 = "HS2_ill_M_000"; } } var card = new ChaFileControl(); if (manager.bFutanari && card.LoadCharaFile(png1, 1, true) || card.LoadCharaFile(png1, 255, true)) { HS2_UnlockPlayerHeight.cardHeightValue = card.custom.body.shapeValueBody[0]; HS2_UnlockPlayerHeight.ApplySettings(false); } } var png2 = manager.pngMaleSecond; if (HS2_UnlockPlayerHeight.chara2nd != null && png2 != null) { if (png2 == "") { png2 = HS2_UnlockPlayerHeight.chara2nd.chaFile.charaFileName; if (png2 == "") { png2 = "HS2_ill_M_000"; } } var card = new ChaFileControl(); if (manager.bFutanariSecond && card.LoadCharaFile(png2, 1, true) || card.LoadCharaFile(png2, 255, true)) { HS2_UnlockPlayerHeight.cardHeightValue2nd = card.custom.body.shapeValueBody[0]; HS2_UnlockPlayerHeight.ApplySettings(true); } } }
protected override void OnEndH(HScene proc, bool freeH) { InsideHScene = false; // Destroy(proc.GetComponent<LactationController>()); //Add later // Figure out if conception happened at end of h scene var heroine = Manager.HSceneManager.Instance?.Agent[0]?.AgentData; if (heroine == null) { return; } var controller = heroine.GetNPC().ChaControl.GetComponent <PregnancyCharaController>(); if (controller == null) { throw new ArgumentNullException(nameof(controller)); } //In AI see if the current day is a risky day if (!controller.isDangerousDay) { return; } var cameInside = PregnancyPlugin.ConceptionEnabled.Value && proc.ctrlFlag.numInside > 0; var cameInsideAnal = PregnancyPlugin.AnalConceptionEnabled.Value && proc.ctrlFlag.numAnal > 0; if (cameInside || cameInsideAnal) { //Allow pregnancy if enabled, or overridden, and is not currently pregnant if (!controller.Data.GameplayEnabled || controller.Data.IsPregnant) { return; } var fertility = Mathf.Max(PregnancyPlugin.FertilityOverride.Value, controller.Data.Fertility); var winThreshold = Mathf.RoundToInt(fertility * 100); var childLottery = Random.Range(1, 100); //Logger.Log(LogLevel.Debug, $"Preg - OnEndH calc pregnancy chance {childLottery} to {winThreshold}"); var wonAChild = winThreshold >= childLottery; if (wonAChild) { // PregnancyPlugin.Logger.LogDebug("Preg - child lottery won, pregnancy will start"); //In AI we have to immediately set the preg state, or we lose it if the user saves and exits before PeriodChange _startedPregnancies.Add(heroine); ProcessPendingChanges(); //Keep charaCtrl's copy in sync controller.Data.StartPregnancy(); } } }
private static void HScene_ChangeAnimation(HScene __instance, HScene.AnimationListInfo _info) { if (!inHScene) { return; } for (int maleNum = 0; maleNum < male_list.Length; maleNum++) { changingAnimations[maleNum] = true; } }
public void AddScene() { int index = int.Parse(curNum.text) - 1; HScene scene = new HScene(); SaveScene(list[index]); LoadScene(scene); list.Insert(index + 1, scene); sn.Add(index + 1); curNum.text = index + 2 + ""; num.text = int.Parse(num.text) + 1 + ""; }
public static void HSceneStart(HScene __instance) { var traverse = Traverse.Create(__instance); CanvasGroup UIGroup = traverse.Field("sprite").Field("UIGroup").GetValue <CanvasGroup>(); if (UIGroup == null) { return; } currentUIHandler = new HideHSceneUI(UIGroup); }
public static void HScene_EndProc_Patch() { activeDraggerUI = false; activeAnimationUI = false; if (characters != null) { characters.Clear(); characters = null; } hScene = null; hSprite = null; hFlagCtrl = null; }
public static void OnChangeAnimation(HScene __instance, HScene.AnimationListInfo _info, bool _isForceResetCamera, bool _isForceLoopAction = false, bool _UseFade = true) { var isGroundAnimation = Constant.StandingAnimations.Contains(_info.id); var females = __instance.GetFemales(); foreach (var female in females) { var femaleApiController = GetAPIController(female); if (femaleApiController != null) { femaleApiController.GroundAnim = isGroundAnimation; femaleApiController?.UpdateHover(); } } }
public static void ChangeAnimation(HScene __instance, HScene.AnimationListInfo _info, bool _isForceResetCamera, bool _isForceLoopAction = false, bool _UseFade = true) { ChaControl[] chaFemales = Traverse.Create(__instance).Field("chaFemales").GetValue <ChaControl[]>(); ChaControl[] chaMales = Traverse.Create(__instance).Field("chaMales").GetValue <ChaControl[]>(); ChaControl mainChar = chaFemales[0]; HeelsController mainCharController = GetAPIController(mainChar); if (mainCharController?.currentConfig != null) { isChanging = true; savedOffset = mainCharController.currentConfig.rootMove; if (whitelist.ContainsKey(_info.assetpathFemale) && whitelist[_info.assetpathFemale] != null) { Dictionary <int, bool> idDict = whitelist[_info.assetpathFemale]; if (idDict.ContainsKey(_info.id) && idDict[_info.id]) { isElevated = true; } else { isElevated = false; } } else { isElevated = false; } if (chaFemales[0] != null) { savedControls[0] = chaFemales[0]; } if (chaFemales[1] != null) { savedControls[1] = chaFemales[1]; } if (chaMales[0] != null) { savedControls[2] = chaMales[0]; } if (chaMales[1] != null) { savedControls[3] = chaMales[1]; } } }