Mirror of 1.4.22 from Lovers Lab

This commit is contained in:
ghostclinic3YTB 2023-04-03 21:48:55 -04:00
parent 5d0da3bc88
commit b501ddfb0f
1119 changed files with 12505 additions and 2543 deletions

View file

@ -21,6 +21,8 @@ namespace SizedApparel
public static bool OTYNudeActive = false;
public static bool LicentiaActive = false;
public static bool RimworldAnimationActive = false; //rjw animation
public static bool MenstruationActive = false; //rjw_menstruation
public static bool StatueOfColonistActive = false;
static SizedApparelPatch()
{
@ -105,6 +107,18 @@ namespace SizedApparel
RimworldAnimationActive = true;
}
//check rjw_menstruation
if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "rjw.menstruation".ToLower()))
{
MenstruationActive = true;
}
//check statue of Colonist
if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "tammybee.statueofcolonist".ToLower()))
{
StatueOfColonistActive = true;
}
Log.Message("[SizedApparel] start");
var harmony = new Harmony("SizedApparelforRJW");

View file

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using RJW_Menstruation;
namespace SizedApparel
{
public class Patch_Menstruation
{
public static Color? GetNippleColor(Hediff breastHediff)
{
var breastcomp = breastHediff.TryGetComp<HediffComp_Breast>();
if (breastcomp == null)
return null;
return breastcomp.NippleColor;
}
public static float? GetNippleSize(Hediff breastHediff)
{
var breastcomp = breastHediff.TryGetComp<HediffComp_Breast>();
if (breastcomp == null)
return null;
return breastcomp.NippleSize;
}
public static float? GetAreolaSize(Hediff breastHediff)
{
var breastcomp = breastHediff.TryGetComp<HediffComp_Breast>();
if (breastcomp == null)
return null;
return breastcomp.AreolaSize;
}
}
}

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SizedApparel
{
public class Patch_StatueOfColonist
{
}
}

View file

