mirror of
https://gitgud.io/LonelyRain/rjw-quirks.git
synced 2024-08-15 00:03:31 +00:00
26 lines
1,007 B
C#
26 lines
1,007 B
C#
using HarmonyLib;
|
|
using rjw.Modules.Interactions.Contexts;
|
|
using rjw.Modules.Interactions.Internals.Implementation;
|
|
using rjw.Modules.Interactions.Rules.PartKindUsageRules;
|
|
using rjwquirks.Modules.Interactions;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Verse;
|
|
|
|
namespace rjwquirks.HarmonyPatches
|
|
{
|
|
[HarmonyPatch(typeof(PartPreferenceDetectorService), nameof(PartPreferenceDetectorService.DetectPartPreferences))]
|
|
public class Patch_PartPreferenceDetectorService
|
|
{
|
|
public static void Prefix(InteractionContext context, IList<IPartPreferenceRule> ____partKindUsageRules)
|
|
{
|
|
if (____partKindUsageRules.Any(x => x.GetType() == typeof(QuirksPartKindUsageRule)) || (context.Internals.Submissive.Pawn.GetQuirks() == null || context.Internals.Dominant.Pawn.GetQuirks() == null))
|
|
return;
|
|
|
|
____partKindUsageRules.Add(new QuirksPartKindUsageRule());
|
|
}
|
|
}
|
|
}
|