private void Start() { #if !EC if (StudioAPI.InsideStudio) { enabled = false; var cat = StudioAPI.GetOrCreateCurrentStateCategory("Overlays"); cat.AddControl(new CurrentStateCategorySwitch("Skin overlays", c => c.charInfo.GetComponent <KoiSkinOverlayController>().EnableInStudioSkin)).Value.Subscribe( v => StudioAPI.GetSelectedControllers <KoiSkinOverlayController>().Do(c => { if (c.EnableInStudioSkin != v) { c.EnableInStudioSkin = v; c.UpdateTexture(TexType.Unknown); } })); cat.AddControl(new CurrentStateCategorySwitch("Eye overlays", c => c.charInfo.GetComponent <KoiSkinOverlayController>().EnableInStudioIris)).Value.Subscribe( v => StudioAPI.GetSelectedControllers <KoiSkinOverlayController>().Do(c => { if (c.EnableInStudioIris != v) { c.EnableInStudioIris = v; c.UpdateTexture(TexType.EyeUnder); } })); return; } #endif MakerAPI.RegisterCustomSubCategories += RegisterCustomSubCategories; MakerAPI.MakerExiting += MakerExiting; CharacterApi.CharacterReloaded += (sender, args) => OnChaFileLoaded(); }
private static void RegisterStudioControls() { CurrentStateCategoryToggle CreateToggle(string name, int textureCount, Action <SkinEffectsController, int> set, Func <SkinEffectsController, int> get) { var tgl = new CurrentStateCategoryToggle(name, Mathf.Min(4, textureCount + 1), c => RescaleStudioLevel(get(c.charInfo.GetComponent <SkinEffectsController>()), textureCount, 3)); tgl.Value.Subscribe(Observer.Create((int x) => { foreach (var controller in StudioAPI.GetSelectedControllers <SkinEffectsController>()) { set(controller, RescaleStudioLevel(x, tgl.ToggleCount - 1, textureCount)); } })); return(tgl); } var sweatTgl = CreateToggle("Sweat", TextureLoader.WetTexturesFaceCount, (controller, i) => controller.SweatLevel = i, controller => controller.SweatLevel); var tearsTgl = CreateToggle("Tears", TextureLoader.TearTexturesCount, (controller, i) => controller.TearLevel = i, controller => controller.TearLevel); var droolTgl = CreateToggle("Drool", TextureLoader.DroolTexturesCount, (controller, i) => controller.DroolLevel = i, controller => controller.DroolLevel); var cumTgl = CreateToggle("Bukkake", TextureLoader.CumTexturesCount, (controller, i) => controller.BukkakeLevel = i, controller => controller.BukkakeLevel); var bldTgl = CreateToggle("Virgin blood", TextureLoader.BldTexturesCount, (controller, i) => controller.BloodLevel = i, controller => controller.BloodLevel); StudioAPI.GetOrCreateCurrentStateCategory("Additional skin effects").AddControls(sweatTgl, tearsTgl, droolTgl, cumTgl, bldTgl); }
private static void CreateStudioControls() { var currentStateCategory = StudioAPI.GetOrCreateCurrentStateCategory(null); var list = CrestInterfaceList.Create(false, false); int ReadValue(OCIChar c) { var crest = c.GetChaControl().GetComponent <LewdCrestXController>().CurrentCrest; return(list.GetIndex(crest)); } void SetValue(int i) { var crest = list.GetType(i); foreach (var controller in StudioAPI.GetSelectedControllers <LewdCrestXController>()) { controller.CurrentCrest = crest; } } currentStateCategory.AddControl(new CurrentStateCategoryDropdown("Lewd Crest", list.GetInterfaceNames(), ReadValue)).Value.Subscribe(SetValue); currentStateCategory.AddControl(new CurrentStateCategorySwitch("Lewd Crest visible", c => c.GetChaControl().GetComponent <LewdCrestXController>().HideCrestGraphic)).Value.Subscribe( b => StudioAPI.GetSelectedControllers <LewdCrestXController>().Do(ctrl => ctrl.HideCrestGraphic = b)); }
internal static void RegisterStudioControls() { if (!Running) { return; } Loaded = true; CurrentStateCategorySwitch StudioToggleEnable = new CurrentStateCategorySwitch("Enable", OCIChar => (bool)GetController(OCIChar)?.FunctionEnable); StudioToggleEnable.Value.Subscribe(_value => { CharacterAccessoryController _pluginCtrl = StudioAPI.GetSelectedControllers <CharacterAccessoryController>().FirstOrDefault(); if (_pluginCtrl == null) { return; } _pluginCtrl.FunctionEnable = _value; }); StudioAPI.GetOrCreateCurrentStateCategory("CharaAcc").AddControl(StudioToggleEnable); CurrentStateCategorySwitch StudioToggleAutoCopyToBlank = new CurrentStateCategorySwitch("Auto Copy To Blank", OCIChar => (bool)GetController(OCIChar)?.AutoCopyToBlank); StudioToggleAutoCopyToBlank.Value.Subscribe(_value => { CharacterAccessoryController _pluginCtrl = StudioAPI.GetSelectedControllers <CharacterAccessoryController>().FirstOrDefault(); if (_pluginCtrl == null) { return; } _pluginCtrl.AutoCopyToBlank = _value; }); StudioAPI.GetOrCreateCurrentStateCategory("CharaAcc").AddControl(StudioToggleAutoCopyToBlank); List <string> coordinateList = Enum.GetNames(typeof(ChaFileDefine.CoordinateType)).ToList(); coordinateList.Add("CharaAcc"); CurrentStateCategoryDropdown StudioDropdownRef = new CurrentStateCategoryDropdown("Referral", coordinateList.ToArray(), OCIChar => (int)GetController(OCIChar)?.ReferralIndex); StudioDropdownRef.Value.Subscribe(_value => { CharacterAccessoryController _pluginCtrl = StudioAPI.GetSelectedControllers <CharacterAccessoryController>().FirstOrDefault(); if (_pluginCtrl == null) { return; } _pluginCtrl.SetReferralIndex(_value); }); StudioAPI.GetOrCreateCurrentStateCategory("CharaAcc").AddControl(StudioDropdownRef); }
//No studio for EC private static void RegisterStudioControls() { if (!StudioAPI.InsideStudio) { return; } var pushupBraToggle = new CurrentStateCategorySwitch("Pushup Bra", ocichar => ocichar.charInfo.GetComponent <PushupController>().CurrentBraData.EnablePushup); StudioAPI.GetOrCreateCurrentStateCategory("Pushup").AddControl(pushupBraToggle); pushupBraToggle.Value.Subscribe(value => { bool first = true; foreach (var controller in StudioAPI.GetSelectedControllers <PushupController>()) { if (first && controller.CurrentBraData.EnablePushup == value) { break; } first = false; controller.CurrentBraData.EnablePushup = value; controller.RecalculateBody(); } }); var pushupTopToggle = new CurrentStateCategorySwitch("Pushup Top", ocichar => ocichar.charInfo.GetComponent <PushupController>().CurrentTopData.EnablePushup); StudioAPI.GetOrCreateCurrentStateCategory("Pushup").AddControl(pushupTopToggle); pushupTopToggle.Value.Subscribe(value => { bool first = true; foreach (var controller in StudioAPI.GetSelectedControllers <PushupController>()) { if (first && controller.CurrentTopData.EnablePushup == value) { break; } first = false; controller.CurrentTopData.EnablePushup = value; controller.RecalculateBody(); } }); }
private void CreateInterface() { if (!StudioAPI.InsideStudio) { MakerAPI.MakerBaseLoaded += (sender, e) => { #if KK || KKS var cat = KKABMX.GUI.InterfaceData.BodyGenitals; #elif AI var cat = MakerConstants.Body.Lower; #endif e.AddControl(new MakerRadioButtons(cat, this, "Enable crotch bulge", (int)DefaultBulgeState.Value, "Auto", "Always", "Never")) .BindToFunctionController <BulgeController, int>(controller => (int)controller.EnableBulge, (controller, value) => controller.EnableBulge = (BulgeEnableLevel)value); e.AddControl(new MakerText("Auto will enable the bulge only if the character has a shlong (either male or added with UncensorSelector).\nThe effect is applied only when wearing clothes.", cat, this) { TextColor = MakerText.ExplanationGray }); e.AddControl(new MakerSlider(cat, "Bulge size", 0, 1, DefaultBulgeSize.Value, this)) .BindToFunctionController <BulgeController, float>(controller => controller.BulgeSize, (controller, value) => controller.BulgeSize = value); }; } else { var category = StudioAPI.GetOrCreateCurrentStateCategory(null); category.AddControl(new CurrentStateCategoryDropdown( "Enable crotch bulge", new[] { "Auto", "Always", "Never" }, c => (int)c.charInfo.GetComponent <BulgeController>().EnableBulge)).Value.Subscribe(val => { foreach (var controller in StudioAPI.GetSelectedControllers <BulgeController>()) { controller.EnableBulge = (BulgeEnableLevel)val; } }); category.AddControl(new CurrentStateCategorySlider("Bulge size", c => c.charInfo.GetComponent <BulgeController>().BulgeSize)).Value.Subscribe(val => { foreach (var controller in StudioAPI.GetSelectedControllers <BulgeController>()) { controller.BulgeSize = val; } }); } }
private static void RegisterStudioControls() { var invisibleSwitch = new CurrentStateCategorySwitch("Shaking Eye Highlights", controller => controller.charInfo.GetComponent <EyeShakingController>().EyeShaking); invisibleSwitch.Value.Subscribe(Observer.Create((bool value) => { bool first = true; foreach (var controller in StudioAPI.GetSelectedControllers <EyeShakingController>()) { //Prevent changing other characters when the value did not actually change if (first && controller.EyeShaking == value) { break; } first = false; controller.EyeShaking = value; } })); StudioAPI.GetOrCreateCurrentStateCategory("").AddControl(invisibleSwitch); }
private static void RegisterStudioControls() { var cat = StudioAPI.GetOrCreateCurrentStateCategory(null); cat.AddControl(new CurrentStateCategorySlider("Pregnancy", c => { if (c.charInfo == null) { return(0); } var controller = c.charInfo.GetComponent <PregnancyCharaController>(); if (controller == null) { return(0); } return(controller.Data.Week); }, 0, 40)) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyCharaController>()) { ctrl.Data.Week = Mathf.RoundToInt(f); } }); }
private static Human GetCurrentVisibleGirl() { if (MakerAPI.InsideMaker) { return(MakerAPI.GetCharacterControl()); } var m = GameObject.Find("CharaPosition/MainFemale"); var f = m?.GetComponentInChildren <Female>(); if (f != null) { return(f); } if (StudioAPI.InsideStudio) { var c = StudioAPI.GetSelectedControllers <BoneController>().FirstOrDefault(); return(c?.ChaControl); } return((Human)FindObjectOfType <Female>() ?? FindObjectOfType <Male>()); }
public static void RegisterStudioControllerBasic() { if (!StudioAPI.InsideStudio) { return; } var bpEnable = new CurrentStateCategorySwitch("Enable BP Controller", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().enabled); bpEnable.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { if (value == false) { controller.ClearDanAgent(); controller.enabled = false; } else { controller.enabled = true; controller.InitializeDanAgent(); controller.AddDanConstraints(nodeConstraintPlugin); } } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(bpEnable); var colliderRadiusScale = new CurrentStateCategorySlider("Collilder Radius Scale", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanColliderRadiusScale, 0.5f, 1.5f); colliderRadiusScale.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanColliderRadiusScale = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(colliderRadiusScale); var colliderLengthScale = new CurrentStateCategorySlider("Collilder Length Scale", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanColliderLengthScale, 0.5f, 1.5f); colliderLengthScale.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanColliderLengthScale = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(colliderLengthScale); var lengthSlider = new CurrentStateCategorySlider("Length Squish", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanLengthSquish, 0f, 1f); lengthSlider.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanLengthSquish = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(lengthSlider); var girthSlider = new CurrentStateCategorySlider("Girth Squish", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanGirthSquish, 0f, 2f); girthSlider.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanGirthSquish = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(girthSlider); var thresholdSlider = new CurrentStateCategorySlider("Squish Threshold", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanSquishThreshold, 0f, 1f); thresholdSlider.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanSquishThreshold = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(thresholdSlider); var autoTargeter = new CurrentStateCategoryDropdown("Auto-Target", new string[] { "Off", "Vaginal", "Anal", "Oral" }, c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanAutoTarget); autoTargeter.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanAutoTarget = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(autoTargeter); var maxPush = new CurrentStateCategorySlider("Max Push", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().MaxPush, 0f, 0.3f); maxPush.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.MaxPush = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(maxPush); var maxPull = new CurrentStateCategorySlider("Max Pull", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().MaxPull, 0f, 0.3f); maxPull.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.MaxPull = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(maxPull); var pullRate = new CurrentStateCategorySlider("Pull Rate", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().PullRate, 0f, 50f); pullRate.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.PullRate = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(pullRate); var returnRate = new CurrentStateCategorySlider("Return Rate", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().ReturnRate, 0f, 1f); returnRate.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.ReturnRate = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(returnRate); var bellyBulgeEnable = new CurrentStateCategorySwitch("Enable Belly Bulge", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().EnableBellyBulge); bellyBulgeEnable.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.EnableBellyBulge = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(bellyBulgeEnable); var bellyBulgeScale = new CurrentStateCategorySlider("Belly Bulge Scale", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().BellyBulgeScale, 0.0f, 3.0f); bellyBulgeScale.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.BellyBulgeScale = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(bellyBulgeScale); }
private static void RegisterStudioControls() { cat = StudioAPI.GetOrCreateCurrentStateCategory("Pregnancy +"); cat.AddControl(new CurrentStateCategorySwitch("Reset P+ Shape", c => { return(false); })) .Value.Subscribe(f => { if (f == false) { return; } ResetAllSliders(); }); cat.AddControl(new CurrentStateCategorySwitch("Restore Last P+ Shape", c => { return(false); })) .Value.Subscribe(f => { if (f == false) { return; } if (PregnancyPlusPlugin.lastBellyState.HasAnyValue()) { RestoreSliders(PregnancyPlusPlugin.lastBellyState); } }); cat.AddControl(new CurrentStateCategorySwitch(blendshapeText, c => { return(false); })) .Value.Subscribe(f => { if (f == false) { return; } //Open blendshape GUI on click foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { ctrl.OnOpenBlendShapeSelected(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationSize, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationSize : 0); }, SliderRange.inflationSize[0], SliderRange.inflationSize[1] )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationSize == f) { continue; } ctrl.infConfig.inflationSize = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationMultiplier, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationMultiplier: 0); }, SliderRange.inflationMultiplier[0], SliderRange.inflationMultiplier[1] )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationMultiplier == f) { continue; } ctrl.infConfig.inflationMultiplier = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationRoundness, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationRoundness: 0); }, SliderRange.inflationRoundness[0] * scaleLimits, SliderRange.inflationRoundness[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationRoundness == f) { continue; } ctrl.infConfig.inflationRoundness = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationMoveY, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationMoveY: 0); }, SliderRange.inflationMoveY[0] * scaleLimits, SliderRange.inflationMoveY[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationMoveY == f) { continue; } ctrl.infConfig.inflationMoveY = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationMoveZ, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationMoveZ: 0); }, SliderRange.inflationMoveZ[0] * scaleLimits, SliderRange.inflationMoveZ[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationMoveZ == f) { continue; } ctrl.infConfig.inflationMoveZ = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationStretchX, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationStretchX: 0); }, SliderRange.inflationStretchX[0] * scaleLimits, SliderRange.inflationStretchX[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationStretchX == f) { continue; } ctrl.infConfig.inflationStretchX = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationStretchY, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationStretchY: 0); }, SliderRange.inflationStretchY[0] * scaleLimits, SliderRange.inflationStretchY[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationStretchY == f) { continue; } ctrl.infConfig.inflationStretchY = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationShiftY, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationShiftY: 0); }, SliderRange.inflationShiftY[0] * scaleLimits, SliderRange.inflationShiftY[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationShiftY == f) { continue; } ctrl.infConfig.inflationShiftY = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationShiftZ, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationShiftZ: 0); }, SliderRange.inflationShiftZ[0] * scaleLimits, SliderRange.inflationShiftZ[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationShiftZ == f) { continue; } ctrl.infConfig.inflationShiftZ = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationTaperY, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationTaperY: 0); }, SliderRange.inflationTaperY[0] * scaleLimits, SliderRange.inflationTaperY[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationTaperY == f) { continue; } ctrl.infConfig.inflationTaperY = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationTaperZ, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationTaperZ: 0); }, SliderRange.inflationTaperZ[0] * scaleLimits, SliderRange.inflationTaperZ[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationTaperZ == f) { continue; } ctrl.infConfig.inflationTaperZ = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationClothOffset, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationClothOffset: 0); }, SliderRange.inflationClothOffset[0] * scaleLimits, SliderRange.inflationClothOffset[1] * scaleLimits )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationClothOffset == f) { continue; } ctrl.infConfig.inflationClothOffset = f; ctrl.MeshInflate(); } }); cat.AddControl(new CurrentStateCategorySlider(inflationFatFold, c => { var ctrl = GetCharCtrl(c); return(ctrl != null ? ctrl.infConfig.inflationFatFold: 0); }, SliderRange.inflationFatFold[0], SliderRange.inflationFatFold[1] )) .Value.Subscribe(f => { foreach (var ctrl in StudioAPI.GetSelectedControllers <PregnancyPlusCharaController>()) { if (ctrl.infConfig.inflationFatFold == f) { continue; } ctrl.infConfig.inflationFatFold = f; ctrl.MeshInflate(); } }); }
public static void RegisterStudioControls() { if (!StudioAPI.InsideStudio) { return; } var bpEnable = new CurrentStateCategorySwitch("Enable BP Controller", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().enabled); bpEnable.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.enabled = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(bpEnable); var lengthSlider = new CurrentStateCategorySlider("Length Squish", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanLengthSquish, 0f, 1f); lengthSlider.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanLengthSquish = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(lengthSlider); var girthSlider = new CurrentStateCategorySlider("Girth Squish", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanGirthSquish, 0f, 2f); girthSlider.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanGirthSquish = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(girthSlider); var thresholdSlider = new CurrentStateCategorySlider("Squish Threshold", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanSquishThreshold, 0f, 1f); thresholdSlider.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanSquishThreshold = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(thresholdSlider); var colliderRadius = new CurrentStateCategorySlider("Collilder Radius", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanColliderRadius, 0f, 1f); colliderRadius.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanColliderRadius = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(colliderRadius); var colliderLength = new CurrentStateCategorySlider("Collilder Length", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanColliderLength, 0f, 1f); colliderLength.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanColliderLength = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(colliderLength); var colliderVertical = new CurrentStateCategorySlider("Collilder Vertical", c => StudioAPI.GetSelectedControllers <BetterPenetrationController>().First().DanColliderVertical, -0.1f, 0.1f); colliderVertical.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <BetterPenetrationController>()) { controller.DanColliderVertical = value; } }); StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(colliderVertical); }
private static void RegisterStudioControls() { if (!StudioAPI.InsideStudio) { return; } List <string> bodyList = new List <string>(); List <string> bodyListDisplay = new List <string>(); foreach (var x in BodyDictionary) { bodyList.Add(x.Value.BodyGUID); bodyListDisplay.Add(x.Value.DisplayName); } var bodyDropdown = new CurrentStateCategoryDropdown("Uncensor", bodyListDisplay.ToArray(), c => BodyIndex()); bodyDropdown.Value.Subscribe(value => { bool first = true; foreach (var controller in StudioAPI.GetSelectedControllers <UncensorSelectorController>()) { #if AI || HS2 //Hide the body dropdown for male characters if (first) { if (controller.ChaControl.sex == 0) { bodyDropdown.Visible.OnNext(false); } else { bodyDropdown.Visible.OnNext(true); } } if (controller.ChaControl.sex == 0) { continue; } #endif var guid = bodyList[value]; //Prevent changing other characters when the value did not actually change if (first && controller.BodyData?.BodyGUID == guid) { break; } first = false; controller.BodyGUID = guid; controller.UpdateUncensor(); } }); int BodyIndex() { var controller = StudioAPI.GetSelectedControllers <UncensorSelectorController>().First(); return(bodyList.IndexOf(controller.BodyData?.BodyGUID)); } StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(bodyDropdown); List <string> penisList = new List <string>(); List <string> penisListDisplay = new List <string>(); foreach (var x in PenisDictionary) { penisList.Add(x.Value.PenisGUID); penisListDisplay.Add(x.Value.DisplayName); } var penisDropdown = new CurrentStateCategoryDropdown("Penis", penisListDisplay.ToArray(), c => PenisIndex()); penisDropdown.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <UncensorSelectorController>()) { var guid = penisList[value]; if (controller.PenisData?.PenisGUID != guid) { controller.PenisGUID = guid; controller.UpdateUncensor(); } } }); int PenisIndex() { var controller = StudioAPI.GetSelectedControllers <UncensorSelectorController>().First(); if (controller.PenisData?.PenisGUID == null) { return(penisList.IndexOf(DefaultPenisGUID)); } return(penisList.IndexOf(controller.PenisData.PenisGUID)); } StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(penisDropdown); List <string> ballsList = new List <string>(); List <string> ballsListDisplay = new List <string>(); ballsList.Add("None"); ballsListDisplay.Add("None"); foreach (var x in BallsDictionary) { ballsList.Add(x.Value.BallsGUID); ballsListDisplay.Add(x.Value.DisplayName); } var ballsDropdown = new CurrentStateCategoryDropdown("Balls", ballsListDisplay.ToArray(), c => BallsIndex()); ballsDropdown.Value.Subscribe(value => { foreach (var controller in StudioAPI.GetSelectedControllers <UncensorSelectorController>()) { if (value == 0)//"None" { if (controller.BallsGUID != null) { controller.BallsGUID = null; controller.DisplayBalls = false; controller.UpdateUncensor(); } } else { var guid = ballsList[value]; controller.BallsGUID = guid; controller.DisplayBalls = true; controller.UpdateUncensor(); } } }); int BallsIndex() { var controller = StudioAPI.GetSelectedControllers <UncensorSelectorController>().First(); if (controller.DisplayBalls == false) { return(ballsList.IndexOf("None")); } if (controller.BallsData?.BallsGUID == null) { return(ballsList.IndexOf(DefaultBallsGUID)); } return(ballsList.IndexOf(controller.BallsData?.BallsGUID)); } StudioAPI.GetOrCreateCurrentStateCategory(StudioCategoryName).AddControl(ballsDropdown); }
private static void RegisterStudioControls() { if (!StudioAPI.InsideStudio) { return; } var breast = new CurrentStateCategorySwitch("Breast", ocichar => ocichar.charInfo.GetComponent <ColliderController>().BreastCollidersEnabled); breast.Value.Subscribe(value => { bool first = true; foreach (var controller in StudioAPI.GetSelectedControllers <ColliderController>()) { if (first && controller.BreastCollidersEnabled == value) { break; } first = false; controller.BreastCollidersEnabled = value; controller.ApplyBreastColliders(); } }); #if KK || KKS var skirt = new CurrentStateCategorySwitch("Skirt", ocichar => ocichar.charInfo.GetComponent <ColliderController>().SkirtCollidersEnabled); skirt.Value.Subscribe(value => { bool first = true; foreach (var controller in StudioAPI.GetSelectedControllers <ColliderController>()) { if (first && controller.SkirtCollidersEnabled == value) { break; } first = false; controller.SkirtCollidersEnabled = value; controller.ApplySkirtColliders(); } }); #endif var floor = new CurrentStateCategorySwitch("Floor", ocichar => ocichar.charInfo.GetComponent <ColliderController>().FloorColliderEnabled); floor.Value.Subscribe(value => { bool first = true; foreach (var controller in StudioAPI.GetSelectedControllers <ColliderController>()) { if (first && controller.FloorColliderEnabled == value) { break; } first = false; controller.FloorColliderEnabled = value; controller.ApplyFloorCollider(); } }); StudioAPI.GetOrCreateCurrentStateCategory("Colliders").AddControl(breast); #if KK || KKS StudioAPI.GetOrCreateCurrentStateCategory("Colliders").AddControl(skirt); #endif StudioAPI.GetOrCreateCurrentStateCategory("Colliders").AddControl(floor); }