mirror of
				https://github.com/amevarashi/RJW-Sexperience.git
				synced 2024-08-14 23:54:08 +00:00 
			
		
		
		
	Rename source folder
This commit is contained in:
		
							parent
							
								
									0a412a0060
								
							
						
					
					
						commit
						a4c046a841
					
				
					 55 changed files with 0 additions and 0 deletions
				
			
		
							
								
								
									
										7
									
								
								Source/RJWSexperience/Settings/IResettable.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Source/RJWSexperience/Settings/IResettable.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
namespace RJWSexperience.Settings
 | 
			
		||||
{
 | 
			
		||||
	internal interface IResettable
 | 
			
		||||
	{
 | 
			
		||||
		void Reset();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								Source/RJWSexperience/Settings/ITab.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								Source/RJWSexperience/Settings/ITab.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
using UnityEngine;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Settings
 | 
			
		||||
{
 | 
			
		||||
	public interface ITab
 | 
			
		||||
	{
 | 
			
		||||
		string Label { get; }
 | 
			
		||||
		void DoTabContents(Rect inRect);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										42
									
								
								Source/RJWSexperience/Settings/SettingsTabDebug.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								Source/RJWSexperience/Settings/SettingsTabDebug.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,42 @@
 | 
			
		|||
using UnityEngine;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Settings
 | 
			
		||||
{
 | 
			
		||||
	public class SettingsTabDebug : IExposable, IResettable, ITab
 | 
			
		||||
	{
 | 
			
		||||
		public string Label => Keyed.TabLabelDebug;
 | 
			
		||||
 | 
			
		||||
		// Defaults
 | 
			
		||||
		public const bool DevModeDefault = false;
 | 
			
		||||
 | 
			
		||||
		// Private attributes
 | 
			
		||||
		private bool devMode;
 | 
			
		||||
 | 
			
		||||
		//Public read-only properties
 | 
			
		||||
		public bool DevMode => devMode;
 | 
			
		||||
 | 
			
		||||
		public void Reset()
 | 
			
		||||
		{
 | 
			
		||||
			devMode = DevModeDefault;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void ExposeData()
 | 
			
		||||
		{
 | 
			
		||||
			Scribe_Values.Look(ref devMode, "DevMode", DevModeDefault);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void DoTabContents(Rect inRect)
 | 
			
		||||
		{
 | 
			
		||||
			Listing_Standard listmain = new Listing_Standard();
 | 
			
		||||
			listmain.Begin(inRect);
 | 
			
		||||
			listmain.CheckboxLabeled(Keyed.Option_Debug_Label, ref devMode, Keyed.Option_Debug_Desc);
 | 
			
		||||
 | 
			
		||||
			if (listmain.ButtonText(Keyed.Button_ResetToDefault))
 | 
			
		||||
			{
 | 
			
		||||
				Reset();
 | 
			
		||||
			}
 | 
			
		||||
			listmain.End();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										139
									
								
								Source/RJWSexperience/Settings/SettingsTabHistory.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								Source/RJWSexperience/Settings/SettingsTabHistory.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,139 @@
 | 
			
		|||
using RimWorld;
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Settings
 | 
			
		||||
{
 | 
			
		||||
	public class SettingsTabHistory : IExposable, IResettable, ITab
 | 
			
		||||
	{
 | 
			
		||||
		public string Label => Keyed.TabLabelHistory;
 | 
			
		||||
 | 
			
		||||
		// Defaults
 | 
			
		||||
		public const bool EnableStatRandomizerDefault = true;
 | 
			
		||||
		public const float MaxLustDeviationDefault = 400f;
 | 
			
		||||
		public const float AvgLustDefault = 0f;
 | 
			
		||||
		public const float MaxSexCountDeviationDefault = 90f;
 | 
			
		||||
		public const float SexPerYearDefault = 30f;
 | 
			
		||||
		public const bool MinSexableFromLifestageDefault = true;
 | 
			
		||||
		public const float MinSexablePercentDefault = 0.2f;
 | 
			
		||||
		public const float VirginRatioDefault = 0.01f;
 | 
			
		||||
		public const bool SlavesBeenRapedExpDefault = true;
 | 
			
		||||
		public const bool EnableSexHistoryDefault = true;
 | 
			
		||||
		public const bool HideGizmoWhenDraftedDefault = true;
 | 
			
		||||
		public const bool HideGizmoWithRJWDefault = true;
 | 
			
		||||
 | 
			
		||||
		// Private attributes
 | 
			
		||||
		private bool enableRecordRandomizer = EnableStatRandomizerDefault;
 | 
			
		||||
		private float maxLustDeviation = MaxLustDeviationDefault;
 | 
			
		||||
		private float avgLust = AvgLustDefault;
 | 
			
		||||
		private float maxSexCountDeviation = MaxSexCountDeviationDefault;
 | 
			
		||||
		private float sexPerYear = SexPerYearDefault;
 | 
			
		||||
		private bool minSexableFromLifestage = MinSexableFromLifestageDefault;
 | 
			
		||||
		private float minSexablePercent = MinSexablePercentDefault;
 | 
			
		||||
		private float virginRatio = VirginRatioDefault;
 | 
			
		||||
		private bool slavesBeenRapedExp = SlavesBeenRapedExpDefault;
 | 
			
		||||
		private bool enableSexHistory = EnableSexHistoryDefault;
 | 
			
		||||
		private bool hideGizmoWhenDrafted = HideGizmoWhenDraftedDefault;
 | 
			
		||||
		private bool hideGizmoWithRJW = HideGizmoWithRJWDefault;
 | 
			
		||||
 | 
			
		||||
		//Public read-only properties
 | 
			
		||||
		public bool EnableRecordRandomizer => enableRecordRandomizer;
 | 
			
		||||
		public float MaxLustDeviation => maxLustDeviation;
 | 
			
		||||
		public float AvgLust => avgLust;
 | 
			
		||||
		public float MaxSexCountDeviation => maxSexCountDeviation;
 | 
			
		||||
		public float SexPerYear => sexPerYear;
 | 
			
		||||
		public bool MinSexableFromLifestage => minSexableFromLifestage;
 | 
			
		||||
		public float MinSexablePercent => minSexablePercent;
 | 
			
		||||
		public float VirginRatio => virginRatio;
 | 
			
		||||
		public bool SlavesBeenRapedExp => slavesBeenRapedExp;
 | 
			
		||||
		public bool EnableSexHistory => enableSexHistory;
 | 
			
		||||
		public bool HideGizmoWhenDrafted => hideGizmoWhenDrafted;
 | 
			
		||||
		public bool HideGizmoWithRJW => hideGizmoWithRJW;
 | 
			
		||||
 | 
			
		||||
		public static SettingsTabHistory CreateDefault()
 | 
			
		||||
		{
 | 
			
		||||
			SettingsTabHistory history = new SettingsTabHistory();
 | 
			
		||||
			history.Reset();
 | 
			
		||||
			return history;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void Reset()
 | 
			
		||||
		{
 | 
			
		||||
			enableRecordRandomizer = EnableStatRandomizerDefault;
 | 
			
		||||
			maxLustDeviation = MaxLustDeviationDefault;
 | 
			
		||||
			avgLust = AvgLustDefault;
 | 
			
		||||
			maxSexCountDeviation = MaxSexCountDeviationDefault;
 | 
			
		||||
			sexPerYear = SexPerYearDefault;
 | 
			
		||||
			minSexableFromLifestage = MinSexableFromLifestageDefault;
 | 
			
		||||
			minSexablePercent = MinSexablePercentDefault;
 | 
			
		||||
			virginRatio = VirginRatioDefault;
 | 
			
		||||
			slavesBeenRapedExp = SlavesBeenRapedExpDefault;
 | 
			
		||||
			enableSexHistory = EnableSexHistoryDefault;
 | 
			
		||||
			hideGizmoWhenDrafted = HideGizmoWhenDraftedDefault;
 | 
			
		||||
			hideGizmoWithRJW = HideGizmoWithRJWDefault;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void ExposeData()
 | 
			
		||||
		{
 | 
			
		||||
			Scribe_Values.Look(ref enableRecordRandomizer, "EnableRecordRandomizer", EnableStatRandomizerDefault);
 | 
			
		||||
			Scribe_Values.Look(ref maxLustDeviation, "MaxLustDeviation", MaxLustDeviationDefault);
 | 
			
		||||
			Scribe_Values.Look(ref avgLust, "AvgLust", AvgLustDefault);
 | 
			
		||||
			Scribe_Values.Look(ref maxSexCountDeviation, "MaxSexCountDeviation", MaxSexCountDeviationDefault);
 | 
			
		||||
			Scribe_Values.Look(ref sexPerYear, "SexPerYear", SexPerYearDefault);
 | 
			
		||||
			Scribe_Values.Look(ref minSexableFromLifestage, "MinSexableFromLifestage", MinSexableFromLifestageDefault);
 | 
			
		||||
			Scribe_Values.Look(ref minSexablePercent, "MinSexablePercent", MinSexablePercentDefault);
 | 
			
		||||
			Scribe_Values.Look(ref virginRatio, "VirginRatio", VirginRatioDefault);
 | 
			
		||||
			Scribe_Values.Look(ref slavesBeenRapedExp, "SlavesBeenRapedExp", SlavesBeenRapedExpDefault);
 | 
			
		||||
			Scribe_Values.Look(ref enableSexHistory, "EnableSexHistory", EnableSexHistoryDefault);
 | 
			
		||||
			Scribe_Values.Look(ref hideGizmoWhenDrafted, "HideGizmoWhenDrafted", HideGizmoWhenDraftedDefault);
 | 
			
		||||
			Scribe_Values.Look(ref hideGizmoWithRJW, "HideGizmoWithRJW", HideGizmoWithRJWDefault);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void DoTabContents(Rect inRect)
 | 
			
		||||
		{
 | 
			
		||||
			const float lineHeight = SettingsWidgets.lineHeight;
 | 
			
		||||
 | 
			
		||||
			Listing_Standard listmain = new Listing_Standard();
 | 
			
		||||
			listmain.Begin(inRect);
 | 
			
		||||
 | 
			
		||||
			listmain.CheckboxLabeled(Keyed.Option_1_Label, ref enableRecordRandomizer, Keyed.Option_1_Desc);
 | 
			
		||||
			if (enableRecordRandomizer)
 | 
			
		||||
			{
 | 
			
		||||
				float sectionHeight = 12f;
 | 
			
		||||
				if (!minSexableFromLifestage)
 | 
			
		||||
					sectionHeight += 2f;
 | 
			
		||||
 | 
			
		||||
				Listing_Standard section = listmain.BeginSection(lineHeight * sectionHeight);
 | 
			
		||||
 | 
			
		||||
				SettingsWidgets.SliderOption(section.GetRect(lineHeight * 2f), Keyed.Option_3_Label + " " + maxLustDeviation, Keyed.Option_3_Desc, ref maxLustDeviation, 0f, 2000f, 1f);
 | 
			
		||||
				SettingsWidgets.SliderOption(section.GetRect(lineHeight * 2f), Keyed.Option_4_Label + " " + avgLust, Keyed.Option_4_Desc, ref avgLust, -1000f, 1000f, 1f);
 | 
			
		||||
				SettingsWidgets.SliderOption(section.GetRect(lineHeight * 2f), Keyed.Option_5_Label + " " + maxSexCountDeviation, Keyed.Option_5_Desc, ref maxSexCountDeviation, 0f, 2000f, 1f);
 | 
			
		||||
				SettingsWidgets.SliderOption(section.GetRect(lineHeight * 2f), Keyed.Option_6_Label + " " + sexPerYear, Keyed.Option_6_Desc, ref sexPerYear, 0f, 2000f, 1f);
 | 
			
		||||
 | 
			
		||||
				section.CheckboxLabeled(Keyed.Option_MinSexableFromLifestage_Label, ref minSexableFromLifestage, Keyed.Option_MinSexableFromLifestage_Desc);
 | 
			
		||||
 | 
			
		||||
				if (!minSexableFromLifestage)
 | 
			
		||||
					SettingsWidgets.SliderOption(section.GetRect(lineHeight * 2f), $"{Keyed.Option_9_Label} {minSexablePercent:P1}   {ThingDefOf.Human.race.lifeExpectancy * minSexablePercent} human years", Keyed.Option_9_Desc, ref minSexablePercent, 0, 1, 0.001f);
 | 
			
		||||
 | 
			
		||||
				SettingsWidgets.SliderOption(section.GetRect(lineHeight * 2f), $"{Keyed.Option_10_Label} {virginRatio:P1}", Keyed.Option_10_Desc, ref virginRatio, 0f, 1f, 0.001f);
 | 
			
		||||
				section.CheckboxLabeled(Keyed.Option_7_Label, ref slavesBeenRapedExp, Keyed.Option_7_Desc);
 | 
			
		||||
 | 
			
		||||
				listmain.EndSection(section);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			listmain.CheckboxLabeled(Keyed.Option_EnableSexHistory_Label, ref enableSexHistory, Keyed.Option_EnableSexHistory_Desc);
 | 
			
		||||
 | 
			
		||||
			if (enableSexHistory)
 | 
			
		||||
			{
 | 
			
		||||
				listmain.CheckboxLabeled(Keyed.Option_HideGizmoWhenDrafted_Label, ref hideGizmoWhenDrafted, Keyed.Option_HideGizmoWhenDrafted_Desc);
 | 
			
		||||
				listmain.CheckboxLabeled(Keyed.Option_HideGizmoWithRJW_Label, ref hideGizmoWithRJW, Keyed.Option_HideGizmoWithRJW_Desc);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if (listmain.ButtonText(Keyed.Button_ResetToDefault))
 | 
			
		||||
			{
 | 
			
		||||
				Reset();
 | 
			
		||||
			}
 | 
			
		||||
			listmain.End();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										36
									
								
								Source/RJWSexperience/Settings/SettingsWidgets.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Source/RJWSexperience/Settings/SettingsWidgets.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,36 @@
 | 
			
		|||
using UnityEngine;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Settings
 | 
			
		||||
{
 | 
			
		||||
	public static class SettingsWidgets
 | 
			
		||||
	{
 | 
			
		||||
		public const float lineHeight = 24f;
 | 
			
		||||
 | 
			
		||||
		public static void LabelwithTextfield(Rect rect, string label, string tooltip, ref float value, float min, float max)
 | 
			
		||||
		{
 | 
			
		||||
			Rect textfieldRect = new Rect(rect.xMax - 100f, rect.y, 100f, rect.height);
 | 
			
		||||
			string valuestr = value.ToString();
 | 
			
		||||
			Widgets.Label(rect, label);
 | 
			
		||||
			Widgets.TextFieldNumeric(textfieldRect, ref value, ref valuestr, min, max);
 | 
			
		||||
			Widgets.DrawHighlightIfMouseover(rect);
 | 
			
		||||
			TooltipHandler.TipRegion(rect, tooltip);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static void SliderOption(Rect doublerect, string label, string tooltip, ref float value, float min, float max, float roundTo)
 | 
			
		||||
		{
 | 
			
		||||
			// Slider was fighting with textfield for "correct" decimals. Causes a repeating slider move sound
 | 
			
		||||
			float fieldValue = value;
 | 
			
		||||
			float sliderValue = value;
 | 
			
		||||
			float minChange = roundTo / 10f;
 | 
			
		||||
 | 
			
		||||
			LabelwithTextfield(doublerect.TopHalf(), label, tooltip, ref fieldValue, min, max);
 | 
			
		||||
			sliderValue = Widgets.HorizontalSlider(doublerect.BottomHalf(), sliderValue, min, max, roundTo: roundTo);
 | 
			
		||||
 | 
			
		||||
			if (Mathf.Abs(fieldValue - value) > minChange)
 | 
			
		||||
				value = fieldValue;
 | 
			
		||||
			else
 | 
			
		||||
				value = sliderValue;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue