mirror of
				https://gitgud.io/AbstractConcept/rimworld-animations-patch.git
				synced 2024-08-15 00:43:27 +00:00 
			
		
		
		
	v 1.2.4
This commit is contained in:
		
							parent
							
								
									d18d422a94
								
							
						
					
					
						commit
						fcf187c7dd
					
				
					 22 changed files with 184 additions and 41 deletions
				
			
		| 
						 | 
				
			
			@ -30,10 +30,10 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
            
 | 
			
		||||
            if (isPortrait)
 | 
			
		||||
            { renderFlags |= PawnRenderFlags.Portrait; }
 | 
			
		||||
            
 | 
			
		||||
            bodyPartRecord = pawn?.def?.race?.body?.AllParts?.FirstOrDefault(x => x.def.defName == bodyAddon?.bodyPart || x.customLabel == bodyAddon?.bodyPart);         
 | 
			
		||||
 | 
			
		||||
            bodyPartRecord = pawn.def?.race?.body?.AllParts?.FirstOrDefault(x => x.def.defName == bodyAddon?.bodyPart || x.customLabel == bodyAddon?.bodyPart);
 | 
			
		||||
            alignsWithHead = bodyAddon.alignWithHead || (bodyPartRecord != null && bodyPartRecord.IsInGroup(BodyPartGroupDefOf.FullHead));
 | 
			
		||||
           
 | 
			
		||||
 | 
			
		||||
            GenerateOffsets();
 | 
			
		||||
            UpdateVisibility();
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -115,7 +115,10 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
        {
 | 
			
		||||
            if (pawn == null || bodyAddon == null) return false;
 | 
			
		||||
 | 
			
		||||
            if (pawn.CurrentBed()?.def.building.bed_showSleeperBody == false && bodyAddon.drawnInBed == false)
 | 
			
		||||
            if (renderFlags.FlagSet(PawnRenderFlags.Portrait) == false && pawn.CurrentBed()?.def.building.bed_showSleeperBody == false && bodyAddon.drawnInBed == false)
 | 
			
		||||
            { return false; }
 | 
			
		||||
 | 
			
		||||
            if (renderFlags.FlagSet(PawnRenderFlags.Portrait) == false && (pawn.GetPosture() == PawnPosture.LayingOnGroundNormal || pawn.GetPosture() == PawnPosture.LayingOnGroundFaceUp) && bodyAddon.drawnOnGround == false)
 | 
			
		||||
            { return false; }
 | 
			
		||||
 | 
			
		||||
            if (bodyAddon.backstoryRequirement.NullOrEmpty() == false && pawn.story?.AllBackstories?.Any((Backstory x) => x.identifier == bodyAddon.backstoryRequirement) == false)
 | 
			
		||||
| 
						 | 
				
			
			@ -130,26 +133,25 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
            if (bodyAddon.bodyTypeRequirement.NullOrEmpty() == false && pawn.story?.bodyType.ToString() != bodyAddon.bodyTypeRequirement)
 | 
			
		||||
            { return false; }
 | 
			
		||||
 | 
			
		||||
            if ((pawn.GetPosture() == PawnPosture.LayingOnGroundNormal || pawn.GetPosture() == PawnPosture.LayingOnGroundFaceUp) && bodyAddon.drawnOnGround == false)
 | 
			
		||||
            { return false; }
 | 
			
		||||
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void UpdateVisibility()
 | 
			
		||||
        {
 | 
			
		||||
            if (pawn == null || bodyAddon == null) return;
 | 
			
		||||
 | 
			
		||||
            if (pawn == null || bodyAddon == null || bodyPartRecord == null) return;
 | 
			
		||||
  
 | 
			
		||||
            canDraw = true;
 | 
			
		||||
 | 
			
		||||
            if (pawn.health?.hediffSet?.GetNotMissingParts()?.Contains(bodyPartRecord) == false)
 | 
			
		||||
            { bodyPartMissing = true; return; }
 | 
			
		||||
 | 
			
		||||
            if (pawn?.apparel?.WornApparel == null || pawn.apparel.WornApparel.NullOrEmpty())
 | 
			
		||||
            { return; }
 | 
			
		||||
 
 | 
			
		||||
            foreach (Apparel apparel in pawn.apparel.WornApparel)
 | 
			
		||||
            {
 | 
			
		||||
                CompApparelVisibility comp = apparel?.TryGetComp<CompApparelVisibility>();
 | 
			
		||||
                if (comp == null) continue;
 | 
			
		||||
 | 
			
		||||
                LoadRimNudeData(comp);
 | 
			
		||||
 | 
			
		||||
                if (comp.isBeingWorn == false) continue;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue