internal static void DisplayHSubtitle(LoadAudioBase voice) { List <HActionBase> lstProc = (List <HActionBase>)AccessTools.Field(HSceneType, "lstProc").GetValue(HSceneInstance); HFlag flags = (HFlag)Traverse.Create(HSceneInstance).Field("flags").GetValue(); HActionBase mode = lstProc[(int)flags.mode]; HVoiceCtrl voicectrl = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode); //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice. foreach (var a in voicectrl.dicVoiceIntos) { foreach (var b in a) { foreach (var c in b.Value) { var text = c.Value.Where(x => x.Value.pathAsset == voice.assetBundleName && x.Value.nameFile == voice.assetName).Select(x => x.Value.word).FirstOrDefault(); if (!text.IsNullOrEmpty()) { if (HSceneType == typeof(HSceneProc)) { DisplaySubtitle(voice.gameObject, text); } else { DisplayVRSubtitle(voice.gameObject, text); } return; } } } } }
internal static void DisplayHSubtitle(LoadVoice voice) { List <HActionBase> lstProc = (List <HActionBase>)AccessTools.Field(typeof(HSceneProc), "lstProc").GetValue(KK_Subtitles.HSceneProcInstance); HActionBase mode = lstProc[(int)KK_Subtitles.HSceneProcInstance.flags.mode]; HVoiceCtrl voicectrl = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode); //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice. string text = ""; FindText(); void FindText() { foreach (var a in voicectrl.dicVoiceIntos) { foreach (var b in a) { foreach (var c in b.Value) { text = c.Value.Where(x => x.Value.pathAsset == voice.assetBundleName && x.Value.nameFile == voice.assetName).Select(x => x.Value.word).FirstOrDefault(); if (!text.IsNullOrEmpty()) { return; } } } } } if (text.IsNullOrEmpty()) { return; } DisplaySubtitle(voice, text); }
internal static void DisplayHSubtitle(string asset, string bundle, GameObject voiceObject) { List <HActionBase> lstProc = (List <HActionBase>)AccessTools.Field(typeof(HSceneProc), "lstProc").GetValue(HSceneInstance); HFlag flags = (HFlag)Traverse.Create(HSceneInstance).Field("flags").GetValue(); HActionBase mode = lstProc[(int)flags.mode]; HVoiceCtrl voicectrl = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode); //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice. foreach (var a in voicectrl.dicVoiceIntos) { foreach (var b in a) { foreach (var c in b.Value) { var text = c.Value.Where(x => x.Value.pathAsset == bundle && x.Value.nameFile == asset).Select(x => x.Value.word).FirstOrDefault(); if (!text.IsNullOrEmpty()) { // try to replace name tags in subtitle ([P], etc.) before displaying DisplaySubtitle(voiceObject, PrepareSubtitle(text)); return; } } } } }
public static bool MotionChangeOverride(HActionBase __instance, ref bool __result) { if (motionChangeOld != null) { //If the animation was OLoop before the position change, set the current animation to SLoop, since beginning a new position in OLoop seems unnatural and requires a lot more work. __instance.SetPlay(motionChangeOld.Contains("OLoop") ? "SLoop" : motionChangeOld); __result = false; return(false); } return(true); }
internal static void DisplayHSubtitle(LoadVoice voice) { List <HActionBase> lstProc = (List <HActionBase>)AccessTools.Field(typeof(HSceneProc), "lstProc").GetValue(KK_Subtitles.HSceneProcInstance); HActionBase mode = lstProc[(int)KK_Subtitles.HSceneProcInstance.flags.mode]; HVoiceCtrl voicectrl = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode); //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice. string text = ""; FindText(); void FindText() { foreach (var a in voicectrl.dicVoiceIntos) { foreach (var b in a) { foreach (var c in b.Value) { text = c.Value.Where(x => x.Value.pathAsset == voice.assetBundleName && x.Value.nameFile == voice.assetName).Select(x => x.Value.word).FirstOrDefault(); if (!text.IsNullOrEmpty()) { return; } } } } } if (text.IsNullOrEmpty()) { return; } if (KK_Subtitles.showUntranslated.Value == false) { foreach (var x in text.ToList()) { if (JPChars.Contains(x)) { return; } } } //string speaker = voice.voiceTrans.gameObject.GetComponentInParent<ChaControl>().chaFile.parameter.firstname; DisplaySubtitle(voice, text); }
private Type FindProcDarkness() { switch (flags.mode) { case (HFlag.EMode.houshi3PMMF): proc = lstProc.OfType <H3PDarkHoushi>().FirstOrDefault(); hCategory = HCategory.service; return(typeof(H3PDarkHoushi)); case (HFlag.EMode.sonyu3PMMF): proc = lstProc.OfType <H3PDarkSonyu>().FirstOrDefault(); hCategory = HCategory.intercourse; return(typeof(H3PDarkSonyu)); default: return(null); } }
private Type FindProc() { switch (flags.mode) { case (HFlag.EMode.sonyu): proc = lstProc.OfType <HSonyu>().FirstOrDefault(); hCategory = HCategory.intercourse; return(typeof(HSonyu)); case (HFlag.EMode.houshi): proc = lstProc.OfType <HHoushi>().FirstOrDefault(); hCategory = HCategory.service; return(typeof(HHoushi)); case (HFlag.EMode.houshi3P): proc = lstProc.OfType <H3PHoushi>().FirstOrDefault(); hCategory = HCategory.service; return(typeof(H3PHoushi)); case (HFlag.EMode.aibu): proc = lstProc.OfType <HAibu>().FirstOrDefault(); hCategory = HCategory.maleNotVisible; return(typeof(HAibu)); case (HFlag.EMode.lesbian): proc = lstProc.OfType <HLesbian>().FirstOrDefault(); hCategory = HCategory.maleNotVisible; return(typeof(HLesbian)); case (HFlag.EMode.masturbation): proc = lstProc.OfType <HMasturbation>().FirstOrDefault(); hCategory = HCategory.maleNotVisible; return(typeof(HMasturbation)); case (HFlag.EMode.sonyu3P): proc = lstProc.OfType <H3PSonyu>().FirstOrDefault(); hCategory = HCategory.intercourse; return(typeof(H3PSonyu)); default: return(null); } }
public static bool MotionChangeOverrideDark(HActionBase __instance, ref bool __result) => MotionChangeOverride(__instance, ref __result);