diff --git a/1.4/Assemblies/RJWSexperience.dll b/1.4/Assemblies/RJWSexperience.dll index b494450..d07dbbe 100644 Binary files a/1.4/Assemblies/RJWSexperience.dll and b/1.4/Assemblies/RJWSexperience.dll differ diff --git a/About/Manifest.xml b/About/Manifest.xml index b412805..99d4cc2 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJWSexperience - 1.1.3.0 + 1.1.2.1
  • RimJobWorld >= 5.3.0
  • diff --git a/Languages/English/Keyed/RJW_Sexperience.xml b/Languages/English/Keyed/RJW_Sexperience.xml index daa7bc3..1a7c52c 100644 --- a/Languages/English/Keyed/RJW_Sexperience.xml +++ b/Languages/English/Keyed/RJW_Sexperience.xml @@ -84,6 +84,8 @@ * Needs a game restart\n\nEnables Sex History window, information collection for the said window and save/load of this information. Also enables sex partners count in the pawn's records.\n\n[Caution] Disabling this mid save will result in the loss of previously collected histories. Hide Sex History button when drafted Hides Sex History Gizmo for currently drafted pawns + Hide Sex History button with RJW designators + Hides Sex History Gizmo if RJW designators are hidden Debug diff --git a/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll b/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll index 318e183..1e02e43 100644 Binary files a/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll and b/Mod Compatibility/RJW Cum/Assemblies/RJWSexperienceCum.dll differ diff --git a/Source/RJWSexperience/Configurations.cs b/Source/RJWSexperience/Configurations.cs index b53be31..7059659 100644 --- a/Source/RJWSexperience/Configurations.cs +++ b/Source/RJWSexperience/Configurations.cs @@ -1,47 +1,64 @@ -using Verse; +using UnityEngine; +using Verse; using RJWSexperience.Settings; namespace RJWSexperience { - public class Configurations : ModSettings + public class Configurations : ModSettings, ITab { + public string Label => Keyed.TabLabelMain; public const int CurrentSettingsVersion = 1; - public readonly SettingHandle LustEffectPower = new SettingHandle("LustEffectPower", 0.5f); - public readonly SettingHandle EnableBastardRelation = new SettingHandle("EnableBastardRelation", true); - public readonly SettingHandle LustLimit = new SettingHandle("LustLimit", 150f); - public readonly SettingHandle MaxSingleLustChange = new SettingHandle("maxSingleLustChange", 1f); - public readonly SettingHandle SexCanFillBuckets = new SettingHandle("SexCanFillBuckets", false); + // Defaults + public const float LustEffectPowerDefault = 0.5f; + public const bool EnableBastardRelationDefault = true; + public const float LustLimitDefault = SettingsTabHistory.MaxLustDeviationDefault / 3f; + public const float MaxSingleLustChangeDefault = 0.5f; + public const bool SexCanFillBucketsDefault = false; + public const bool selectionLockedDefault = false; - public readonly SettingHandle EnableRecordRandomizer = new SettingHandle("EnableRecordRandomizer", true); - public readonly SettingHandle MaxLustDeviation = new SettingHandle("MaxLustDeviation", 200f); - public readonly SettingHandle AvgLust = new SettingHandle("AvgLust", 0f); - public readonly SettingHandle MaxSexCountDeviation = new SettingHandle("MaxSexCountDeviation", 90f); - public readonly SettingHandle SexPerYear = new SettingHandle("SexPerYear", 30f); - public readonly SettingHandle MinSexableFromLifestage = new SettingHandle("MinSexableFromLifestage", true); - public readonly SettingHandle MinSexablePercent = new SettingHandle("MinSexablePercent", 0.2f); - public readonly SettingHandle VirginRatio = new SettingHandle("VirginRatio", 0.01f); - public readonly SettingHandle SlavesBeenRapedExp = new SettingHandle("SlavesBeenRapedExp", true); - public readonly SettingHandle EnableSexHistory = new SettingHandle("EnableSexHistory", true); - public readonly SettingHandle HideGizmoWhenDrafted = new SettingHandle("HideGizmoWhenDrafted", true); + // Private attributes + private float lustEffectPower = LustEffectPowerDefault; + private bool enableBastardRelation = EnableBastardRelationDefault; + private float lustLimit = LustLimitDefault; + private float maxSingleLustChange = MaxSingleLustChangeDefault; + private bool sexCanFillBuckets = SexCanFillBucketsDefault; + private bool selectionLocked = selectionLockedDefault; + private SettingsTabHistory history = SettingsTabHistory.CreateDefault(); + private SettingsTabDebug debug = new SettingsTabDebug(); - public readonly SettingHandle DevMode = new SettingHandle("DevMode", false); + //Public read-only properties + public float LustEffectPower => lustEffectPower; + public bool EnableBastardRelation => enableBastardRelation; + public float LustLimit => lustLimit; + public float MaxSingleLustChange => maxSingleLustChange; + public bool SexCanFillBuckets => sexCanFillBuckets; + public SettingsTabHistory History => history; + public SettingsTabDebug Debug => debug; + [System.Diagnostics.CodeAnalysis.SuppressMessage("Minor Code Smell", "S2292:Trivial properties should be auto-implemented", Justification = "Can't scribe property")] + public bool SelectionLocked { get => selectionLocked; set => selectionLocked = value; } - public readonly SettingHandle SelectionLocked = new SettingHandle("SelectionLocked", false); + public void ResetToDefault() + { + lustEffectPower = LustEffectPowerDefault; + enableBastardRelation = EnableBastardRelationDefault; + lustLimit = LustLimitDefault; + maxSingleLustChange = MaxSingleLustChangeDefault; + sexCanFillBuckets = SexCanFillBucketsDefault; + } public override void ExposeData() { - SettingsContainer history = SettingsContainer.CreateHistoryContainer(this); int version = CurrentSettingsVersion; Scribe_Values.Look(ref version, "SettingsVersion", 0); - LustEffectPower.Scribe(); - EnableBastardRelation.Scribe(); - LustLimit.Scribe(); - MaxSingleLustChange.Scribe(); - SelectionLocked.Scribe(); - SexCanFillBuckets.Scribe(); - DevMode.Scribe(); - Scribe_Deep.Look(ref history, "History", history.Handles); + Scribe_Values.Look(ref lustEffectPower, "LustEffectPower", LustEffectPowerDefault); + Scribe_Values.Look(ref enableBastardRelation, "EnableBastardRelation", EnableBastardRelationDefault); + Scribe_Values.Look(ref lustLimit, "LustLimit", LustLimitDefault); + Scribe_Values.Look(ref maxSingleLustChange, "maxSingleLustChange", MaxSingleLustChangeDefault); + Scribe_Values.Look(ref selectionLocked, "SelectionLocked", selectionLockedDefault); + Scribe_Values.Look(ref sexCanFillBuckets, "SexCanFillBuckets", SexCanFillBucketsDefault); + Scribe_Deep.Look(ref history, "History"); + Scribe_Deep.Look(ref debug, "Debug"); base.ExposeData(); if (Scribe.mode != LoadSaveMode.LoadingVars) @@ -49,9 +66,41 @@ namespace RJWSexperience if (history == null) { + history = new SettingsTabHistory(); // Previously history settings were in Configurations. Direct call to try read old data - SettingsContainer.CreateHistoryContainer(this).ExposeData(); + history.ExposeData(); } + + if (debug == null) + { + debug = new SettingsTabDebug(); + debug.Reset(); + } + } + + public void DoTabContents(Rect inRect) + { + const float lineHeight = SettingsWidgets.lineHeight; + + Listing_Standard listmain = new Listing_Standard(); + listmain.maxOneColumn = true; + listmain.Begin(inRect); + + SettingsWidgets.SliderOption(listmain.GetRect(lineHeight * 2f), Keyed.Option_2_Label + " x" + lustEffectPower, Keyed.Option_2_Desc, ref lustEffectPower, 0f, 2f, 0.01f); + SettingsWidgets.SliderOption(listmain.GetRect(lineHeight * 2f), Keyed.Option_8_Label + " " + lustLimit, Keyed.Option_8_Desc, ref lustLimit, 0f, 5000f, 1f); + SettingsWidgets.SliderOption(listmain.GetRect(lineHeight * 2f), Keyed.Option_MaxSingleLustChange_Label + " " + maxSingleLustChange, Keyed.Option_MaxSingleLustChange_Desc, ref maxSingleLustChange, 0f, 10f, 0.05f); + + listmain.CheckboxLabeled(Keyed.Option_EnableBastardRelation_Label, ref enableBastardRelation, Keyed.Option_EnableBastardRelation_Desc); + listmain.CheckboxLabeled(Keyed.Option_SexCanFillBuckets_Label, ref sexCanFillBuckets, Keyed.Option_SexCanFillBuckets_Desc); + + if (SexperienceMod.Settings.Debug.DevMode) + LustUtility.DrawGraph(listmain.GetRect(300f)); + + if (listmain.ButtonText(Keyed.Button_ResetToDefault)) + { + ResetToDefault(); + } + listmain.End(); } } } diff --git a/Source/RJWSexperience/Cum/Building_Cumbucket.cs b/Source/RJWSexperience/Cum/Building_Cumbucket.cs index 4598f5f..5848277 100644 --- a/Source/RJWSexperience/Cum/Building_Cumbucket.cs +++ b/Source/RJWSexperience/Cum/Building_Cumbucket.cs @@ -39,7 +39,7 @@ namespace RJWSexperience // Used in Menstruation with this namespace stringBuilder.Append(Keyed.RSTotalGatheredCum).AppendFormat("{0:0.##}ml", totalGathered); - if (SexperienceMod.Settings.DevMode) + if (SexperienceMod.Settings.Debug.DevMode) { stringBuilder.AppendLine(); stringBuilder.AppendLine($"[Debug] stored: {StoredStackCount}"); diff --git a/Source/RJWSexperience/DebugAction.cs b/Source/RJWSexperience/DebugAction.cs index ca1b971..0999856 100644 --- a/Source/RJWSexperience/DebugAction.cs +++ b/Source/RJWSexperience/DebugAction.cs @@ -59,7 +59,7 @@ namespace RJWSexperience { if (!allzero) { - if (SexperienceMod.Settings.EnableRecordRandomizer && xxx.is_human(pawn)) + if (SexperienceMod.Settings.History.EnableRecordRandomizer && xxx.is_human(pawn)) { return RecordRandomizer.Randomize(pawn); } diff --git a/Source/RJWSexperience/ExtensionMethods/PawnExtensions.cs b/Source/RJWSexperience/ExtensionMethods/PawnExtensions.cs index 9e3a7f9..3d47e0f 100644 --- a/Source/RJWSexperience/ExtensionMethods/PawnExtensions.cs +++ b/Source/RJWSexperience/ExtensionMethods/PawnExtensions.cs @@ -59,7 +59,7 @@ namespace RJWSexperience results.Add(building); foreach (IntVec3 pos in GenAdjFast.AdjacentCells8Way(pawn.Position)) { - if (pos.InBounds(pawn.Map) && edifice[pos] is T adjBuilding) + if (edifice[pos] is T adjBuilding) results.Add(adjBuilding); } return results; diff --git a/Source/RJWSexperience/Harmony.cs b/Source/RJWSexperience/Harmony.cs index d3a74d6..8fb813b 100644 --- a/Source/RJWSexperience/Harmony.cs +++ b/Source/RJWSexperience/Harmony.cs @@ -16,6 +16,7 @@ namespace RJWSexperience { var har = new Harmony("RJW_Sexperience"); har.PatchAll(Assembly.GetExecutingAssembly()); + Pawn_GetGizmos.DoConditionalPatch(har); InjectIntoRjwInteractionServices(); } diff --git a/Source/RJWSexperience/Logs/DebugLogProvider.cs b/Source/RJWSexperience/Logs/DebugLogProvider.cs index b3e4927..15576b6 100644 --- a/Source/RJWSexperience/Logs/DebugLogProvider.cs +++ b/Source/RJWSexperience/Logs/DebugLogProvider.cs @@ -4,6 +4,6 @@ namespace RJWSexperience.Logs { public class DebugLogProvider : ILogProvider { - public bool IsActive => SexperienceMod.Settings.DevMode; + public bool IsActive => SexperienceMod.Settings.Debug.DevMode; } } diff --git a/Source/RJWSexperience/Patches/ConditionalDefLoad.cs b/Source/RJWSexperience/Patches/ConditionalDefLoad.cs deleted file mode 100644 index 0e8d74e..0000000 --- a/Source/RJWSexperience/Patches/ConditionalDefLoad.cs +++ /dev/null @@ -1,37 +0,0 @@ -/*using HarmonyLib; -using System.Xml; -using Verse; - -namespace RJWSexperience.Patches -{ - public static class ConditionalDefLoad - { - public static void DoPatch() - { - Harmony harmony = new Harmony("RJW_SexperienceXmlLoad"); - harmony.Patch(AccessTools.Method(typeof(DirectXmlLoader), nameof(DirectXmlLoader.DefFromNode)), new HarmonyMethod(typeof(ConditionalDefLoad), nameof(ConditionalDefLoad.Prefix))); - } - - public static bool Prefix(XmlNode node, LoadableXmlAsset loadingAsset, ref Def __result) - { - if (node.NodeType != XmlNodeType.Element) - { - return true; - } - - var settingName = node.Attributes?["RsLoadFlag"]?.Value; - - if (settingName.NullOrEmpty()) - { - return true; - } - - if (SexperienceMod.Settings.GetValue(settingName)) - { - __result = null; - return false; - } - return true; - } - } -}*/ diff --git a/Source/RJWSexperience/Patches/DefInjection.cs b/Source/RJWSexperience/Patches/DefInjection.cs index b8c4cd6..9850468 100644 --- a/Source/RJWSexperience/Patches/DefInjection.cs +++ b/Source/RJWSexperience/Patches/DefInjection.cs @@ -11,20 +11,19 @@ namespace RJWSexperience { static DefInjection() { - if (SexperienceMod.Settings.EnableSexHistory) + if (SexperienceMod.Settings.History.EnableSexHistory) InjectRaces(); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1146:Use conditional access.", Justification = "race != null is needed")] private static void InjectRaces() { IEnumerable PawnDefs = DefDatabase.AllDefs.Where(x => x.race != null && !x.race.IsMechanoid); if (PawnDefs.EnumerableNullOrEmpty()) return; - CompProperties compProperties = new CompProperties(typeof(SexHistoryComp)); + CompProperties comp = new CompProperties(typeof(SexHistoryComp)); foreach (ThingDef def in PawnDefs) - def.comps.Add(compProperties); + def.comps.Add(comp); LogManager.GetLogger("StaticConstructorOnStartup").Message($"Injected SexHistoryComp into {PawnDefs.Count()} pawn Defs"); } diff --git a/Source/RJWSexperience/Patches/GetGizmos.cs b/Source/RJWSexperience/Patches/GetGizmos.cs new file mode 100644 index 0000000..d108c7b --- /dev/null +++ b/Source/RJWSexperience/Patches/GetGizmos.cs @@ -0,0 +1,52 @@ +using HarmonyLib; +using RJWSexperience.Logs; +using RJWSexperience.SexHistory; +using System.Collections.Generic; +using System.Reflection; +using Verse; + +namespace RJWSexperience +{ + public static class Pawn_GetGizmos + { + private static Settings.SettingsTabHistory Settings => SexperienceMod.Settings.History; + + public static void DoConditionalPatch(Harmony harmony) + { + if (!Settings.EnableSexHistory) + return; + + MethodInfo original = typeof(Pawn).GetMethod(nameof(Pawn.GetGizmos)); + MethodInfo postfix = typeof(Pawn_GetGizmos).GetMethod(nameof(Pawn_GetGizmos.Postfix)); + harmony.Patch(original, postfix: new HarmonyMethod(postfix)); + + LogManager.GetLogger(nameof(Pawn_GetGizmos)).Message("Applied conditional patch to Pawn.GetGizmos()"); + } + + public static void Postfix(ref IEnumerable __result, Pawn __instance) + { + if (Settings.HideGizmoWhenDrafted && __instance.Drafted) + return; + + if (Find.Selector.NumSelected > 1) + return; + + if (Settings.HideGizmoWithRJW && !rjw.RJWSettings.show_RJW_designation_box) + return; + + SexHistoryComp history = __instance.TryGetComp(); + if (history == null) + return; + + __result = AddHistoryGizmo(history.Gizmo, __result); + } + + private static IEnumerable AddHistoryGizmo(Gizmo historyGizmo, IEnumerable gizmos) + { + foreach (Gizmo gizmo in gizmos) + yield return gizmo; + + yield return historyGizmo; + } + } +} diff --git a/Source/RJWSexperience/Patches/RJW_Patch.cs b/Source/RJWSexperience/Patches/RJW_Patch.cs index b3ccd7c..ecadf43 100644 --- a/Source/RJWSexperience/Patches/RJW_Patch.cs +++ b/Source/RJWSexperience/Patches/RJW_Patch.cs @@ -5,7 +5,6 @@ using RJWSexperience.Cum; using RJWSexperience.Logs; using RJWSexperience.SexHistory; using System; -using System.Collections.Generic; using UnityEngine; using Verse; @@ -45,7 +44,7 @@ namespace RJWSexperience LustUtility.UpdateLust(props, satisfaction, base_sat_per_fuck); CumUtility.FillCumBuckets(props); props.pawn.records?.Increment(VariousDefOf.OrgasmCount); - if (SexperienceMod.Settings.EnableSexHistory && props.hasPartner()) + if (SexperienceMod.Settings.History.EnableSexHistory && props.partner != null) props.pawn.TryGetComp()?.RecordSatisfaction(props.partner, props, satisfaction); } } @@ -81,7 +80,7 @@ namespace RJWSexperience { RJWUtility.UpdateSextypeRecords(props); - if (!SexperienceMod.Settings.EnableSexHistory || !props.hasPartner()) + if (!SexperienceMod.Settings.History.EnableSexHistory || props.partner == null) return; props.pawn.TryGetComp()?.RecordSex(props.partner, props); @@ -94,7 +93,7 @@ namespace RJWSexperience { public static void Postfix(JobDriver_SexBaseInitiator __instance) { - if (__instance.Sexprops.hasPartner()) + if (__instance.Partner != null) { __instance.pawn.PoptheCherry(__instance.Partner, __instance.Sexprops); __instance.Partner.PoptheCherry(__instance.pawn, __instance.Sexprops); @@ -111,10 +110,10 @@ namespace RJWSexperience /// /// /// - /// Run original method + /// public static bool Prefix(Pawn pawn, Pawn partner, ref IntVec3 __result) { - if (partner != null && partner != pawn) + if (partner != null) return true; // Not masturbation var log = LogManager.GetLogger("RJW_Patch_CasualSex_Helper_FindSexLocation"); @@ -130,51 +129,13 @@ namespace RJWSexperience if (bucket == null) { - log.Message("404 Bucket not found"); + log.Message("Bucket not found"); return true; } - Room bucketRoom = bucket.GetRoom(); - - List cellsAroundBucket = GenAdjFast.AdjacentCells8Way(bucket.Position); - IntVec3 doorNearBucket = IntVec3.Invalid; - - foreach (IntVec3 cell in cellsAroundBucket.InRandomOrder()) - { - if (!cell.Standable(bucket.Map)) - { - log.Message($"Discarded {cell}: not standable"); - continue; - } - - if (cell.GetRoom(bucket.Map) != bucketRoom) - { - if (cell.GetDoor(bucket.Map) != null) - { - doorNearBucket = cell; - } - else - { - log.Message($"Discarded {cell}: different room"); - } - - continue; - } - - __result = cell; - log.Message($"Masturbate at location: {__result}"); - return false; - } - - if (doorNearBucket != IntVec3.Invalid) - { - __result = doorNearBucket; - log.Message($"No proper place found, go jack off in the doorway: {__result}"); - return false; - } - - log.Message($"Failed to find situable location near the bucket at {bucket.Position}"); - return true; + __result = bucket.RandomAdjacentCell8Way(); + log.Message($"Bucket location: {__result}"); + return false; } } diff --git a/Source/RJWSexperience/Patches/Rimworld_Patch.cs b/Source/RJWSexperience/Patches/Rimworld_Patch.cs index 0db6038..fed0646 100644 --- a/Source/RJWSexperience/Patches/Rimworld_Patch.cs +++ b/Source/RJWSexperience/Patches/Rimworld_Patch.cs @@ -16,7 +16,7 @@ namespace RJWSexperience bool doVirginTrait = true; - if (SexperienceMod.Settings.EnableRecordRandomizer && __result.DevelopmentalStage != DevelopmentalStage.Newborn && xxx.is_human(__result)) + if (SexperienceMod.Settings.History.EnableRecordRandomizer && __result.DevelopmentalStage != DevelopmentalStage.Newborn && xxx.is_human(__result)) doVirginTrait = SexHistory.RecordRandomizer.Randomize(__result); if (doVirginTrait) diff --git a/Source/RJWSexperience/RJWSexperience.csproj b/Source/RJWSexperience/RJWSexperience.csproj index 6540f16..e51312d 100644 --- a/Source/RJWSexperience/RJWSexperience.csproj +++ b/Source/RJWSexperience/RJWSexperience.csproj @@ -57,13 +57,8 @@ - - - - - - + @@ -95,7 +90,7 @@ - 1.4.3641 + 1.4.3524 2.2.2 diff --git a/Source/RJWSexperience/RJWUtility.cs b/Source/RJWSexperience/RJWUtility.cs index 19d4160..3b73b71 100644 --- a/Source/RJWSexperience/RJWUtility.cs +++ b/Source/RJWSexperience/RJWUtility.cs @@ -15,7 +15,6 @@ namespace RJWSexperience /// For ideo patch /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1163:Unused parameter.", Justification = "All parameters are needed for the ideology patch")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "All parameters are needed for the ideology patch")] public static void ThrowVirginHistoryEvent(Pawn exVirgin, Pawn partner, SexProps props, int degree) { //for non-ideo diff --git a/Source/RJWSexperience/Settings/IResettable.cs b/Source/RJWSexperience/Settings/IResettable.cs index 5289ea2..238759d 100644 --- a/Source/RJWSexperience/Settings/IResettable.cs +++ b/Source/RJWSexperience/Settings/IResettable.cs @@ -1,6 +1,6 @@ namespace RJWSexperience.Settings { - public interface IResettable + internal interface IResettable { void Reset(); } diff --git a/Source/RJWSexperience/Settings/ISettingHandle.cs b/Source/RJWSexperience/Settings/ISettingHandle.cs deleted file mode 100644 index d2db899..0000000 --- a/Source/RJWSexperience/Settings/ISettingHandle.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace RJWSexperience.Settings -{ - public interface ISettingHandle : IResettable - { - void Scribe(); - } -} \ No newline at end of file diff --git a/Source/RJWSexperience/Settings/SettingHandle.cs b/Source/RJWSexperience/Settings/SettingHandle.cs deleted file mode 100644 index b2457d7..0000000 --- a/Source/RJWSexperience/Settings/SettingHandle.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Verse; - -namespace RJWSexperience.Settings -{ - public class SettingHandle : ISettingHandle - { - public T Value { get; set; } - public readonly string XmlLabel; - public readonly T DefaultValue; - - public SettingHandle(string xmlLabel, T defaultValue) - { - XmlLabel = xmlLabel; - DefaultValue = defaultValue; - Value = defaultValue; - } - - public void Reset() - { - Value = DefaultValue; - } - - public void Scribe() - { - T value = Value; - Scribe_Values.Look(ref value, XmlLabel, DefaultValue); - Value = value; - } - - public static implicit operator T(SettingHandle settingHandle) - { - return settingHandle.Value; - } - } -} diff --git a/Source/RJWSexperience/Settings/SettingsContainer.cs b/Source/RJWSexperience/Settings/SettingsContainer.cs deleted file mode 100644 index c055aeb..0000000 --- a/Source/RJWSexperience/Settings/SettingsContainer.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections.Generic; -using Verse; - -namespace RJWSexperience.Settings -{ - public class SettingsContainer : IExposable - { - public List Handles { get; } - - public SettingsContainer(List handles) - { - Handles = handles; - } - - public void ExposeData() - { - foreach (ISettingHandle setting in Handles) - { - setting.Scribe(); - } - } - - public static SettingsContainer CreateHistoryContainer(Configurations settings) => new SettingsContainer(new List { - settings.EnableRecordRandomizer, - settings.MaxLustDeviation, - settings.AvgLust, - settings.MaxSexCountDeviation, - settings.SexPerYear, - settings.MinSexableFromLifestage, - settings.MinSexablePercent, - settings.VirginRatio, - settings.SlavesBeenRapedExp, - settings.EnableSexHistory, - settings.HideGizmoWhenDrafted - } - ); - } -} \ No newline at end of file diff --git a/Source/RJWSexperience/Settings/SettingsTab.cs b/Source/RJWSexperience/Settings/SettingsTab.cs deleted file mode 100644 index 2c2e663..0000000 --- a/Source/RJWSexperience/Settings/SettingsTab.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace RJWSexperience.Settings -{ - public abstract class SettingsTab : ITab, IResettable - { - protected readonly List tabSettings; - protected readonly Configurations settings; - - public string Label { get; protected set; } - - protected SettingsTab(Configurations settings, string label, List tabSettings) - { - this.settings = settings; - Label = label; - this.tabSettings = tabSettings; - } - - public void Reset() - { - foreach (ISettingHandle setting in tabSettings) - { - setting.Reset(); - } - } - - public abstract void DoTabContents(Rect inRect); - } -} \ No newline at end of file diff --git a/Source/RJWSexperience/Settings/SettingsTabDebug.cs b/Source/RJWSexperience/Settings/SettingsTabDebug.cs index b6aec3f..7aec4fe 100644 --- a/Source/RJWSexperience/Settings/SettingsTabDebug.cs +++ b/Source/RJWSexperience/Settings/SettingsTabDebug.cs @@ -1,18 +1,36 @@ -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; using Verse; namespace RJWSexperience.Settings { - public class SettingsTabDebug : SettingsTab + public class SettingsTabDebug : IExposable, IResettable, ITab { - public SettingsTabDebug(Configurations settings) : base(settings, Keyed.TabLabelDebug, new List { settings.DevMode }) { } + public string Label => Keyed.TabLabelDebug; - public override void DoTabContents(Rect inRect) + // 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, settings.DevMode, Keyed.Option_Debug_Desc); + listmain.CheckboxLabeled(Keyed.Option_Debug_Label, ref devMode, Keyed.Option_Debug_Desc); if (listmain.ButtonText(Keyed.Button_ResetToDefault)) { diff --git a/Source/RJWSexperience/Settings/SettingsTabHistory.cs b/Source/RJWSexperience/Settings/SettingsTabHistory.cs index db6a725..a0f1393 100644 --- a/Source/RJWSexperience/Settings/SettingsTabHistory.cs +++ b/Source/RJWSexperience/Settings/SettingsTabHistory.cs @@ -1,67 +1,132 @@ using RimWorld; -using System.Collections.Generic; using UnityEngine; using Verse; namespace RJWSexperience.Settings { - public class SettingsTabHistory : SettingsTab + public class SettingsTabHistory : IExposable, IResettable, ITab { - public SettingsTabHistory(Configurations settings) : base( - settings, - Keyed.TabLabelHistory, - new List { - settings.EnableRecordRandomizer, - settings.MaxLustDeviation, - settings.AvgLust, - settings.MaxSexCountDeviation, - settings.SexPerYear, - settings.MinSexableFromLifestage, - settings.MinSexablePercent, - settings.VirginRatio, - settings.SlavesBeenRapedExp, - settings.EnableSexHistory, - settings.HideGizmoWhenDrafted - } - ) { } + public string Label => Keyed.TabLabelHistory; - public override void DoTabContents(Rect inRect) + // 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, settings.EnableRecordRandomizer, Keyed.Option_1_Desc); - if (settings.EnableRecordRandomizer) + listmain.CheckboxLabeled(Keyed.Option_1_Label, ref enableRecordRandomizer, Keyed.Option_1_Desc); + if (enableRecordRandomizer) { float sectionHeight = 12f; - if (!settings.MinSexableFromLifestage) + if (!minSexableFromLifestage) sectionHeight += 2f; Listing_Standard section = listmain.BeginSection(lineHeight * sectionHeight); - section.SliderOption(Keyed.Option_3_Label + " {0}", Keyed.Option_3_Desc, settings.MaxLustDeviation, new FloatRange(0f, 1000f), 1f); - section.SliderOption(Keyed.Option_4_Label + " {0}", Keyed.Option_4_Desc, settings.AvgLust, new FloatRange(-200f, 200f), 1f); - section.SliderOption(Keyed.Option_5_Label + " {0}", Keyed.Option_5_Desc, settings.MaxSexCountDeviation, new FloatRange(0f, 1000f), 1f); - section.SliderOption(Keyed.Option_6_Label + " {0}", Keyed.Option_6_Desc, settings.SexPerYear, new FloatRange(0f, 2000f), 1f); + 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, settings.MinSexableFromLifestage, Keyed.Option_MinSexableFromLifestage_Desc); + section.CheckboxLabeled(Keyed.Option_MinSexableFromLifestage_Label, ref minSexableFromLifestage, Keyed.Option_MinSexableFromLifestage_Desc); - if (!settings.MinSexableFromLifestage) - section.SliderOption($"{Keyed.Option_9_Label} {{0:P1}} {ThingDefOf.Human.race.lifeExpectancy * settings.MinSexablePercent} human years", Keyed.Option_9_Desc, settings.MinSexablePercent, FloatRange.ZeroToOne, 0.001f); + 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); - section.SliderOption(Keyed.Option_10_Label + " {0:P1}", Keyed.Option_10_Desc, settings.VirginRatio, FloatRange.ZeroToOne, 0.001f); - section.CheckboxLabeled(Keyed.Option_7_Label, settings.SlavesBeenRapedExp, Keyed.Option_7_Desc); + 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, settings.EnableSexHistory, Keyed.Option_EnableSexHistory_Desc); + listmain.CheckboxLabeled(Keyed.Option_EnableSexHistory_Label, ref enableSexHistory, Keyed.Option_EnableSexHistory_Desc); - if (settings.EnableSexHistory) + if (enableSexHistory) { - listmain.CheckboxLabeled(Keyed.Option_HideGizmoWhenDrafted_Label, settings.HideGizmoWhenDrafted, Keyed.Option_HideGizmoWhenDrafted_Desc); + 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)) diff --git a/Source/RJWSexperience/Settings/SettingsTabMain.cs b/Source/RJWSexperience/Settings/SettingsTabMain.cs deleted file mode 100644 index d78f8f6..0000000 --- a/Source/RJWSexperience/Settings/SettingsTabMain.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using Verse; - -namespace RJWSexperience.Settings -{ - public class SettingsTabMain : SettingsTab - { - public SettingsTabMain(Configurations settings) : base( - settings, - Keyed.TabLabelMain, - new List { - settings.LustEffectPower, - settings.EnableBastardRelation, - settings.LustLimit, - settings.MaxSingleLustChange, - settings.SexCanFillBuckets, - } - ) { } - - public override void DoTabContents(Rect inRect) - { - Listing_Standard listmain = new Listing_Standard { maxOneColumn = true }; - listmain.Begin(inRect); - listmain.SliderOption(Keyed.Option_2_Label + " x{0}", Keyed.Option_2_Desc, settings.LustEffectPower, new FloatRange(0f, 2f), 0.01f); - listmain.SliderOption(Keyed.Option_8_Label + " {0}", Keyed.Option_8_Desc, settings.LustLimit, new FloatRange(0f, 500f), 1f); - listmain.SliderOption(Keyed.Option_MaxSingleLustChange_Label + " {0}", Keyed.Option_MaxSingleLustChange_Desc, settings.MaxSingleLustChange, new FloatRange(0f, 10f), 0.05f); - listmain.CheckboxLabeled(Keyed.Option_EnableBastardRelation_Label, settings.EnableBastardRelation, Keyed.Option_EnableBastardRelation_Desc); - listmain.CheckboxLabeled(Keyed.Option_SexCanFillBuckets_Label, settings.SexCanFillBuckets, Keyed.Option_SexCanFillBuckets_Desc); - - if (settings.DevMode) - LustUtility.DrawGraph(listmain.GetRect(300f)); - - if (listmain.ButtonText(Keyed.Button_ResetToDefault)) - { - Reset(); - } - listmain.End(); - } - } -} diff --git a/Source/RJWSexperience/Settings/SettingsWidgets.cs b/Source/RJWSexperience/Settings/SettingsWidgets.cs index eb34578..82d1756 100644 --- a/Source/RJWSexperience/Settings/SettingsWidgets.cs +++ b/Source/RJWSexperience/Settings/SettingsWidgets.cs @@ -7,39 +7,30 @@ namespace RJWSexperience.Settings { public const float lineHeight = 24f; - public static void LabelwithTextfield(Rect rect, string label, string tooltip, ref float value, FloatRange range) + 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, range.TrueMin, range.TrueMax); + Widgets.TextFieldNumeric(textfieldRect, ref value, ref valuestr, min, max); Widgets.DrawHighlightIfMouseover(rect); TooltipHandler.TipRegion(rect, tooltip); } - public static void SliderOption(this Listing_Standard outList, string label, string tooltip, SettingHandle handle, FloatRange range, float roundTo) + 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 = handle.Value; - float sliderValue = handle.Value; + float fieldValue = value; + float sliderValue = value; float minChange = roundTo / 10f; - string formattedLabel = string.Format(label, handle.Value); + LabelwithTextfield(doublerect.TopHalf(), label, tooltip, ref fieldValue, min, max); + sliderValue = Widgets.HorizontalSlider(doublerect.BottomHalf(), sliderValue, min, max, roundTo: roundTo); - LabelwithTextfield(outList.GetRect(lineHeight), formattedLabel, tooltip, ref fieldValue, range); - sliderValue = Widgets.HorizontalSlider_NewTemp(outList.GetRect(lineHeight), sliderValue, range.TrueMin, range.TrueMax, roundTo: roundTo); - - if (Mathf.Abs(fieldValue - handle.Value) > minChange) - handle.Value = fieldValue; + if (Mathf.Abs(fieldValue - value) > minChange) + value = fieldValue; else - handle.Value = sliderValue; - } - - public static void CheckboxLabeled(this Listing_Standard outList, string label, SettingHandle handle, string tooltip) - { - bool value = handle.Value; - outList.CheckboxLabeled(label, ref value, tooltip); - handle.Value = value; + value = sliderValue; } } } diff --git a/Source/RJWSexperience/SexHistory/RecordRandomizer.cs b/Source/RJWSexperience/SexHistory/RecordRandomizer.cs index 98d807b..c1b055b 100644 --- a/Source/RJWSexperience/SexHistory/RecordRandomizer.cs +++ b/Source/RJWSexperience/SexHistory/RecordRandomizer.cs @@ -11,7 +11,7 @@ namespace RJWSexperience.SexHistory { private static readonly rjw.Modules.Shared.Logs.ILog log = LogManager.GetLogger("RecordRandomizer"); - private static Configurations Settings => SexperienceMod.Settings; + private static Settings.SettingsTabHistory Settings => SexperienceMod.Settings.History; public static bool Randomize(Pawn pawn) { diff --git a/Source/RJWSexperience/SexHistory/SexHistoryComp.cs b/Source/RJWSexperience/SexHistory/SexHistoryComp.cs index 65f7928..61c3639 100644 --- a/Source/RJWSexperience/SexHistory/SexHistoryComp.cs +++ b/Source/RJWSexperience/SexHistory/SexHistoryComp.cs @@ -44,8 +44,6 @@ namespace RJWSexperience.SexHistory public Gizmo Gizmo { get; private set; } - public Pawn ParentPawn => parent as Pawn; - public SexPartnerHistoryRecord GetFirstPartnerHistory => histories.TryGetValue(first); public SexPartnerHistoryRecord GetMostPartnerHistory @@ -247,16 +245,17 @@ namespace RJWSexperience.SexHistory public void RecordSex(Pawn partner, SexProps props) { + Pawn pawn = parent as Pawn; RecordFirst(partner, props); GetPartnerRecord(partner)?.RecordSex(props); recentPartner = partner.ThingID; recentSex = props.sexType; sextypeCount[(int)props.sexType]++; sextypeRecentTickAbs[(int)props.sexType] = GenTicks.TicksAbs; - if (partner.IsIncest(ParentPawn)) incestuous++; + if (partner.IsIncest(pawn)) incestuous++; if (partner.Dead) corpsefuck++; if (props.IsBestiality()) bestiality++; - else if (ParentPawn.def != partner.def) interspecies++; + else if (pawn.def != partner.def) interspecies++; dirty = true; } @@ -276,7 +275,7 @@ namespace RJWSexperience.SexHistory first = partner.ThingID; SexHistoryComp history = partner.TryGetComp(); firstSexTickAbs = GenTicks.TicksAbs; - history?.TakeSomeonesVirgin(ParentPawn); + history?.TakeSomeonesVirgin(parent as Pawn); } } @@ -289,9 +288,12 @@ namespace RJWSexperience.SexHistory return record; } - SexPartnerHistoryRecord newRecord = new SexPartnerHistoryRecord(partner, partner.IsIncest(ParentPawn)); + SexPartnerHistoryRecord newRecord = new SexPartnerHistoryRecord(partner, partner.IsIncest(parent as Pawn)); histories.Add(partnerId, newRecord); - ParentPawn.records.Increment(VariousDefOf.SexPartnerCount); + if (parent is Pawn pawn) + { + pawn.records.Increment(VariousDefOf.SexPartnerCount); + } return newRecord; } @@ -416,21 +418,10 @@ namespace RJWSexperience.SexHistory protected bool VirginCheck() { - if (histories.TryGetValue(first) != null) - return false; + if (histories.TryGetValue(first) != null) return false; - return ParentPawn.IsVirgin(); - } - - public override IEnumerable CompGetGizmosExtra() - { - if (SexperienceMod.Settings.HideGizmoWhenDrafted && ParentPawn.Drafted) - yield break; - - if (Find.Selector.NumSelected > 1) - yield break; - - yield return Gizmo; + Pawn pawn = parent as Pawn; + return pawn?.IsVirgin() == true; } public override void Initialize(CompProperties props) @@ -445,7 +436,7 @@ namespace RJWSexperience.SexHistory hotKey = VariousDefOf.OpenSexStatistics, action = delegate { - UI.SexStatusWindow.ToggleWindow(ParentPawn, this); + UI.SexStatusWindow.ToggleWindow(parent as Pawn, this); } }; } diff --git a/Source/RJWSexperience/SexHistory/UI/SexStatus.cs b/Source/RJWSexperience/SexHistory/UI/SexStatus.cs index 880933b..4d8c65a 100644 --- a/Source/RJWSexperience/SexHistory/UI/SexStatus.cs +++ b/Source/RJWSexperience/SexHistory/UI/SexStatus.cs @@ -223,7 +223,7 @@ namespace RJWSexperience.SexHistory.UI DrawBaseSexInfoLeft(leftRect.ContractedBy(4f)); //Center section - DrawBaseSexInfoCenter(centerRect.ContractedBy(4f), history.ParentPawn); + DrawBaseSexInfoCenter(centerRect.ContractedBy(4f), history.parent as Pawn); //Right section DrawBaseSexInfoRight(rightRect.ContractedBy(4f)); @@ -367,7 +367,7 @@ namespace RJWSexperience.SexHistory.UI if (Widgets.ButtonInvisible(lockRect)) { SoundDefOf.Click.PlayOneShotOnCamera(); - settings.SelectionLocked.Value = !settings.SelectionLocked.Value; + settings.SelectionLocked = !settings.SelectionLocked; } } diff --git a/Source/RJWSexperience/SexperienceMod.cs b/Source/RJWSexperience/SexperienceMod.cs index e02e4bc..6478764 100644 --- a/Source/RJWSexperience/SexperienceMod.cs +++ b/Source/RJWSexperience/SexperienceMod.cs @@ -7,7 +7,8 @@ namespace RJWSexperience { public class SexperienceMod : Mod { - public static Configurations Settings { get; private set; } + private static Configurations settings; + public static Configurations Settings { get => settings; } public ITab CurrentTab { get; private set; } @@ -15,7 +16,8 @@ namespace RJWSexperience public SexperienceMod(ModContentPack content) : base(content) { - Settings = GetSettings(); + settings = GetSettings(); + CurrentTab = settings; tabRecords = new List(); } @@ -32,15 +34,13 @@ namespace RJWSexperience { List tabs = new List { - new SettingsTabMain(Settings), - new SettingsTabHistory(Settings), - new SettingsTabDebug(Settings), + settings, + settings.History, + settings.Debug }; foreach (ITab tab in tabs) tabRecords.Add(new TabRecord(tab.Label, delegate { this.CurrentTab = tab; }, delegate { return this?.CurrentTab == tab; })); - - CurrentTab = tabs[0]; } public override void DoSettingsWindowContents(Rect inRect) diff --git a/Source/RJWSexperience/Virginity/TraitHandler.cs b/Source/RJWSexperience/Virginity/TraitHandler.cs index 40261d6..9955f80 100644 --- a/Source/RJWSexperience/Virginity/TraitHandler.cs +++ b/Source/RJWSexperience/Virginity/TraitHandler.cs @@ -53,7 +53,7 @@ namespace RJWSexperience.Virginity return null; int degree = virgin.Degree; - if (pawn.gender == Gender.Female && degree > 0 && pawn.Spawned && !pawn.Dead) + if (pawn.gender == Gender.Female && degree > 0 && !pawn.Dead) { FilthMaker.TryMakeFilth(pawn.Position, pawn.Map, ThingDefOf.Filth_Blood, pawn.LabelShort, 1, FilthSourceFlags.Pawn); } diff --git a/Source/RJWSexperienceCum/RJWSexperienceCum.csproj b/Source/RJWSexperienceCum/RJWSexperienceCum.csproj index bdb12b3..e137ffe 100644 --- a/Source/RJWSexperienceCum/RJWSexperienceCum.csproj +++ b/Source/RJWSexperienceCum/RJWSexperienceCum.csproj @@ -47,7 +47,7 @@ - 1.4.3641 + 1.4.3524 diff --git a/changelogs.txt b/changelogs.txt index ff36265..da650a5 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,9 +1,3 @@ -Version 1.1.3.0 - - Removed "Hide Sex History button with RJW designators" setting - - Fixed error with pawn masturbated on the map border - - Fixed counting self as a sex partner - - Fixed patch on FindSexLocation returning location in walls - Version 1.1.2.1 - Fixed 1.3 assembly