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

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("SizedApparelforRJW")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SizedApparelforRJW")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("b06471b4-4c6c-478b-b94d-71cc53abd24d")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

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)

View file

@ -30,6 +30,7 @@ namespace SizedApparel
public bool isHediffDirty = true;
public bool isApparelDirty = true;
public bool isSkeletonDirty = true;
public bool isBodyAddonDirty = true; // reset all body addon graphics.
public bool hasUnsupportedApparel = true;
public bool havingSex = false;//Obsolete
public bool hasUpdateForSex = false;//Obsolete
@ -216,7 +217,7 @@ namespace SizedApparel
{
if (bodyaddon == null)
continue;
var a = new SizedApparelBodyPart(pawn, this, bodyaddon.partName, bodyaddon.bodyPartOf, bodyaddon.defaultHediffName, bodyaddon.isBreasts, false, bodyaddon.customPath, bodyaddon.colorType);
var a = new SizedApparelBodyPart(pawn, this, bodyaddon.partName, bodyaddon.bodyPartOf, bodyaddon.defaultHediffName, bodyaddon.isBreasts, false, bodyaddon.customPath, bodyaddon.colorType, bodyaddon.mustHaveBone);
a.SetDepthOffsets(bodyaddon.depthOffset.south, bodyaddon.depthOffset.north, bodyaddon.depthOffset.east, bodyaddon.depthOffset.west);
//a.SetDepthOffsets(bodyaddon.depthOffset);
a.SetCenteredTexture(bodyaddon.centeredTexture);
@ -239,7 +240,7 @@ namespace SizedApparel
{
if (bodyaddon == null)
continue;
var a = new SizedApparelBodyPart(pawn, this, bodyaddon.partName, bodyaddon.bodyPartOf, bodyaddon.defaultHediffName, bodyaddon.isBreasts, false, bodyaddon.customPath, bodyaddon.colorType);
var a = new SizedApparelBodyPart(pawn, this, bodyaddon.partName, bodyaddon.bodyPartOf, bodyaddon.defaultHediffName, bodyaddon.isBreasts, false, bodyaddon.customPath, bodyaddon.colorType, bodyaddon.mustHaveBone);
a.SetDepthOffsets(bodyaddon.depthOffset.south, bodyaddon.depthOffset.north, bodyaddon.depthOffset.east, bodyaddon.depthOffset.west);
//a.SetDepthOffsets(bodyaddon.depthOffset);
a.SetCenteredTexture(bodyaddon.centeredTexture);
@ -413,7 +414,7 @@ namespace SizedApparel
bool flag2 = true;
if (flag2 && checkApparelForCanPose)
{
if (!a.CheckCanPose("JiggleUp", true, false, false))
if (!a.CheckCanPose("JiggleUp", true, false, true, true))
return;
flag2 = false;
}
@ -747,12 +748,13 @@ namespace SizedApparel
needToCheckApparelGraphicRecords = false;
}
public void SetDirty(bool clearPawnGraphicSet = false, bool dirtyHediff = true, bool dirtyApparel = true, bool dirtySkeleton = false)
public void SetDirty(bool clearPawnGraphicSet = false, bool dirtyHediff = true, bool dirtyApparel = true, bool dirtySkeleton = false, bool dirtyBodyAddons = false)
{
this.isDirty = true;
this.isHediffDirty = dirtyHediff;
this.isApparelDirty = dirtyApparel;
this.isSkeletonDirty = dirtySkeleton;
this.isBodyAddonDirty = dirtyBodyAddons;
if (clearPawnGraphicSet)
{
if (pawn == null)
@ -936,7 +938,16 @@ namespace SizedApparel
if (isSkeletonDirty)
{
InitSkeleton();
ResetBodyAddonBoneLink();
if (isBodyAddonDirty)
InitBodyAddons();
else
ResetBodyAddonBoneLink();
}
else
{
if (isBodyAddonDirty)
InitBodyAddons();
}
}
@ -951,6 +962,12 @@ namespace SizedApparel
return;
if (pubicHairDef == null)
{
pubicHairDef = SizedApparelUtility.GetRandomPubicHair();
}
if (SizedApparelSettings.Debug)
Log.Message("[SizedApparel] Updating Component of " + pawn.Name);
if (updateGraphics)
@ -1778,6 +1795,7 @@ namespace SizedApparel
if (addon.bodyPartOf == SizedApparelBodyPartOf.Anus)
{
addon.SetHediffData(anusHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), 1000, anusVar?.variation);
addon.SetBone(skeleton?.FindBone("Anus"));
addon.UpdateGraphic();
}
}

View file

@ -55,7 +55,16 @@ namespace SizedApparel
}
[StaticConstructorOnStartup]
[HarmonyPatch(typeof(Pawn_AgeTracker), "PostResolveLifeStageChange")]
public class PawnAgeTrackerPatch
{
public static void Postfix(Pawn ___pawn)
{
var comp = ___pawn.GetComp<ApparelRecorderComp>();
comp.SetDirty(false,false,false,true,true);//Apparel and Hediff will be changed with other reason. just set skeleton dirty.
}
}
@ -670,6 +679,7 @@ namespace SizedApparel
}
}
//RimWorld 1.3
//WIPWIPWIP TODO
[HarmonyPatch(typeof(PawnRenderer), "BaseHeadOffsetAt")]
public class BaseHeadOffsetAtPatch
{
@ -680,8 +690,8 @@ namespace SizedApparel
return;
if (apparelRecorder.customPose != null)
{
var item = apparelRecorder.currentCustomPose.headOffset.FirstOrDefault(b => b.bodyType == ___pawn.story.bodyType.label);
__result += item.offsets.GetOffset(rotation);
//var item = apparelRecorder.currentCustomPose.headOffset.FirstOrDefault(b => b.bodyType == ___pawn.story.bodyType.label);
//__result += item.offsets.GetOffset(rotation);
}
}
}
@ -862,7 +872,13 @@ namespace SizedApparel
if (__result.NullOrEmpty())
return;
if (!SizedApparelUtility.CanApplySizedApparel(__instance.pawn))
return;
var comp = __instance.pawn.GetComp<ApparelRecorderComp>();
if (comp == null) // maybe it can be null? but why...? mechanoids?
return;
Material bodyMat = null;
Material sizedApparelBaseBodyMat = null;
switch (bodyCondition)

View file

@ -72,12 +72,17 @@ namespace SizedApparel
}
public class PoseDef : Def
{
}
public class SizedApparelPose
{
//public string poseName; use defName as PoseName
public SizedApparelBodyPartOf targetBodyPart = SizedApparelBodyPartOf.Torso;
public List<BodyTypeAndOffset> headOffset;
//public List<BodyTypeAndOffset> headOffset;
}

View file

@ -399,7 +399,8 @@ namespace SizedApparel
public static bool isPragnencyHediff(Hediff h)
{
return h.def.defName.ToLower().Contains("pregnancy");
//TODO. remove contain pregnancy side effect hediffs
return h.def.defName.ToLower().Contains("pregnancy") || h.def.defName.ToLower().Contains("pregnant");
}
public static bool isBellyBulgeHediff(Hediff h)

View file

@ -134,15 +134,17 @@ namespace SizedApparel
public bool isUnsupportedHumanlikePath;
public bool isCustomPose;
public string hediffName;
public string bodyType; // useful for bodypart Graphic (body addons).
public SizedApparelTexturePointDef points;
public PathAndSize(string path, int index, bool unsupportedHumanlike = false, bool customPose = false, string hediff = null , SizedApparelTexturePointDef pointsInput = null)
public PathAndSize(string path, int index, bool unsupportedHumanlike = false, bool customPose = false, string hediff = null, string bodytype = null, SizedApparelTexturePointDef pointsInput = null)
{
this.pathWithSizeIndex = path;
this.size = index;
this.isUnsupportedHumanlikePath = unsupportedHumanlike;
this.isCustomPose = customPose;
this.hediffName = hediff;
this.bodyType = bodytype;
this.points = pointsInput;
}
}
@ -292,7 +294,7 @@ namespace SizedApparel
//Try Find Different Target Size
if (flag == true)
{
result = new PathAndSize(graphic.path, indexOut, false, customPose, hediffResult);
result = new PathAndSize(graphic.path, indexOut, false, customPose, hediffResult, key.bodyTypeName);
SupportedApparelResultPath.SetOrAdd(key, result);
SupportedApparelOriginalPath.SetOrAdd(result.pathWithSizeIndex, key.pathWithoutSizeIndex);
}
@ -324,7 +326,7 @@ namespace SizedApparel
graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName+"/CustomPose/"+key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, null, key.variation, key.gender);
if (graphic != null)
{
result = new PathAndSize(graphic.path, currentSize, false, true, hediffResult);
result = new PathAndSize(graphic.path, currentSize, false, true, hediffResult, key.bodyTypeName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
//SizedApparelTexturePointDef PointsDef = DefDatabase<SizedApparelTexturePointDef>.AllDefs.FirstOrDefault((SizedApparelTexturePointDef s) => s.Path == graphic.path);
//if (SizedApparelSettings.Debug && PointsDef != null)
@ -337,7 +339,7 @@ namespace SizedApparel
graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, null, key.variation, key.gender);
if (graphic != null)
{
result = new PathAndSize(graphic.path, currentSize, false, true, hediffResult);
result = new PathAndSize(graphic.path, currentSize, false, true, hediffResult , null);
SupportedBodyPartResultPath.SetOrAdd(key, result);
//SizedApparelTexturePointDef PointsDef = DefDatabase<SizedApparelTexturePointDef>.AllDefs.FirstOrDefault((SizedApparelTexturePointDef s) => s.Path == graphic.path);
//if (SizedApparelSettings.Debug && PointsDef != null)
@ -356,7 +358,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult);
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult , key.bodyTypeName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
@ -371,7 +373,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult);
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult, null);
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
}
@ -398,7 +400,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult);
result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult, key.bodyTypeName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
}
@ -411,7 +413,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult);
result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult, null);
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
}
@ -425,7 +427,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult);
result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult, key.bodyTypeName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
}