@ -137,7 +137,7 @@ namespace SizedApparel
public enum ColorType
{
Skin, Hair, Custom, None
Skin, Hair, Nipple, Custom, None
}
@ -294,6 +294,15 @@ namespace SizedApparel
public class SizedApparelBodyPart
{
static MethodInfo overrideMatMethod = AccessTools.Method(typeof(PawnRenderer), "OverrideMaterialIfNeeded");
static Color defaultNippleColor = Color.white;//nipple texture is already colored with pink. so make it white as default to avoid double coloring pink //Strong Pink Color = new ColorInt(255, 121, 121).ToColor
//this is for RGB Channel Edit
static string texturePath_White = "SizedApparel/Masks/White";
static string texturePath_Black = "SizedApparel/Masks/Black";
static string texturePath_Red = "SizedApparel/Masks/Red";
static string texturePath_Green = "SizedApparel/Masks/Green";
static string texturePath_Blue = "SizedApparel/Masks/Blue";
public bool AutoOffsetForFurCoveredBody = true;
@ -420,7 +429,7 @@ namespace SizedApparel
}
}
public bool CheckCanPose(string targetPose, bool checkApparels, bool checkBodyParts, bool mustMatchSize, bool mustMatchBodytype)
public bool CheckCanPose(string targetPose, bool checkApparels, bool checkBodyParts, bool mustMatchSize, bool mustMatchBodytype, bool mustMatchRace)
{
if (checkApparels)
{
@ -429,8 +438,8 @@ namespace SizedApparel
}
if (checkBodyParts)
{
Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, mustMatchBodytype, targetPose);
Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, mustMatchBodytype, targetPose);
Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, mustMatchBodytype, mustMatchRace);
Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, mustMatchBodytype, mustMatchRace);
if (graphic != null || graphicH != null)
return true;
return false;
@ -496,13 +505,13 @@ namespace SizedApparel
positionOffsetEast = east;
positionOffsetWest = west;
}
public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, bool mustMatchBodytype = false, string poseOverride = null)
public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, bool mustMatchBodytype = false, bool mustMatchRace = false, string poseOverride = null)
{
SizedApparelTexturePointDef var;
return GetBodyPartGraphics(isHorny, out var, mustMatchBodytype, mustMatchSize, poseOverride);
return GetBodyPartGraphics(isHorny, out var, mustMatchBodytype, mustMatchSize, mustMatchRace, poseOverride);
}
public Graphic GetBodyPartGraphics(bool isHorny, out SizedApparelTexturePointDef outPoints, bool mustMatchSize = false, bool mustMatchBodyType = false ,string poseOverride = null, string variationOverride = null)
public Graphic GetBodyPartGraphics(bool isHorny, out SizedApparelTexturePointDef outPoints, bool mustMatchSize = false, bool mustMatchBodyType = false , bool mustMatchRace = false ,string poseOverride = null, string variationOverride = null)
{
if (pawn == null)
{
@ -540,6 +549,14 @@ namespace SizedApparel
return null;
}
}
if (mustMatchRace)
{
if (result.raceName != pawn.def.defName)
{
outPoints = null;
return null;
}
}
if (result.pathWithSizeIndex == null)
{
@ -625,7 +642,7 @@ namespace SizedApparel
PawnRenderer pawnRenderer = pawn.Drawer.renderer;
Shader shader = ShaderDatabase.CutoutComplex;
Shader shader = shader = ShaderDatabase.CutoutSkinOverlay;
Color drawColor1 = Color.white;
Color drawColor2 = Color.white;
@ -648,7 +665,7 @@ namespace SizedApparel
{
shader = pawn.Drawer.renderer.graphics.furCoveredGraphic.Shader;
if (!ShaderUtility.SupportsMaskTex(shader))
shader = ShaderDatabase.CutoutSkinOverlay;
shader = shader = ShaderDatabase.CutoutSkinOverlay;
shader = pawnRenderer.graphics.furCoveredGraphic.Shader;
drawColor1 = pawnRenderer.graphics.furCoveredGraphic.Color;
drawColor2 = pawnRenderer.graphics.furCoveredGraphic.ColorTwo;
@ -657,7 +674,7 @@ namespace SizedApparel
{
shader = pawn.Drawer.renderer.graphics.nakedGraphic.Shader;
if (!ShaderUtility.SupportsMaskTex(shader))
shader = ShaderDatabase.CutoutSkinOverlay;
shader = shader = ShaderDatabase.CutoutSkinOverlay;
drawColor1 = pawnRenderer.graphics.nakedGraphic.Color;
drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
}
@ -668,10 +685,63 @@ namespace SizedApparel
shader = pawn.Drawer.renderer.graphics.rottingGraphic.Shader;
if (!ShaderUtility.SupportsMaskTex(shader))
shader = ShaderDatabase.CutoutSkinOverlay;
shader = shader = ShaderDatabase.CutoutSkinOverlay;
drawColor1 = pawnRenderer.graphics.rottingGraphic.Color;
drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
}
}
else if (colorType == ColorType.Nipple)
{
forceWriteZ = true;
//Get SkinColor first.
if (bodyDrawType == RotDrawMode.Fresh)
{
if (HasFurSkin)
{
shader = pawn.Drawer.renderer.graphics.furCoveredGraphic.Shader;
if (!ShaderUtility.SupportsMaskTex(shader))
shader = ShaderDatabase.CutoutSkinOverlay;
shader = pawnRenderer.graphics.furCoveredGraphic.Shader;
drawColor1 = pawnRenderer.graphics.furCoveredGraphic.Color;
drawColor2 = pawnRenderer.graphics.furCoveredGraphic.ColorTwo;
}
else
{
shader = pawn.Drawer.renderer.graphics.nakedGraphic.Shader;
if (!ShaderUtility.SupportsMaskTex(shader))
shader = shader = ShaderDatabase.CutoutSkinOverlay;
drawColor1 = pawnRenderer.graphics.nakedGraphic.Color;
drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
}
}
else if (bodyDrawType == RotDrawMode.Rotting)
{
shader = pawn.Drawer.renderer.graphics.rottingGraphic.Shader;
if (!ShaderUtility.SupportsMaskTex(shader))
shader = shader = ShaderDatabase.CutoutSkinOverlay;
drawColor1 = pawnRenderer.graphics.rottingGraphic.Color;
drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
}
if(apparelRecorderCompCache != null)
{
if(apparelRecorderCompCache.nippleColor != null)
{
drawColor1 = apparelRecorderCompCache.nippleColor.Value; //* drawColor1;
drawColor2 = apparelRecorderCompCache.nippleColor.Value; //* drawColor2; //maybe can be issue
}
else
{
//nipple Color is null
//Ust Default Color for Nipple with SkinColor
drawColor1 = defaultNippleColor * drawColor1;
drawColor2 = defaultNippleColor * drawColor2;
}
}
}
@ -696,7 +766,15 @@ namespace SizedApparel
forceWriteZ = false;
shader = ShaderDatabase.Cutout;
}
if (isOverlay)
{
if (shader == ShaderDatabase.Cutout)
shader = ShaderDatabase.Transparent;
else if (shader == ShaderDatabase.CutoutSkin || shader == ShaderDatabase.CutoutSkinColorOverride)
shader = ShaderDatabase.CutoutSkinOverlay;
else
shader = ShaderDatabase.Transparent;
}
Mesh scaledBodyMesh;
@ -739,13 +817,13 @@ namespace SizedApparel
{
//TODO fixed angle for IK?
float width = (bodyMesh.vertices[2].x - bodyMesh.vertices[0].x);
if (centeredTexture)
{
bool westUsingEast = false;
if (facing == Rot4.West && bone.west == null)
westUsingEast = true;
float width = (bodyMesh.vertices[2].x - bodyMesh.vertices[0].x);
drawRotation = boneTransform.InitialAngle + boneTransform.angleOffset;
//not sure it work correct
Vector3 v = (boneTransform.InitialPosition + boneTransform.positionOffset) * width;
@ -765,20 +843,24 @@ namespace SizedApparel
drawRotation += angle ;
}
else
{
{
//NotCentered Texture not yet support Rotation System.
//wip
Vector3 v = Vector3.zero;
bool westUsingEast = false;
if (facing == Rot4.West && bone.west == null)
westUsingEast = true;
float width = (bodyMesh.vertices[2].x - bodyMesh.vertices[0].x);
drawRotation = boneTransform.InitialAngle + boneTransform.angleOffset;
drawRotation = boneTransform.InitialAngle; // + boneTransform.angleOffset
//not sure it work correct
Vector3 v = (-boneTransform.InitialPosition); //initialpos as custom pivot
var q = Quaternion.AngleAxis(westUsingEast ? -drawRotation : drawRotation, Vector3.up);
var q2 = Quaternion.AngleAxis(westUsingEast ? -angle : angle, Vector3.up);
v = q * v; // calculate final draw position with torso angle
v = v + boneTransform.InitialPosition + boneTransform.positionOffset;
v = q2 * v;
//Vector3 v = (boneTransform.InitialPosition); //initialpos as custom pivot
//var q = Quaternion.AngleAxis(westUsingEast ? -drawRotation : drawRotation, Vector3.up);
//var q2 = Quaternion.AngleAxis(westUsingEast ? -angle : angle, Vector3.up);
//v = q * v; // calculate final draw position with torso angle
//v = v + boneTransform.InitialPosition + boneTransform.positionOffset;
//v = q2 * v; //NotCentered Texture not yet support Rotation System.
drawPosition = (v) * width;
if (westUsingEast)
{
@ -877,19 +959,30 @@ namespace SizedApparel
Material mat;
if (!flags.FlagSet(PawnRenderFlags.Cache)&&!isOverlay&& forceWriteZ)
//If ForceWriteDepth, draw Cutout mesh for write depth. this is for avoid problem of body addons drawing under other meshes. such as breasts front of body but behind tail.
if (forceWriteZ || (!flags.FlagSet(PawnRenderFlags.Cache) && !isOverlay))// //(!flags.FlagSet(PawnRenderFlags.Cache) && !isOverlay)
{
graphic = graphic.GetColoredVersion(ShaderDatabase.Cutout, drawColor1, drawColor2); // ShaderDatabase.Cutout
mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { graphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
GenDraw.DrawMeshNowOrLater(scaledBodyMesh, drawPosition, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
Graphic Zgraphic = graphic.GetColoredVersion(ShaderDatabase.CutoutComplex, drawColor1, drawColor2); // ShaderDatabase.Cutout
Vector3 drawPositionZ = drawPosition;
drawPositionZ.y = 0; //Send Back of body, but it can still write depth.
mat = flags.FlagSet(PawnRenderFlags.Cache) ? Zgraphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { Zgraphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
GenDraw.DrawMeshNowOrLater(scaledBodyMesh, drawPositionZ, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
}
//shader must be mask
graphic = graphic.GetColoredVersion(shader, drawColor1, drawColor2);
drawPosition.y += 0.00001f;
if (graphic.maskPath == null)
{
//Test
//graphic.maskPath = texturePath_Red;
}
//drawPosition.y += 0.00001f;
mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { graphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
GenDraw.DrawMeshNowOrLater(scaledBodyMesh, drawPosition, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
}
}

View file

@ -47,6 +47,8 @@ namespace SizedApparel
public Hediff anusHediff = null;
public Hediff udderHediff = null;//RJW 4.6.8: Udder is not partof chest's breast. it attached to torso.
public Color? nippleColor; //for menstruation cycles Mod
//TODO Optimize Update Hediff Filter
private bool hasBreastsAddon = false;
private bool hasVaginaAddon = false;
@ -414,7 +416,7 @@ namespace SizedApparel
bool flag2 = true;
if (flag2 && checkApparelForCanPose)
{
if (!a.CheckCanPose("JiggleUp", true, false, true, true))
if (!a.CheckCanPose("JiggleUp", true, false, true, true, false))
return;
flag2 = false;
}
@ -1023,7 +1025,11 @@ namespace SizedApparel
{
foreach (Hediff h in pregnancies)
{
bellySeverity = Math.Max(bellySeverity, h.Severity);
//Set Labor Belly as Big Belly.
if (h.def == HediffDefOf.PregnancyLabor || h.def == HediffDefOf.PregnancyLaborPushing)
bellySeverity = Math.Max(bellySeverity, 1f);
else
bellySeverity = Math.Max(bellySeverity, h.Severity);
}
}
@ -1053,6 +1059,15 @@ namespace SizedApparel
if (breastHediff != null)
{
//get nipple color from Menstruation.
if (SizedApparelPatch.MenstruationActive)
{
nippleColor = Patch_Menstruation.GetNippleColor(breastHediff);
}
if (pawn.gender == Gender.Male && !SizedApparelSettings.ApplyApparelPatchForMale)
{
CheckApparel = false;

View file

@ -461,6 +461,8 @@ namespace SizedApparel
}
//Apparel Graphic Texture injection
[StaticConstructorOnStartup]
[HarmonyPatch(typeof(ApparelGraphicRecordGetter), "TryGetGraphicApparel")]
[HarmonyBefore(new string[]{"QualityOfBuilding"})]
@ -477,7 +479,6 @@ namespace SizedApparel
if (bodyType == null)
return;
if (apparel.Wearer != null)
{
//rec = new ApparelGraphicRecord(null, null);
@ -540,7 +541,7 @@ namespace SizedApparel
{
Graphic sizedGraphic = null;
//Log.Message("4");
string resultPath = SizedApparelsDatabase.GetSupportedApparelSizedPath(new SizedApparelsDatabase.SizedApparelDatabaseKey(rec.graphic.path, apparel?.Wearer?.def.defName, breastHediff.def.defName, apparel.Wearer.gender, apparel?.Wearer?.story?.bodyType?.defName, SizedApparelUtility.BreastSeverityInt(BreastSeverity))).pathWithSizeIndex;
string resultPath = SizedApparelsDatabase.GetSupportedApparelSizedPath(new SizedApparelsDatabase.SizedApparelDatabaseKey(rec.graphic.path, apparel?.Wearer?.def.defName, breastHediff?.def?.defName, apparel.Wearer.gender, apparel?.Wearer?.story?.bodyType?.defName, SizedApparelUtility.BreastSeverityInt(BreastSeverity))).pathWithSizeIndex;
if(resultPath != null)
{
//sizedGraphic = SizedApparelUtility.GetSizedApparelGraphic(rec.graphic, BreastSeverity, apparel?.Wearer?.def.defName, breastHediff.def.defName);
@ -582,7 +583,7 @@ namespace SizedApparel
return;
//comp.ClearAll(false);
//comp.needToCheckApparelGraphicRecords = true;
comp.SetDirty();
comp.SetDirty(false,true,false,false,false); // Check Hediff. If you don't the crotch will not have graphic on first load
}
}
@ -881,6 +882,13 @@ namespace SizedApparel
var comp = __instance.pawn.GetComp<ApparelRecorderComp>();
if (comp == null) // maybe it can be null? but why...? mechanoids?
return;
if (drawClothes)
{
if (comp.hasUnsupportedApparel)
return;
}
Material bodyMat = null;
Material sizedApparelBaseBodyMat = null;
switch (bodyCondition)

View file

@ -16,7 +16,7 @@ namespace SizedApparel
{
public string raceName = null;
public bool overrideDef = false;
public bool asHuman = true;
public bool asHuman = false;
public float drawMinAge = -1; //pawn's Biological age. -1 to ignore.
public AlienRaceSetting(string raceName)
@ -32,7 +32,7 @@ namespace SizedApparel
{
Scribe_Values.Look(ref raceName, "raceName", null);
Scribe_Values.Look(ref overrideDef, "overrideDef", false);
Scribe_Values.Look(ref asHuman, "asHuman", true);
Scribe_Values.Look(ref asHuman, "asHuman", false);
Scribe_Values.Look(ref drawMinAge, "drawMinAge", -1);
}
@ -218,6 +218,32 @@ namespace SizedApparel
{
alienRaceSettings = new List<AlienRaceSetting>();
}
SizedApparelMod.CheckAndLoadAlienRaces();
//Initialize Setting for missing Race
foreach (var raceName in SizedApparelMod.alienDefList)
{
AlienRaceSetting raceSetting = null;
foreach (var r in SizedApparelSettings.alienRaceSettings)
{
if (r.raceName == null)
continue;
if (raceName == r.raceName)
{
raceSetting = r;
break;
}
}
if (raceSetting == null)
{
raceSetting = new AlienRaceSetting(raceName);
SizedApparelSettings.alienRaceSettings.Add(raceSetting);
}
}
}
if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs)
{
@ -284,8 +310,9 @@ namespace SizedApparel
{
SizedApparelSettings settings;
private static Vector2 ScrollPos = Vector2.zero;
private static List<string> alienDefList = new List<string>(); // to load aliens and compare with modsetting
private static Vector2 ScrollPosL = Vector2.zero;
private static Vector2 ScrollPosR = Vector2.zero;
public static List<string> alienDefList = new List<string>(); // to load aliens and compare with modsetting
public override void WriteSettings()
{
@ -298,7 +325,7 @@ namespace SizedApparel
{
if(alienDefList == null)
alienDefList = new List<string>();
if (alienDefList.Count == 0)
if (true)//alienDefList.Count == 0
{
IEnumerable<ThingDef> HumanlikeRaces;
HumanlikeRaces = DefDatabase<ThingDef>.AllDefs.Where(b => b.race?.Humanlike == true);
@ -345,7 +372,7 @@ namespace SizedApparel
const float alienRaceSettingHeight = 120;
CheckAndLoadAlienRaces();
//CheckAndLoadAlienRaces();
Listing_Standard listingStandard = new Listing_Standard();
//Rect rect = new Rect(0f, 0f, inRect.width, 950);
//Rect rect = inRect.ExpandedBy(0.9f);
@ -355,8 +382,8 @@ namespace SizedApparel
//leftRect = leftRect.ContractedBy(10f);
rightRect = rightRect.ContractedBy(10f);
Rect scrollRect = new Rect(0, 0, leftRect.width - 30f, Math.Max(leftRect.height + (float)alienDefList.Count* alienRaceSettingHeight, 1f));
Widgets.BeginScrollView(leftRect, ref ScrollPos, scrollRect, true);
leftRect = new Rect(leftRect.x, leftRect.x, leftRect.width - 30f, leftRect.height + Math.Max((float)alienDefList.Count * alienRaceSettingHeight, 1f) + 250f);
Widgets.BeginScrollView(leftRect, ref ScrollPosL, scrollRect, true);
leftRect = new Rect(leftRect.x, leftRect.y, leftRect.width - 30f, leftRect.height + Math.Max((float)alienDefList.Count * alienRaceSettingHeight, 1f) + 250f);
listingStandard.Begin(leftRect);
listingStandard.maxOneColumn = true;
@ -451,7 +478,19 @@ namespace SizedApparel
}
else
{
//RimJobWorld is Actived
listingStandard.Label(" RimJobWorld is Actived ", -1, "");
if (SizedApparelPatch.MenstruationActive)
{
listingStandard.Label(" RJW Menstuation is Active ", -1, "");
}
else
{
listingStandard.Label(" RJW Menstuation is Not Active", -1, "");
}
}
listingStandard.GapLine(1);
listingStandard.Gap(12);
@ -494,6 +533,9 @@ namespace SizedApparel
listingStandard.Label(" AlienRace is not Actived ", -1, "");
}
if (alienDefList.NullOrEmpty())
CheckAndLoadAlienRaces();
float h = alienDefList.Count * alienRaceSettingHeight;
Listing_Standard Race_ListingStandard = listingStandard.BeginSection(h);
foreach (var raceName in alienDefList)
@ -516,8 +558,9 @@ namespace SizedApparel
raceSetting = new AlienRaceSetting(raceName);
SizedApparelSettings.alienRaceSettings.Add(raceSetting);
}
Race_ListingStandard.CheckboxLabeled("If Unsupported, As Human race", ref raceSetting.asHuman, "This Race will use Human race if it doesn't have own textures. useful for race that Unsupported but simillar to human");
}
if(raceName != "Human")
Race_ListingStandard.CheckboxLabeled("If Unsupported, As Human race", ref raceSetting.asHuman, "This Race will use Human race if it doesn't have own textures. useful for race that Unsupported but simillar to human");
Race_ListingStandard.Label((raceSetting.drawMinAge <= 100 ? "" : "[overdrive]") + "SA BodyPart Draw Min Age: " + raceSetting.drawMinAge.ToString(), -1, "Lower than this age will not use Sized Apparel. Useful for BnC. -1 for disable");
raceSetting.drawMinAge = Mathf.Round(Race_ListingStandard.Slider(raceSetting.drawMinAge, raceSetting.drawMinAge <= 100 ? -1: 100, raceSetting.drawMinAge >= 100 ? 1000 : 100));
Race_ListingStandard.Gap();
@ -529,6 +572,7 @@ namespace SizedApparel
listingStandard.Gap(8);
listingStandard.GapLine(4f);
listingStandard.Gap(8);
listingStandard.Gap(8);
listingStandard.Label("RimNudeWorld Compatibility (WIP)", -1, "");
@ -596,6 +640,15 @@ namespace SizedApparel
listingStandard.End();
////RightRect
scrollRect = new Rect(0, 0, rightRect.width - 30f, Math.Max(rightRect.height + 100f, 1f));
Widgets.BeginScrollView(rightRect, ref ScrollPosR, scrollRect, true);
rightRect = new Rect(0, 0, rightRect.width - 30f, rightRect.height + 100f + 250f);
listingStandard.maxOneColumn = true;
listingStandard.Begin(rightRect);
listingStandard.Label("SizedApparel System Apply (apparel and body parts)");
@ -673,6 +726,7 @@ namespace SizedApparel
listingStandard.CheckboxLabeled(" use Colossal", ref SizedApparelSettings.useColossal, "use Colossal breasts Sized Apparel.\nDefault: true");
listingStandard.CheckboxLabeled(" use Titanic", ref SizedApparelSettings.useTitanic, "use Titanic breasts Sized Apparel.\nDefault: true");
*/
Widgets.EndScrollView();
listingStandard.End();
//listingStandard.EndScrollView(ref rect);

View file

@ -403,6 +403,10 @@ namespace SizedApparel
if (h.def == HediffDefOf.PregnantHuman || h.def == HediffDefOf.Pregnant)
return true;
//pawn who Giving birth. the pregnant hediff will be removed when the pawn is in labor
if (h.def == HediffDefOf.PregnancyLabor || h.def == HediffDefOf.PregnancyLaborPushing)
return true;
return h.def.defName.ToLower().Contains("rjw_pregnancy") || h.def.defName.ToLower().EndsWith("pregnant"); // h.def.defName.ToLower().Contains("pregnancy");
}
public static bool isRJWEggHediff(Hediff h)

View file

@ -45,7 +45,7 @@
<Private>False</Private>
</Reference>
<Reference Include="HugsLib">
<HintPath>..\..\..\..\..\..\workshop\content\294100\818773962\v1.1\Assemblies\HugsLib.dll</HintPath>
<HintPath>..\..\..\..\..\..\workshop\content\294100\818773962\v1.4\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RimNudeWorld">
@ -62,6 +62,10 @@
<HintPath>..\..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW_Menstruation">
<HintPath>..\..\..\rjw_menstruation\1.4\Assemblies\RJW_Menstruation.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -90,6 +94,8 @@
<Compile Include="Graphic_BodyParts.cs" />
<Compile Include="Graphic_SizedApparel.cs" />
<Compile Include="Patch-Animation.cs" />
<Compile Include="Patch-Menstruation.cs" />
<Compile Include="Patch-StatueOfColonist.cs" />
<Compile Include="SizedAppareIdeoPatch.cs" />
<Compile Include="SizedApparelApparelBuilder.cs" />
<Compile Include="SizedApparelBodyPart.cs" />

View file

@ -135,9 +135,10 @@ namespace SizedApparel
public bool isCustomPose;
public string hediffName;
public string bodyType; // useful for bodypart Graphic (body addons).
public string raceName; // for check is Human or Alien or Alien as Human.
public SizedApparelTexturePointDef points;
public PathAndSize(string path, int index, bool unsupportedHumanlike = false, bool customPose = false, string hediff = null, string bodytype = null, SizedApparelTexturePointDef pointsInput = null)
public PathAndSize(string path, int index, bool unsupportedHumanlike = false, bool customPose = false, string hediff = null, string bodytype = null, string raceName = null, SizedApparelTexturePointDef pointsInput = null)
{
this.pathWithSizeIndex = path;
this.size = index;
@ -146,6 +147,7 @@ namespace SizedApparel
this.hediffName = hediff;
this.bodyType = bodytype;
this.points = pointsInput;
this.raceName = raceName;
}
}
private static Dictionary<Pawn, ApparelRecorderComp> ApparelRecordersCache = new Dictionary<Pawn, ApparelRecorderComp>();
@ -294,7 +296,7 @@ namespace SizedApparel
//Try Find Different Target Size
if (flag == true)
{
result = new PathAndSize(graphic.path, indexOut, false, customPose, hediffResult, key.bodyTypeName);
result = new PathAndSize(graphic.path, indexOut, false, customPose, hediffResult, key.bodyTypeName, key.raceName);
SupportedApparelResultPath.SetOrAdd(key, result);
SupportedApparelOriginalPath.SetOrAdd(result.pathWithSizeIndex, key.pathWithoutSizeIndex);
}
@ -326,7 +328,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, key.bodyTypeName);
result = new PathAndSize(graphic.path, currentSize, false, true, hediffResult, key.bodyTypeName, key.raceName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
//SizedApparelTexturePointDef PointsDef = DefDatabase<SizedApparelTexturePointDef>.AllDefs.FirstOrDefault((SizedApparelTexturePointDef s) => s.Path == graphic.path);
//if (SizedApparelSettings.Debug && PointsDef != null)
@ -339,7 +341,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 , null);
result = new PathAndSize(graphic.path, currentSize, false, true, hediffResult , null, key.raceName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
//SizedApparelTexturePointDef PointsDef = DefDatabase<SizedApparelTexturePointDef>.AllDefs.FirstOrDefault((SizedApparelTexturePointDef s) => s.Path == graphic.path);
//if (SizedApparelSettings.Debug && PointsDef != null)
@ -358,7 +360,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult , key.bodyTypeName);
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult , key.bodyTypeName, key.raceName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
@ -373,7 +375,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult, null);
result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult, null, key.raceName);
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
}
@ -381,7 +383,8 @@ namespace SizedApparel
//SizedApparelMod.CheckAndLoadAlienRaces();
//HumanLike Search
var raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == key.raceName);
AlienRaceSetting raceSetting;
raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == key.raceName);
if (raceSetting !=null && key.raceName == "Human" || !raceSetting.asHuman) //old: !SizedApparelSettings.UnsupportedRaceToUseHumanlike
{
//Cannot find Any result
@ -427,7 +430,7 @@ namespace SizedApparel
//{
// Log.Message("[SizedApparel] : Points Def Found : " + PointsDef.defName);
//}
result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult, key.bodyTypeName);
result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult, key.bodyTypeName, "Human");
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
}
@ -441,7 +444,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, null, "Human");
SupportedBodyPartResultPath.SetOrAdd(key, result);
return result;
}