2022-12-27 12:48:38 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using rjw;
|
|
|
|
|
using Verse;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
using rjw.Modules.Interactions.Rules.PartKindUsageRules;
|
|
|
|
|
using rjw.Modules.Interactions.Internals.Implementation;
|
|
|
|
|
|
|
|
|
|
namespace RJW_Genes
|
|
|
|
|
{
|
|
|
|
|
[StaticConstructorOnStartup]
|
|
|
|
|
internal static class First
|
|
|
|
|
{
|
|
|
|
|
static First()
|
|
|
|
|
{
|
|
|
|
|
AddtoIPartPreferenceRule();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Modified code from https://gitgud.io/lutepickle/rjw_menstruation/-/tree/main/1.4/source/RJW_Menstruation/RJW_Menstruation
|
2022-12-27 13:54:47 +00:00
|
|
|
|
//Summary//
|
|
|
|
|
//Adds our own partpreferences to rjw's list. Our partpreferences are under Interactions.GenesPartKindUsageRule
|
|
|
|
|
//
|
2023-01-21 16:45:33 +00:00
|
|
|
|
private static void InjectIntoRjwInteractionServices()
|
2022-12-27 12:48:38 +00:00
|
|
|
|
{
|
|
|
|
|
List<IPartPreferenceRule> partPreferenceRules = Unprivater.GetProtectedValue<List<IPartPreferenceRule>>("_partKindUsageRules", typeof(PartPreferenceDetectorService));
|
|
|
|
|
partPreferenceRules.Add(new Interactions.GenesPartKindUsageRule());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|