mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Properly show multiple fetuses with pregenerated babies
This commit is contained in:
		
							parent
							
								
									672e6f6ecc
								
							
						
					
					
						commit
						92ace30022
					
				
					 3 changed files with 16 additions and 7 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -115,16 +115,25 @@ namespace RJW_Menstruation
 | 
				
			||||||
            if (hediff is Hediff_MechanoidPregnancy)
 | 
					            if (hediff is Hediff_MechanoidPregnancy)
 | 
				
			||||||
                return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true);
 | 
					                return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ThingDef babydef = comp.Pawn.def;
 | 
					 | 
				
			||||||
            HediffComp_PregeneratedBabies babiescomp = hediff?.TryGetComp<HediffComp_PregeneratedBabies>();
 | 
					 | 
				
			||||||
            if (babiescomp?.HasBaby ?? false)
 | 
					 | 
				
			||||||
                babydef = babiescomp.babies.First().def;
 | 
					 | 
				
			||||||
            float gestationProgress = comp.StageProgress;
 | 
					            float gestationProgress = comp.StageProgress;
 | 
				
			||||||
            int babycount = hediff is Hediff_BasePregnancy preg ? preg.babies.Count : 1;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (hediff is Hediff_BasePregnancy h)
 | 
					            ThingDef babydef;
 | 
				
			||||||
 | 
					            int babycount;
 | 
				
			||||||
 | 
					            HediffComp_PregeneratedBabies babiescomp = hediff?.TryGetComp<HediffComp_PregeneratedBabies>();
 | 
				
			||||||
 | 
					            if (hediff is Hediff_BasePregnancy preg)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                babydef = h.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
 | 
					                babydef = preg.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
 | 
				
			||||||
 | 
					                babycount = preg.babies?.Count ?? 1;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (babiescomp?.HasBaby ?? false)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                babydef = babiescomp.babies.First().def;
 | 
				
			||||||
 | 
					                babycount = babiescomp.babies.Count;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                babydef = comp.Pawn.def;
 | 
				
			||||||
 | 
					                babycount = 1;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            string fetustex = babydef.GetModExtension<PawnDNAModExtension>()?.fetusTexPath ?? "Fetus/Fetus_Default";
 | 
					            string fetustex = babydef.GetModExtension<PawnDNAModExtension>()?.fetusTexPath ?? "Fetus/Fetus_Default";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue