Rename SexPartnerHistory to SexHistoryComp

This commit is contained in:
amevarashi 2022-05-22 22:33:34 +05:00
parent b4231341ff
commit 5130c70655
7 changed files with 16 additions and 18 deletions

View file

@ -85,7 +85,7 @@ namespace RJWSexperience
{ {
if (pawn.IsVirgin()) if (pawn.IsVirgin())
{ {
SexPartnerHistory history = pawn.TryGetComp<SexPartnerHistory>(); SexHistoryComp history = pawn.TryGetComp<SexHistoryComp>();
history?.RecordFirst(partner, props); history?.RecordFirst(partner, props);
if (RJWUtility.RemoveVirginTrait(pawn, partner, props)) if (RJWUtility.RemoveVirginTrait(pawn, partner, props))
{ {

View file

@ -25,7 +25,7 @@ namespace RJWSexperience
private static void InjectComp(List<ThingDef> PawnDefs) private static void InjectComp(List<ThingDef> PawnDefs)
{ {
CompProperties comp = new CompProperties(typeof(SexPartnerHistory)); CompProperties comp = new CompProperties(typeof(SexHistoryComp));
if (!PawnDefs.NullOrEmpty()) foreach(ThingDef def in PawnDefs) if (!PawnDefs.NullOrEmpty()) foreach(ThingDef def in PawnDefs)
{ {
def.comps.Add(comp); def.comps.Add(comp);

View file

@ -20,7 +20,7 @@ namespace RJWSexperience
foreach (Gizmo gizmo in gizmos) foreach (Gizmo gizmo in gizmos)
yield return gizmo; yield return gizmo;
SexPartnerHistory history = pawn.TryGetComp<SexPartnerHistory>(); SexHistoryComp history = pawn.TryGetComp<SexHistoryComp>();
if (history != null) if (history != null)
yield return history.Gizmo; yield return history.Gizmo;
} }

View file

@ -71,7 +71,7 @@
<Compile Include="SexHistory\RecordRandomizer.cs" /> <Compile Include="SexHistory\RecordRandomizer.cs" />
<Compile Include="RJWUtility.cs" /> <Compile Include="RJWUtility.cs" />
<Compile Include="SexHistory\HistoryUtility.cs" /> <Compile Include="SexHistory\HistoryUtility.cs" />
<Compile Include="SexHistory\SexPartnerHistory.cs" /> <Compile Include="SexHistory\SexHistoryComp.cs" />
<Compile Include="SexHistory\SexPartnerHistoryRecord.cs" /> <Compile Include="SexHistory\SexPartnerHistoryRecord.cs" />
<Compile Include="PawnRelationWorker_Bastard.cs" /> <Compile Include="PawnRelationWorker_Bastard.cs" />
<Compile Include="Keyed.cs" /> <Compile Include="Keyed.cs" />

View file

@ -159,7 +159,7 @@ namespace RJWSexperience
{ {
if (partner != null) if (partner != null)
{ {
SexPartnerHistory pawnshistory = pawn.TryGetComp<SexPartnerHistory>(); SexHistoryComp pawnshistory = pawn.TryGetComp<SexHistoryComp>();
pawnshistory?.RecordSex(partner, props); pawnshistory?.RecordSex(partner, props);
} }
} }
@ -168,7 +168,7 @@ namespace RJWSexperience
{ {
if (partner != null) if (partner != null)
{ {
SexPartnerHistory pawnshistory = pawn.TryGetComp<SexPartnerHistory>(); SexHistoryComp pawnshistory = pawn.TryGetComp<SexHistoryComp>();
pawnshistory?.RecordSatisfaction(partner, props, satisfaction); pawnshistory?.RecordSatisfaction(partner, props, satisfaction);
} }
} }

View file

@ -1,14 +1,12 @@
using RimWorld; using rjw;
using rjw;
using RJWSexperience.ExtensionMethods; using RJWSexperience.ExtensionMethods;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine;
using Verse; using Verse;
namespace RJWSexperience namespace RJWSexperience
{ {
public class SexPartnerHistory : ThingComp public class SexHistoryComp : ThingComp
{ {
public const int ARRLEN = 20; public const int ARRLEN = 20;
@ -275,7 +273,7 @@ namespace RJWSexperience
if (VirginCheck() && props.sexType == xxx.rjwSextype.Vaginal) if (VirginCheck() && props.sexType == xxx.rjwSextype.Vaginal)
{ {
first = partner.ThingID; first = partner.ThingID;
SexPartnerHistory history = partner.TryGetComp<SexPartnerHistory>(); SexHistoryComp history = partner.TryGetComp<SexHistoryComp>();
firstSexTickAbs = GenTicks.TicksAbs; firstSexTickAbs = GenTicks.TicksAbs;
history?.TakeSomeonesVirgin(parent as Pawn); history?.TakeSomeonesVirgin(parent as Pawn);
} }

View file

@ -56,7 +56,7 @@ namespace RJWSexperience.UI
protected Pawn pawn; protected Pawn pawn;
protected SexPartnerHistoryRecord selectedPawn; protected SexPartnerHistoryRecord selectedPawn;
protected SexPartnerHistory history; protected SexHistoryComp history;
protected CompRJW rjwcomp; protected CompRJW rjwcomp;
protected List<SexPartnerHistoryRecord> partnerList; protected List<SexPartnerHistoryRecord> partnerList;
protected PartnerOrderMode orderMode; protected PartnerOrderMode orderMode;
@ -73,7 +73,7 @@ namespace RJWSexperience.UI
private static Vector2 LastWindowPosition { get; set; } private static Vector2 LastWindowPosition { get; set; }
private Vector2 scroll; private Vector2 scroll;
public SexStatusWindow(Pawn pawn, SexPartnerHistory history) public SexStatusWindow(Pawn pawn, SexHistoryComp history)
{ {
this.pawn = pawn; this.pawn = pawn;
this.history = history; this.history = history;
@ -120,7 +120,7 @@ namespace RJWSexperience.UI
Pawn p = selected.First(); Pawn p = selected.First();
if (p != pawn) if (p != pawn)
{ {
SexPartnerHistory h = p.TryGetComp<SexPartnerHistory>(); SexHistoryComp h = p.TryGetComp<SexHistoryComp>();
if (h != null) ChangePawn(p, h); if (h != null) ChangePawn(p, h);
} }
} }
@ -129,7 +129,7 @@ namespace RJWSexperience.UI
DrawSexStatus(inRect, history); DrawSexStatus(inRect, history);
} }
public static void ToggleWindow(Pawn pawn, SexPartnerHistory history) public static void ToggleWindow(Pawn pawn, SexHistoryComp history)
{ {
SexStatusWindow window = (SexStatusWindow)Find.WindowStack.Windows.FirstOrDefault(x => x.GetType() == typeof(SexStatusWindow)); SexStatusWindow window = (SexStatusWindow)Find.WindowStack.Windows.FirstOrDefault(x => x.GetType() == typeof(SexStatusWindow));
if (window != null) if (window != null)
@ -146,7 +146,7 @@ namespace RJWSexperience.UI
} }
} }
public void ChangePawn(Pawn pawn, SexPartnerHistory history) public void ChangePawn(Pawn pawn, SexHistoryComp history)
{ {
List<Pawn> selected = Find.Selector.SelectedPawns; List<Pawn> selected = Find.Selector.SelectedPawns;
if (!selected.NullOrEmpty()) if (!selected.NullOrEmpty())
@ -189,7 +189,7 @@ namespace RJWSexperience.UI
/// <summary> /// <summary>
/// Main contents /// Main contents
/// </summary> /// </summary>
protected void DrawSexStatus(Rect mainrect, SexPartnerHistory history) protected void DrawSexStatus(Rect mainrect, SexHistoryComp history)
{ {
float sectionwidth = mainrect.width / 3; float sectionwidth = mainrect.width / 3;
@ -228,7 +228,7 @@ namespace RJWSexperience.UI
Widgets.DrawHighlightIfMouseover(portraitRect); Widgets.DrawHighlightIfMouseover(portraitRect);
if (Widgets.ButtonInvisible(portraitRect)) if (Widgets.ButtonInvisible(portraitRect))
{ {
SexPartnerHistory pawnhistory = partner?.TryGetComp<SexPartnerHistory>(); SexHistoryComp pawnhistory = partner?.TryGetComp<SexHistoryComp>();
if (pawnhistory != null) if (pawnhistory != null)
{ {
ChangePawn(partner, pawnhistory); ChangePawn(partner, pawnhistory);