mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Basic cleanup of errors related to new rimworld API
This commit is contained in:
		
							parent
							
								
									908eb01a50
								
							
						
					
					
						commit
						6b3044488d
					
				
					 15 changed files with 61 additions and 41 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								1.4/Assemblies/RJW_Menstruation.dll
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								1.4/Assemblies/RJW_Menstruation.dll
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										6
									
								
								1.4/Assemblies/RJW_Menstruation.dll.config
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								1.4/Assemblies/RJW_Menstruation.dll.config
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
 | 
					<configuration>
 | 
				
			||||||
 | 
					    <startup> 
 | 
				
			||||||
 | 
					        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
 | 
				
			||||||
 | 
					    </startup>
 | 
				
			||||||
 | 
					</configuration>
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								1.4/MilkModule/Assemblies/MilkModule.dll
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								1.4/MilkModule/Assemblies/MilkModule.dll
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -9,9 +9,10 @@
 | 
				
			||||||
    <AppDesignerFolder>Properties</AppDesignerFolder>
 | 
					    <AppDesignerFolder>Properties</AppDesignerFolder>
 | 
				
			||||||
    <RootNamespace>MilkModule</RootNamespace>
 | 
					    <RootNamespace>MilkModule</RootNamespace>
 | 
				
			||||||
    <AssemblyName>MilkModule</AssemblyName>
 | 
					    <AssemblyName>MilkModule</AssemblyName>
 | 
				
			||||||
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
 | 
					    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
 | 
				
			||||||
    <FileAlignment>512</FileAlignment>
 | 
					    <FileAlignment>512</FileAlignment>
 | 
				
			||||||
    <Deterministic>true</Deterministic>
 | 
					    <Deterministic>true</Deterministic>
 | 
				
			||||||
 | 
					    <TargetFrameworkProfile />
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
 | 
					  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
 | 
				
			||||||
    <DebugSymbols>true</DebugSymbols>
 | 
					    <DebugSymbols>true</DebugSymbols>
 | 
				
			||||||
| 
						 | 
					@ -94,8 +95,9 @@
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <PackageReference Include="Lib.Harmony">
 | 
					    <PackageReference Include="Lib.Harmony">
 | 
				
			||||||
      <Version>2.1.1</Version>
 | 
					      <Version>2.2.2</Version>
 | 
				
			||||||
      <ExcludeAssets>runtime</ExcludeAssets>
 | 
					      <ExcludeAssets>runtime</ExcludeAssets>
 | 
				
			||||||
 | 
					      <IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
 | 
				
			||||||
    </PackageReference>
 | 
					    </PackageReference>
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 | 
					  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
<?xml version="1.0" encoding="utf-8" ?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<configuration>
 | 
					<configuration>
 | 
				
			||||||
    <startup> 
 | 
					    <startup> 
 | 
				
			||||||
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
 | 
					        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
 | 
				
			||||||
    </startup>
 | 
					    </startup>
 | 
				
			||||||
</configuration>
 | 
					</configuration>
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,6 @@ namespace RJW_Menstruation
 | 
				
			||||||
            AlienPartGenerator.AlienComp babyHARComp = baby?.TryGetComp<AlienPartGenerator.AlienComp>();
 | 
					            AlienPartGenerator.AlienComp babyHARComp = baby?.TryGetComp<AlienPartGenerator.AlienComp>();
 | 
				
			||||||
            AlienPartGenerator.AlienComp originalHARComp = original?.TryGetComp<AlienPartGenerator.AlienComp>();
 | 
					            AlienPartGenerator.AlienComp originalHARComp = original?.TryGetComp<AlienPartGenerator.AlienComp>();
 | 
				
			||||||
            if (babyHARComp == null || originalHARComp == null) return;
 | 
					            if (babyHARComp == null || originalHARComp == null) return;
 | 
				
			||||||
            babyHARComp.crownType = originalHARComp.crownType;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            foreach(KeyValuePair<string, AlienPartGenerator.ExposableValueTuple<Color, Color>> channel in originalHARComp.ColorChannels)
 | 
					            foreach(KeyValuePair<string, AlienPartGenerator.ExposableValueTuple<Color, Color>> channel in originalHARComp.ColorChannels)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -213,8 +213,11 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ((Pawn.relations == null)) return youngestAge;
 | 
					            if ((Pawn.relations == null)) return youngestAge;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            List<Hediff_BasePregnancy> pregnancies = new List<Hediff_BasePregnancy>();
 | 
				
			||||||
 | 
					            Pawn.health.hediffSet.GetHediffs(ref pregnancies);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            bool hasChild = Pawn.relations.Children.
 | 
					            bool hasChild = Pawn.relations.Children.
 | 
				
			||||||
                Where(child => !Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child))). // no fetuses
 | 
					                Where(child => !pregnancies.Any(preg => preg.babies.Contains(child))). // no fetuses
 | 
				
			||||||
                Where(child => child.GetMother() == Pawn).  // not Dad
 | 
					                Where(child => child.GetMother() == Pawn).  // not Dad
 | 
				
			||||||
                TryMinBy(child => child.ageTracker.AgeBiologicalTicks, out Pawn youngest);
 | 
					                TryMinBy(child => child.ageTracker.AgeBiologicalTicks, out Pawn youngest);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1223,7 +1223,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                    deadeggs.Add(egg);
 | 
					                    deadeggs.Add(egg);
 | 
				
			||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else if (Pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().Any() || pregnancy is Hediff_MechanoidPregnancy)
 | 
					                else if (Pawn.health.hediffSet.GetFirstHediff<Hediff_InsectEgg>() != null || pregnancy is Hediff_MechanoidPregnancy)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (Configurations.Debug) Log.Message($"Could not implant {Pawn}'s egg due to insect or mechanoid pregnancy");
 | 
					                    if (Configurations.Debug) Log.Message($"Could not implant {Pawn}'s egg due to insect or mechanoid pregnancy");
 | 
				
			||||||
                    deadeggs.Add(egg);
 | 
					                    deadeggs.Add(egg);
 | 
				
			||||||
| 
						 | 
					@ -1257,7 +1257,9 @@ namespace RJW_Menstruation
 | 
				
			||||||
                            if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy");
 | 
					                            if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy");
 | 
				
			||||||
                            PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
 | 
					                            PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
 | 
				
			||||||
                            // I hate having to do this, but it gets the newest pregnancy
 | 
					                            // I hate having to do this, but it gets the newest pregnancy
 | 
				
			||||||
                            pregnancy = Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.loadID);
 | 
					                            List<Hediff_BasePregnancy> pregnancies = new List<Hediff_BasePregnancy>();
 | 
				
			||||||
 | 
					                            Pawn.health.hediffSet.GetHediffs(ref pregnancies);
 | 
				
			||||||
 | 
					                            pregnancy = pregnancies.MaxBy(hediff => hediff.loadID);
 | 
				
			||||||
                            pregnant = true;
 | 
					                            pregnant = true;
 | 
				
			||||||
                            break;
 | 
					                            break;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					@ -1754,8 +1756,11 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (pregnancy != null) return;
 | 
					            if (pregnancy != null) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            List<Hediff_BasePregnancy> pregnancies = new List<Hediff_BasePregnancy>();
 | 
				
			||||||
 | 
					            Pawn.health.hediffSet.GetHediffs(ref pregnancies);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            pregnancy =
 | 
					            pregnancy =
 | 
				
			||||||
                Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Except(
 | 
					                pregnancies.Except(
 | 
				
			||||||
                    Pawn.GetMenstruationComps().Select(comp => comp.pregnancy).Where(preg => preg != null)
 | 
					                    Pawn.GetMenstruationComps().Select(comp => comp.pregnancy).Where(preg => preg != null)
 | 
				
			||||||
                    ).FirstOrDefault();
 | 
					                    ).FirstOrDefault();
 | 
				
			||||||
            if (pregnancy != null)
 | 
					            if (pregnancy != null)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -158,7 +158,9 @@ namespace RJW_Menstruation
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static Texture2D GetInsectEggedIcon(this HediffComp_Menstruation comp)
 | 
					        public static Texture2D GetInsectEggedIcon(this HediffComp_Menstruation comp)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            List<Hediff_InsectEgg> hediffs = comp.Pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().ToList();
 | 
					            List<Hediff_InsectEgg> hediffs = new List<Hediff_InsectEgg>();
 | 
				
			||||||
 | 
					            comp.Pawn.health.hediffSet.GetHediffs(ref hediffs);
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
            if (hediffs.NullOrEmpty()) return null;
 | 
					            if (hediffs.NullOrEmpty()) return null;
 | 
				
			||||||
            string path = "Womb/Insect_Egged/";
 | 
					            string path = "Womb/Insect_Egged/";
 | 
				
			||||||
            if (hediffs.Max(hediff => hediff.eggssize) > 0.3)   // The threshold for "large egg" in the debug
 | 
					            if (hediffs.Max(hediff => hediff.eggssize) > 0.3)   // The threshold for "large egg" in the debug
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -375,34 +375,34 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool AddNewBaby(Pawn mother, Pawn father)
 | 
					        public bool AddNewBaby(Pawn mother, Pawn father)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            float melanin;
 | 
					            //float melanin;
 | 
				
			||||||
            string lastname;
 | 
					            string lastname;
 | 
				
			||||||
            if (xxx.is_human(mother))
 | 
					            if (xxx.is_human(mother))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (xxx.is_human(father))
 | 
					                if (xxx.is_human(father))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    melanin = ChildRelationUtility.GetRandomChildSkinColor(father.story?.melanin ?? 0f, mother.story?.melanin ?? 0f);
 | 
					                    //melanin = ChildRelationUtility.GetRandomChildSkinColor(father.story?.melanin ?? 0f, mother.story?.melanin ?? 0f);
 | 
				
			||||||
                    //melanin = (mother.story?.melanin ?? 0f + father.story?.melanin ?? 0f) / 2;
 | 
					                    //melanin = (mother.story?.melanin ?? 0f + father.story?.melanin ?? 0f) / 2;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    melanin = mother.story?.melanin ?? 0f;
 | 
					                    //melanin = mother.story?.melanin ?? 0f;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                lastname = NameTriple.FromString(mother.Name.ToStringFull).Last;
 | 
					                lastname = NameTriple.FromString(mother.Name.ToStringFull).Last;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else if (xxx.is_human(father))
 | 
					            else if (xxx.is_human(father))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                melanin = father.story?.melanin ?? 0f;
 | 
					                //melanin = father.story?.melanin ?? 0f;
 | 
				
			||||||
                lastname = NameTriple.FromString(father.Name.ToStringFull).Last;
 | 
					                lastname = NameTriple.FromString(father.Name.ToStringFull).Last;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                melanin = Rand.Range(0, 1.0f);
 | 
					                //melanin = Rand.Range(0, 1.0f);
 | 
				
			||||||
                lastname = "";
 | 
					                lastname = "";
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            PawnGenerationRequest request = new PawnGenerationRequest(
 | 
					            PawnGenerationRequest request = new PawnGenerationRequest(
 | 
				
			||||||
                newborn: true,
 | 
					                developmentalStages: DevelopmentalStage.Newborn,
 | 
				
			||||||
                allowDowned: true,
 | 
					                allowDowned: true,
 | 
				
			||||||
                faction: mother.Faction,
 | 
					                faction: mother.Faction,
 | 
				
			||||||
                canGeneratePawnRelations: false,
 | 
					                canGeneratePawnRelations: false,
 | 
				
			||||||
| 
						 | 
					@ -411,7 +411,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                allowFood: false,
 | 
					                allowFood: false,
 | 
				
			||||||
                allowAddictions: false,
 | 
					                allowAddictions: false,
 | 
				
			||||||
                relationWithExtraPawnChanceFactor: 0,
 | 
					                relationWithExtraPawnChanceFactor: 0,
 | 
				
			||||||
                fixedMelanin: melanin,
 | 
					                //fixedMelanin: melanin,
 | 
				
			||||||
                fixedLastName: lastname,
 | 
					                fixedLastName: lastname,
 | 
				
			||||||
                kind: BabyPawnKindDecider(mother, father),
 | 
					                kind: BabyPawnKindDecider(mother, father),
 | 
				
			||||||
                //fixedIdeo: mother.Ideo,
 | 
					                //fixedIdeo: mother.Ideo,
 | 
				
			||||||
| 
						 | 
					@ -421,7 +421,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            int division = 1;
 | 
					            int division = 1;
 | 
				
			||||||
            Pawn firstbaby = null;
 | 
					            Pawn firstbaby = null;
 | 
				
			||||||
            string firstheadpath = null;
 | 
					            //string firstheadpath = null;
 | 
				
			||||||
            int traitSeed = Rand.Int;
 | 
					            int traitSeed = Rand.Int;
 | 
				
			||||||
            List<Trait> parentTraits = GetInheritableTraits(mother, father);
 | 
					            List<Trait> parentTraits = GetInheritableTraits(mother, father);
 | 
				
			||||||
            while (Rand.Chance(Configurations.EnzygoticTwinsChance) && division < Configurations.MaxEnzygoticTwins) division++;
 | 
					            while (Rand.Chance(Configurations.EnzygoticTwinsChance) && division < Configurations.MaxEnzygoticTwins) division++;
 | 
				
			||||||
| 
						 | 
					@ -438,13 +438,13 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if (baby.story != null)
 | 
					                        if (baby.story != null)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            firstheadpath = (string)baby.story.GetMemberValue("headGraphicPath");
 | 
					                            //    firstheadpath = (string)baby.story.GetMemberValue("headGraphicPath");
 | 
				
			||||||
                            if (firstheadpath == null)
 | 
					                            //    if (firstheadpath == null)
 | 
				
			||||||
                            {
 | 
					                            //    {
 | 
				
			||||||
                                Graphic_Multi head = GraphicDatabaseHeadRecords.GetHeadRandom(baby.gender, baby.story.SkinColor, baby.story.crownType, true);
 | 
					                            //        Graphic_Multi head = GraphicDatabaseHeadRecords.GetHeadRandom(baby.gender, baby.story.SkinColor, baby.story.crownType, true);
 | 
				
			||||||
                                if (head != null) baby.story.SetMemberValue("headGraphicPath", head.GraphicPath);
 | 
					                            //        if (head != null) baby.story.SetMemberValue("headGraphicPath", head.GraphicPath);
 | 
				
			||||||
                                firstheadpath = (string)baby.story.GetMemberValue("headGraphicPath");
 | 
					                            //        firstheadpath = (string)baby.story.GetMemberValue("headGraphicPath");
 | 
				
			||||||
                            }
 | 
					                            //    }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
| 
						 | 
					@ -454,16 +454,16 @@ namespace RJW_Menstruation
 | 
				
			||||||
                        if (baby.story != null)
 | 
					                        if (baby.story != null)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            baby.story.hairDef = firstbaby.story.hairDef;
 | 
					                            baby.story.hairDef = firstbaby.story.hairDef;
 | 
				
			||||||
                            baby.story.hairColor = firstbaby.story.hairColor;
 | 
					                            //baby.story.hairColor = firstbaby.story.hairColor;
 | 
				
			||||||
                            baby.story.bodyType = firstbaby.story.bodyType;
 | 
					                            baby.story.bodyType = firstbaby.story.bodyType;
 | 
				
			||||||
                            baby.story.crownType = firstbaby.story.crownType;
 | 
					                            //baby.story.crownType = firstbaby.story.crownType;
 | 
				
			||||||
                            baby.story.SetMemberValue("headGraphicPath", firstheadpath);
 | 
					                            //baby.story.SetMemberValue("headGraphicPath", firstheadpath);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if (baby.IsHAR())
 | 
					                        if (baby.IsHAR())
 | 
				
			||||||
                            HARCompatibility.CopyHARProperties(baby, firstbaby);
 | 
					                            HARCompatibility.CopyHARProperties(baby, firstbaby);
 | 
				
			||||||
                        if (Configurations.AnimalGeneticsActivated)
 | 
					                        //if (Configurations.AnimalGeneticsActivated)
 | 
				
			||||||
                            AnimalGeneticsCompatibility.CopyGenes(baby, firstbaby);
 | 
					                            //AnimalGeneticsCompatibility.CopyGenes(baby, firstbaby);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                babies.Add(baby);
 | 
					                babies.Add(baby);
 | 
				
			||||||
| 
						 | 
					@ -475,9 +475,9 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public Pawn GenerateBaby(PawnGenerationRequest request, Pawn mother, Pawn father, List<Trait> parentTraits, int traitSeed)
 | 
					        public Pawn GenerateBaby(PawnGenerationRequest request, Pawn mother, Pawn father, List<Trait> parentTraits, int traitSeed)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PreConception(mother, father);
 | 
					            //if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PreConception(mother, father);
 | 
				
			||||||
            Pawn baby = PawnGenerator.GeneratePawn(request);
 | 
					            Pawn baby = PawnGenerator.GeneratePawn(request);
 | 
				
			||||||
            if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PostConception();
 | 
					            //if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PostConception();
 | 
				
			||||||
            if (baby == null)
 | 
					            if (baby == null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Log.Error("Baby not generated. Request: " + request.ToString());
 | 
					                Log.Error("Baby not generated. Request: " + request.ToString());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -78,7 +78,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Hediff hediff = pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().FirstOrDefault();
 | 
					                Hediff hediff = pawn.health.hediffSet.GetFirstHediff<Hediff_InsectEgg>();
 | 
				
			||||||
                if (hediff != null)
 | 
					                if (hediff != null)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    icon = MenstruationUtility.GetInsectEggedIcon(comp);
 | 
					                    icon = MenstruationUtility.GetInsectEggedIcon(comp);
 | 
				
			||||||
| 
						 | 
					@ -103,7 +103,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                shrinkable = Configurations.AllowShrinkIcon,
 | 
					                shrinkable = Configurations.AllowShrinkIcon,
 | 
				
			||||||
                cumcolor = c,
 | 
					                cumcolor = c,
 | 
				
			||||||
                comp = comp,
 | 
					                comp = comp,
 | 
				
			||||||
                order = 100,
 | 
					                //order = 100,
 | 
				
			||||||
                hotKey = comp == pawn.GetFirstMenstruationComp() ? VariousDefOf.OpenStatusWindowKey : null,
 | 
					                hotKey = comp == pawn.GetFirstMenstruationComp() ? VariousDefOf.OpenStatusWindowKey : null,
 | 
				
			||||||
                groupKey = 0,
 | 
					                groupKey = 0,
 | 
				
			||||||
                action = delegate
 | 
					                action = delegate
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Pawn pawn = props.partner;
 | 
					            Pawn pawn = props.partner;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (props.sexType != xxx.rjwSextype.MechImplant && !pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().Any()) return;
 | 
					            if (props.sexType != xxx.rjwSextype.MechImplant && pawn.health.hediffSet.GetFirstHediff<Hediff_InsectEgg>() == null) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // The existing pregnancies might have been destroyed, so go through see if any new mech pregnancies need to be picked up
 | 
					            // The existing pregnancies might have been destroyed, so go through see if any new mech pregnancies need to be picked up
 | 
				
			||||||
            foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
 | 
					            foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@
 | 
				
			||||||
    <OutputType>Library</OutputType>
 | 
					    <OutputType>Library</OutputType>
 | 
				
			||||||
    <RootNamespace>RJW_Menstruation</RootNamespace>
 | 
					    <RootNamespace>RJW_Menstruation</RootNamespace>
 | 
				
			||||||
    <AssemblyName>RJW_Menstruation</AssemblyName>
 | 
					    <AssemblyName>RJW_Menstruation</AssemblyName>
 | 
				
			||||||
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
 | 
					    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
 | 
				
			||||||
    <FileAlignment>512</FileAlignment>
 | 
					    <FileAlignment>512</FileAlignment>
 | 
				
			||||||
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
 | 
					    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
 | 
				
			||||||
    <Deterministic>true</Deterministic>
 | 
					    <Deterministic>true</Deterministic>
 | 
				
			||||||
| 
						 | 
					@ -27,6 +27,7 @@
 | 
				
			||||||
    <IsWebBootstrapper>false</IsWebBootstrapper>
 | 
					    <IsWebBootstrapper>false</IsWebBootstrapper>
 | 
				
			||||||
    <UseApplicationTrust>false</UseApplicationTrust>
 | 
					    <UseApplicationTrust>false</UseApplicationTrust>
 | 
				
			||||||
    <BootstrapperEnabled>true</BootstrapperEnabled>
 | 
					    <BootstrapperEnabled>true</BootstrapperEnabled>
 | 
				
			||||||
 | 
					    <TargetFrameworkProfile />
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
 | 
					  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
 | 
				
			||||||
    <PlatformTarget>AnyCPU</PlatformTarget>
 | 
					    <PlatformTarget>AnyCPU</PlatformTarget>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public override void DrawIcon(Rect rect, Material buttonMat, GizmoRenderParms parms)
 | 
					        public override void DrawIcon(Rect rect, Material buttonMat, GizmoRenderParms parms)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Texture2D badTex = icon;
 | 
					            Texture badTex = icon;
 | 
				
			||||||
            Texture2D overay = icon_overay;
 | 
					            Texture2D overay = icon_overay;
 | 
				
			||||||
            Color color = cumcolor;
 | 
					            Color color = cumcolor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -138,12 +138,14 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static bool IsRJWPregnant(this Pawn pawn)
 | 
					        public static bool IsRJWPregnant(this Pawn pawn)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any();
 | 
					            return pawn.health.hediffSet.GetFirstHediff<Hediff_BasePregnancy>() != null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static float GetFarthestPregnancyProgress(this Pawn pawn)
 | 
					        public static float GetFarthestPregnancyProgress(this Pawn pawn)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxByWithFallback(hediff => hediff.GestationProgress)?.GestationProgress ?? 0;
 | 
					            List<Hediff_BasePregnancy> pregnancies = new List<Hediff_BasePregnancy>();
 | 
				
			||||||
 | 
					            pawn.health.hediffSet.GetHediffs(ref pregnancies);
 | 
				
			||||||
 | 
					            return pregnancies.MaxByWithFallback(hediff => hediff.GestationProgress)?.GestationProgress ?? 0;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static float GetPregnancyProgress(this HediffComp_Menstruation comp)
 | 
					        public static float GetPregnancyProgress(this HediffComp_Menstruation comp)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue