Mirror of 1.4.17 from Lovers Lab

This commit is contained in:
ghostclinic3YTB 2023-04-03 21:47:50 -04:00
parent a5ed05c17b
commit ac3b77b5ba
210 changed files with 258 additions and 290 deletions

View file

@ -98,9 +98,13 @@ namespace SizedApparel
public string customPath = null;
public string defaultHediffName = null; // for missing Hediff
public bool isBreasts = false;
public bool centeredTexture = false;
public bool centeredTexture = true;
public bool mustMatchBodyType = false; // TODO
public string boneName = null;
public Bone bone = null; // For Graphic Positioning System
public bool mustHaveBone = true; // when bone is missing, don't draw
public SizedApparelBodyPartOf bodyPartOf = SizedApparelBodyPartOf.None;
public ColorType colorType = ColorType.Skin;
public Depth4Offsets depthOffset = new Depth4Offsets();
@ -293,7 +297,7 @@ namespace SizedApparel
public bool AutoOffsetForFurCoveredBody = true;
public SizedApparelBodyPart(Pawn pawn, ApparelRecorderComp apparelRecorderComp, string bodyPartName, SizedApparelBodyPartOf bodyPartOf, string defaultHediffName, bool isBreast, bool isOverlay, string customPathName = null, ColorType colorOf = ColorType.Skin, Bone parentBone = null, bool isCenteredTexture = false)
public SizedApparelBodyPart(Pawn pawn, ApparelRecorderComp apparelRecorderComp, string bodyPartName, SizedApparelBodyPartOf bodyPartOf, string defaultHediffName, bool isBreast, bool isOverlay, string customPathName = null, ColorType colorOf = ColorType.Skin, bool needBoneToRender = true, Bone parentBone = null, bool isCenteredTexture = false )
{
this.pawn = pawn; //owner
@ -311,6 +315,7 @@ namespace SizedApparel
this.colorType = colorOf;
this.bone = parentBone;
this.mustHaveBone = needBoneToRender;
this.centeredTexture = isCenteredTexture;
}
@ -348,6 +353,7 @@ namespace SizedApparel
public Pawn pawn;
public ApparelRecorderComp apparelRecorderCompCache; // for reduce getComp call;
public Bone bone;
private bool mustHaveBone;
public bool centeredTexture = false; // false to keep original position from mesh. and consider this graphics pivot as bone position
@ -414,7 +420,7 @@ namespace SizedApparel
}
}
public bool CheckCanPose(string targetPose, bool checkApparels, bool checkBodyParts, bool mustMatchSize)
public bool CheckCanPose(string targetPose, bool checkApparels, bool checkBodyParts, bool mustMatchSize, bool mustMatchBodytype)
{
if (checkApparels)
{
@ -423,8 +429,8 @@ namespace SizedApparel
}
if (checkBodyParts)
{
Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, targetPose);
Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, targetPose);
Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, mustMatchBodytype, targetPose);
Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, mustMatchBodytype, targetPose);
if (graphic != null || graphicH != null)
return true;
return false;
@ -467,6 +473,7 @@ namespace SizedApparel
public float depthOffsetSouth = 0.008f;
public float depthOffsetNorth = 0.008f;
//bigger = in front
public void SetDepthOffsets(float south, float north, float east, float west)
{
@ -489,13 +496,13 @@ namespace SizedApparel
positionOffsetEast = east;
positionOffsetWest = west;
}
public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, string poseOverride = null)
public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, bool mustMatchBodytype = false, string poseOverride = null)
{
SizedApparelTexturePointDef var;
return GetBodyPartGraphics(isHorny, out var, mustMatchSize, poseOverride);
return GetBodyPartGraphics(isHorny, out var, mustMatchBodytype, mustMatchSize, poseOverride);
}
public Graphic GetBodyPartGraphics(bool isHorny, out SizedApparelTexturePointDef outPoints, bool mustMatchSize = false ,string poseOverride = null, string variationOverride = null)
public Graphic GetBodyPartGraphics(bool isHorny, out SizedApparelTexturePointDef outPoints, bool mustMatchSize = false, bool mustMatchBodyType = false ,string poseOverride = null, string variationOverride = null)
{
if (pawn == null)
{
@ -525,6 +532,14 @@ namespace SizedApparel
outPoints = null;
return null;
}
if (mustMatchBodyType)
{
if(result.bodyType != pawn.story?.bodyType?.defName)
{
outPoints = null;
return null;
}
}
if (result.pathWithSizeIndex == null)
{
@ -598,6 +613,9 @@ namespace SizedApparel
if (pawn == null)
return;
if (mustHaveBone && bone == null)
return;
if (bodyMesh == null)
{
if (SizedApparelSettings.Debug)
@ -712,6 +730,11 @@ namespace SizedApparel
float drawRotation = angle;
Vector3 drawPosition = rootLoc;
if (this.pawn.ageTracker.CurLifeStage.bodyDrawOffset != null)
{
drawPosition += this.pawn.ageTracker.CurLifeStage.bodyDrawOffset.Value;
}
if (boneTransform != null)
{
//TODO fixed angle for IK?
@ -792,10 +815,7 @@ namespace SizedApparel
Quaternion quaternion = Quaternion.AngleAxis(drawRotation, Vector3.up);
if (this.pawn.ageTracker.CurLifeStage.bodyDrawOffset != null)
{
drawPosition += this.pawn.ageTracker.CurLifeStage.bodyDrawOffset.Value;
}
Rot4 targetRot = facing;
if (rotOverride != null)