mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
New settings handling
This commit is contained in:
parent
fed4b54915
commit
8d49addd63
24 changed files with 309 additions and 233 deletions
37
Source/RJWSexperience/Patches/ConditionalDefLoad.cs
Normal file
37
Source/RJWSexperience/Patches/ConditionalDefLoad.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*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<bool>(settingName))
|
||||
{
|
||||
__result = null;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}*/
|
|
@ -11,7 +11,7 @@ namespace RJWSexperience
|
|||
{
|
||||
static DefInjection()
|
||||
{
|
||||
if (SexperienceMod.Settings.History.EnableSexHistory)
|
||||
if (SexperienceMod.Settings.EnableSexHistory)
|
||||
InjectRaces();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace RJWSexperience
|
|||
{
|
||||
public static class Pawn_GetGizmos
|
||||
{
|
||||
private static Settings.SettingsTabHistory Settings => SexperienceMod.Settings.History;
|
||||
private static Configurations Settings => SexperienceMod.Settings;
|
||||
|
||||
public static void DoConditionalPatch(Harmony harmony)
|
||||
{
|
||||
|
|
|
@ -44,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.History.EnableSexHistory && props.partner != null)
|
||||
if (SexperienceMod.Settings.EnableSexHistory && props.partner != null)
|
||||
props.pawn.TryGetComp<SexHistoryComp>()?.RecordSatisfaction(props.partner, props, satisfaction);
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ namespace RJWSexperience
|
|||
{
|
||||
RJWUtility.UpdateSextypeRecords(props);
|
||||
|
||||
if (!SexperienceMod.Settings.History.EnableSexHistory || props.partner == null)
|
||||
if (!SexperienceMod.Settings.EnableSexHistory || props.partner == null)
|
||||
return;
|
||||
|
||||
props.pawn.TryGetComp<SexHistoryComp>()?.RecordSex(props.partner, props);
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace RJWSexperience
|
|||
|
||||
bool doVirginTrait = true;
|
||||
|
||||
if (SexperienceMod.Settings.History.EnableRecordRandomizer && __result.DevelopmentalStage != DevelopmentalStage.Newborn && xxx.is_human(__result))
|
||||
if (SexperienceMod.Settings.EnableRecordRandomizer && __result.DevelopmentalStage != DevelopmentalStage.Newborn && xxx.is_human(__result))
|
||||
doVirginTrait = SexHistory.RecordRandomizer.Randomize(__result);
|
||||
|
||||
if (doVirginTrait)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue