mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Rename source folder
This commit is contained in:
parent
0a412a0060
commit
a4c046a841
55 changed files with 0 additions and 0 deletions
31
Source/RJWSexperience/Patches/DefInjection.cs
Normal file
31
Source/RJWSexperience/Patches/DefInjection.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using RJWSexperience.Logs;
|
||||
using RJWSexperience.SexHistory;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
[StaticConstructorOnStartup]
|
||||
public static class DefInjection
|
||||
{
|
||||
static DefInjection()
|
||||
{
|
||||
if (SexperienceMod.Settings.History.EnableSexHistory)
|
||||
InjectRaces();
|
||||
}
|
||||
|
||||
private static void InjectRaces()
|
||||
{
|
||||
IEnumerable<ThingDef> PawnDefs = DefDatabase<ThingDef>.AllDefs.Where(x => x.race != null && !x.race.IsMechanoid);
|
||||
if (PawnDefs.EnumerableNullOrEmpty())
|
||||
return;
|
||||
|
||||
CompProperties comp = new CompProperties(typeof(SexHistoryComp));
|
||||
foreach (ThingDef def in PawnDefs)
|
||||
def.comps.Add(comp);
|
||||
|
||||
LogManager.GetLogger<DebugLogProvider>("StaticConstructorOnStartup").Message($"Injected SexHistoryComp into {PawnDefs.Count()} pawn Defs");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue