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); }
public static void RegisterStudioControls() { if (!StudioAPI.InsideStudio) { return; } StudioCoordinateCurrentStateCategoryDropdown = new CurrentStateCategoryDropdown("Coordinate", CoordinateNames.ToArray(), c => CoordinateIndex()); StudioCoordinateCurrentStateCategoryDropdown.Value.Subscribe(value => { var mpCharCtrol = Object.FindObjectOfType <MPCharCtrl>(); if (StudioCoordinateDropdown != null) { var character = StudioAPI.GetSelectedCharacters().First(); //Remove extras if (StudioCoordinateDropdown.options.Count > OriginalCoordinateLength) { StudioCoordinateDropdown.options.RemoveRange(OriginalCoordinateLength, StudioCoordinateDropdown.options.Count - OriginalCoordinateLength); } //Add dropdown options for each additional coodinate if (StudioCoordinateDropdown.options.Count < character.charInfo.chaFile.coordinate.Length) { for (int i = 0; i < (character.charInfo.chaFile.coordinate.Length - OriginalCoordinateLength); i++) { StudioCoordinateDropdown.options.Add(new Dropdown.OptionData(GetCoodinateName(character.charInfo, OriginalCoordinateLength + i))); } StudioCoordinateDropdown.captionText.text = StudioCoordinateDropdown.options[value].text; } } if (mpCharCtrol != null) { mpCharCtrol.stateInfo.OnClickCosType(value); } }); int CoordinateIndex() { var character = StudioAPI.GetSelectedCharacters().First(); return(character.charInfo.fileStatus.coordinateType); } StudioAPI.GetOrCreateCurrentStateCategory("").AddControl(StudioCoordinateCurrentStateCategoryDropdown); }
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() { 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 => { var controller = GetSelectedStudioController(); if (controller != null) { #if AI if (controller.ChaControl.sex == 0) { bodyDropdown.Visible.OnNext(false); return; } else { bodyDropdown.Visible.OnNext(true); } #endif var guid = bodyList[value]; if (controller.BodyData?.BodyGUID != guid) { controller.BodyGUID = guid; controller.UpdateUncensor(); } } }); int BodyIndex() { var controller = GetSelectedStudioController(); 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 => { var controller = GetSelectedStudioController(); if (controller != null) { var guid = penisList[value]; if (controller.PenisData?.PenisGUID != guid) { controller.PenisGUID = guid; controller.UpdateUncensor(); } } }); int PenisIndex() { var controller = GetSelectedStudioController(); 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 => { var controller = GetSelectedStudioController(); if (controller != null) { if (value == 0)//"None" { if (controller.BallsGUID != null) { controller.BallsGUID = null; controller.DisplayBalls = false; controller.UpdateUncensor(); } } else { var guid = ballsList[value]; if (controller.BallsData?.BallsGUID != guid) { controller.BallsGUID = guid; controller.DisplayBalls = true; controller.UpdateUncensor(); } } } }); int BallsIndex() { var controller = GetSelectedStudioController(); 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; } 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); }