diff --git a/1.3/Assemblies/SizedApparelforRJW.dll b/1.3/Assemblies/SizedApparelforRJW.dll index 1a56d6d..eb895d7 100644 Binary files a/1.3/Assemblies/SizedApparelforRJW.dll and b/1.3/Assemblies/SizedApparelforRJW.dll differ diff --git a/Defs/BodyPartDetailDefs/BodypartDetail_Anus.xml b/1.3/Defs/BodyPartDetailDefs/BodypartDetail_Anus.xml similarity index 100% rename from Defs/BodyPartDetailDefs/BodypartDetail_Anus.xml rename to 1.3/Defs/BodyPartDetailDefs/BodypartDetail_Anus.xml diff --git a/Defs/BodyPartDetailDefs/BodypartDetail_Breasts.xml b/1.3/Defs/BodyPartDetailDefs/BodypartDetail_Breasts.xml similarity index 100% rename from Defs/BodyPartDetailDefs/BodypartDetail_Breasts.xml rename to 1.3/Defs/BodyPartDetailDefs/BodypartDetail_Breasts.xml diff --git a/Defs/BodyPartDetailDefs/BodypartDetail_Penis.xml b/1.3/Defs/BodyPartDetailDefs/BodypartDetail_Penis.xml similarity index 100% rename from Defs/BodyPartDetailDefs/BodypartDetail_Penis.xml rename to 1.3/Defs/BodyPartDetailDefs/BodypartDetail_Penis.xml diff --git a/Defs/BodyPartDetailDefs/BodypartDetail_Vagina.xml b/1.3/Defs/BodyPartDetailDefs/BodypartDetail_Vagina.xml similarity index 100% rename from Defs/BodyPartDetailDefs/BodypartDetail_Vagina.xml rename to 1.3/Defs/BodyPartDetailDefs/BodypartDetail_Vagina.xml diff --git a/Patches/ApparelPatches/Tip_TagList.txt b/1.3/Patches/ApparelPatches/Tip_TagList.txt similarity index 100% rename from Patches/ApparelPatches/Tip_TagList.txt rename to 1.3/Patches/ApparelPatches/Tip_TagList.txt diff --git a/Patches/ApparelPatches/VanillaCorePatch/DusterShowCrotchPatch.xml b/1.3/Patches/ApparelPatches/VanillaCorePatch/DusterShowCrotchPatch.xml similarity index 100% rename from Patches/ApparelPatches/VanillaCorePatch/DusterShowCrotchPatch.xml rename to 1.3/Patches/ApparelPatches/VanillaCorePatch/DusterShowCrotchPatch.xml diff --git a/Patches/ApparelPatches/VanillaCorePatch/ShirtBasicShowCrotchPatch.xml b/1.3/Patches/ApparelPatches/VanillaCorePatch/ShirtBasicShowCrotchPatch.xml similarity index 100% rename from Patches/ApparelPatches/VanillaCorePatch/ShirtBasicShowCrotchPatch.xml rename to 1.3/Patches/ApparelPatches/VanillaCorePatch/ShirtBasicShowCrotchPatch.xml diff --git a/Patches/ApparelPatches/VanillaIdeoPatch/IdeoApparelPatch.xml b/1.3/Patches/ApparelPatches/VanillaIdeoPatch/IdeoApparelPatch.xml similarity index 100% rename from Patches/ApparelPatches/VanillaIdeoPatch/IdeoApparelPatch.xml rename to 1.3/Patches/ApparelPatches/VanillaIdeoPatch/IdeoApparelPatch.xml diff --git a/Patches/ApparelRecorderCompPatch.xml b/1.3/Patches/ApparelRecorderCompPatch.xml similarity index 100% rename from Patches/ApparelRecorderCompPatch.xml rename to 1.3/Patches/ApparelRecorderCompPatch.xml diff --git a/Patches/HediffPatches/PrivateHediffPartsPatches.xml b/1.3/Patches/HediffPatches/PrivateHediffPartsPatches.xml similarity index 100% rename from Patches/HediffPatches/PrivateHediffPartsPatches.xml rename to 1.3/Patches/HediffPatches/PrivateHediffPartsPatches.xml diff --git a/Patches/ThingPatches/BodyPartThingPatch.xml b/1.3/Patches/ThingPatches/BodyPartThingPatch.xml similarity index 100% rename from Patches/ThingPatches/BodyPartThingPatch.xml rename to 1.3/Patches/ThingPatches/BodyPartThingPatch.xml diff --git a/1.3/source/SizedApparel/AlienRaceSupport.cs b/1.3/source/SizedApparel/AlienRaceSupport.cs new file mode 100644 index 0000000..ebfcdd3 --- /dev/null +++ b/1.3/source/SizedApparel/AlienRaceSupport.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; + +namespace SizedApparel +{ + class AlienRaceSupport + { + } + + public class SizedApparelPawnDef : Def + { + public bool allowForceHumanlike = false; + + } +} diff --git a/1.3/source/SizedApparel/Graphic_BodyParts.cs b/1.3/source/SizedApparel/Graphic_BodyParts.cs new file mode 100644 index 0000000..50be733 --- /dev/null +++ b/1.3/source/SizedApparel/Graphic_BodyParts.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SizedApparel +{ + public class Graphic_BodyParts : Verse.Graphic_Multi + { + public float serverity; + public string bodyPart; // such as breasts, penis + } +} diff --git a/1.3/source/SizedApparel/Graphic_SizedApparel.cs b/1.3/source/SizedApparel/Graphic_SizedApparel.cs new file mode 100644 index 0000000..a0a879c --- /dev/null +++ b/1.3/source/SizedApparel/Graphic_SizedApparel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SizedApparel +{ + public class Graphic_SizedApparel : Verse.Graphic_Multi + { + + } +} diff --git a/1.3/source/SizedApparel/HarmonyPatches.cs b/1.3/source/SizedApparel/HarmonyPatches.cs new file mode 100644 index 0000000..b723dd3 --- /dev/null +++ b/1.3/source/SizedApparel/HarmonyPatches.cs @@ -0,0 +1,263 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using HarmonyLib; +//using AlienRace; +using UnityEngine; +using rjw; +using RevealingApparel; +using System.Reflection; + +namespace SizedApparel +{ + [StaticConstructorOnStartup] + public class SizedApparelPatch + { + + public static bool alienRaceActive = false; + public static bool SJWActive = false; + public static bool RJWActive = false; + public static bool DubsApparelTweaksActive = false; + public static bool rimNudeWorldActive = false; + public static bool OTYNudeActive = false; + public static bool LicentiaActive = false; + + static SizedApparelPatch() + { + + //check SJW + if (LoadedModManager.RunningModsListForReading.Any(x => x.Name == "SafeJobWorld")) + { + SJWActive = true; + } + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId == "safe.job.world")) + { + SJWActive = true; + } + //check RJW + if (LoadedModManager.RunningModsListForReading.Any(x => x.Name == "RimJobWorld")) + { + RJWActive = true; + } + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId == "rim.job.world")) + { + RJWActive = true; + } + //check Dubs Apparel Tweaks + if (LoadedModManager.RunningModsListForReading.Any(x => x.Name == "Dubs Apparel Tweaks")) + { + DubsApparelTweaksActive = true; + } + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId == "Dubwise.DubsApparelTweaks")) + { + DubsApparelTweaksActive = true; + } + + //check Alien Race + if (LoadedModManager.RunningModsListForReading.Any(x => x.Name == "Humanoid Alien Races 2.0")) + { + alienRaceActive = true; + } + if (LoadedModManager.RunningModsListForReading.Any(x => x.Name.Contains("Humanoid Alien Races"))) + { + alienRaceActive = true; + } + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId == "erdelf.HumanoidAlienRaces")) + { + alienRaceActive = true; + } + //check RimNudeWorld + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId == "shauaputa.rimnudeworld")) + { + rimNudeWorldActive = true; + } + //check OTYNude + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.Contains("OTY")&& x.PackageId.Contains("Nude"))) + { + OTYNudeActive = true; + } + + //check Licentia Lab + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "LustLicentia.RJWLabs".ToLower())) + { + LicentiaActive = true; + } + + + Log.Message("[SizedApparel] start"); + var harmony = new Harmony("SizedApparelforRJW"); + + harmony.PatchAll(); + /* + try + { + ((Action)(() => { + if (LoadedModManager.RunningModsListForReading.Any(x => x.Name == "OTY_NUDE")) + { + Log.Message("Sized Apparel for RJW : OTY_NUDE founded"); + usingOversized = true; + usingBackBreaking = true; + } + }))(); + } + catch (TypeLoadException ex) + { + + } + */ + + + //RJW Patch + try + { + ((Action)(() => + { + if (RJWActive) + { + + + Log.Message("[SizedApparel] RimJobWorld Found"); + //harmony.Patch(AccessTools.Method(typeof(rjw.JobDriver_SexBaseInitiator), "Start"), + //postfix: new HarmonyMethod(typeof(SexStartPatch), "Postfix")); + + //harmony.Patch(AccessTools.Method(typeof(rjw.JobDriver_SexBaseInitiator), "End"), + //postfix: new HarmonyMethod(typeof(SexEndPatch), "Postfix")); + + //harmony.Patch(AccessTools.Method(typeof(rjw.SexUtility), "DrawNude"), + //postfix: new HarmonyMethod(typeof(DrawNudePatch), "Postfix")); + + harmony.Patch(AccessTools.Method(typeof(Sexualizer), "sexualize_pawn"), + postfix: new HarmonyMethod(typeof(SexualizePawnPatch), "Postfix")); + + Log.Message("[SizedApparel] RimJobWorld Patched"); + + } + else + { + Log.Message("[SizedApparel] RimJobWorld Paatch canceled"); + } + }))(); + } + catch (TypeLoadException ex) { } + + + //Alien Race Patch + //Alien Race No longer supported. + /* + try + { + ((Action)(() => + { + if (alienRaceActive) + { + Log.Message("[SizedApparel] AlienRace Found"); + + //harmony.Patch(AccessTools.Method(typeof(AlienRace.HarmonyPatches), "DrawAddons"), + //prefix: new HarmonyMethod(typeof(DrawAddonPatch), "Prefix")); + + Log.Message("[SizedApparel] AlienRace Patched"); + + } + else + { + Log.Message("[SizedApparel] AlienRace Patch canceled"); + } + }))(); + } + catch (TypeLoadException ex) { } + */ + + //Rim Nude World Patch + try + { + ((Action)(() => + { + if (alienRaceActive && rimNudeWorldActive) + { + Log.Message("[SizedApparel] RimNudeWorld Found"); + /* + harmony.Patch(AccessTools.Method(typeof(AlienRace.AlienPartGenerator.BodyAddon), "CanDrawAddon"), + postfix: new HarmonyMethod(typeof(RimNudeWorldBreastHidePatch), "Postfix")); + */ + //harmony.Patch(AccessTools.Method(typeof(RimNudeWorld.GenitalPatch), "Postfix"), + //prefix: new HarmonyMethod(typeof(SizedApparelRNWPatch), "Prefix")); + + //Log.Message("SizedApparelforRJW::AlienRacePatch"); + Log.Message("[SizedApparel] RimNudeWorld Patching...: RevealingApparel"); + harmony.Patch(AccessTools.Method(typeof(RevealingApparel.RevealingApparel), "CanDrawRevealing"), + postfix: new HarmonyMethod(typeof(RevealingApparelPatch), "Postfix")); + Log.Message("[SizedApparel] RimNudeWorld Patched: RevealingApparel"); + } + else + { + Log.Message("[SizedApparel] RimNudeWorld Patch canceled"); + } + }))(); + } + catch (TypeLoadException ex) + { + Log.Warning("[SizedApparel] Activated RimNudeWorld version not match to patch!\nSome patch for RimNudeWorld may not work!"); + } + + + //Dubs Apparel Tweaks Patch + try + { + ((Action)(() => + { + if (DubsApparelTweaksActive) + { + Log.Message("[SizedApparel] Dubs Apparel Tweaks Found"); + //harmony.Patch(AccessTools.Method(typeof(QuickFast.bs), "SwitchIndoors"), + //postfix: new HarmonyMethod(typeof(SizedApparelDubsApparelPatch), "indoorPostFixPatch")); + Log.Message("[SizedApparel] Dubs Apparel Tweaks (not) Patched (just debug message)"); + } + else + { + Log.Message("[SizedApparel] Dubs Apparel Tweaks Patch canceled"); + } + }))(); + } + catch (TypeLoadException ex) { } + + + //SizedApparelPatch + try + { + ((Action)(() => + { + Log.Message("[SizedApparel] doing PawnRenderer Patch"); + + //disable for 1.3 + /* + var original = typeof(PawnRenderer).GetMethod("RenderPawnInternal", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] {typeof(Vector3),typeof(float), typeof(bool), typeof(Rot4), typeof(Rot4), typeof(RotDrawMode), typeof(bool), typeof(bool), typeof(bool) }, null ); + var postfix = typeof(DrawPawnPatch).GetMethod("RenderPawnInternalPostfix"); + var prefix = typeof(DrawPawnPatch).GetMethod("RenderPawnInternalPrefix"); + harmony.Patch(original, prefix: new HarmonyMethod(prefix), postfix: new HarmonyMethod(postfix)); + */ + + //1.3 + var original0 = typeof(Pawn_ApparelTracker).GetMethod("Notify_ApparelChanged"); + var original1 = typeof(Pawn_ApparelTracker).GetMethod("Notify_ApparelAdded"); + var original2 = typeof(Pawn_ApparelTracker).GetMethod("Notify_ApparelRemoved"); + var postfix = typeof(ApparelTrackerPatch).GetMethod("Changed"); + harmony.Patch(original0, postfix: new HarmonyMethod(postfix)); + //harmony.Patch(original1, postfix: new HarmonyMethod(postfix)); + //harmony.Patch(original2, postfix: new HarmonyMethod(postfix)); + + Log.Message("[SizedApparel] PawnRenderer Patch complete"); + + }))(); + } + catch (TypeLoadException ex) + { + Log.Error("[SizedApparel] Cannot Patch for \"RenderPawnInternal\" Method! the mod may not work!"); + } + } + + + } +} diff --git a/1.3/source/SizedApparel/Properties/AssemblyInfo.cs b/1.3/source/SizedApparel/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..950c1b8 --- /dev/null +++ b/1.3/source/SizedApparel/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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")] diff --git a/1.3/source/SizedApparel/SizedAppareIdeoPatch.cs b/1.3/source/SizedApparel/SizedAppareIdeoPatch.cs new file mode 100644 index 0000000..c263cc1 --- /dev/null +++ b/1.3/source/SizedApparel/SizedAppareIdeoPatch.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; +using HarmonyLib; +using UnityEngine; +using rjw; + + +namespace SizedApparel +{ + //IdeoUIUtility.DoAppearanceItems + [HarmonyPatch(typeof(IdeoUIUtility), "DoAppearanceItems")] + static class SizedApparAppearanceUIPatch + { + //Todo: Use Transpiler + static public void oldPostfix(Ideo ideo, IdeoEditMode editMode, ref float curY, float width) + { + //DrawPubicBlox() + Rect rect = new Rect(4f, curY, IdeoUIUtility.PreceptBoxSize.x, IdeoUIUtility.PreceptBoxSize.y); + Widgets.DrawRectFast(rect, IdeoUIUtility.GetBackgroundColor(PreceptImpact.Medium), null); + string text = "PubicHair".Translate(); + } + + static void DrawPubicBox(float xOffset, float y, StyleItemTab tab, StyleItemDef defToDisplay) + { + + } + + + + } + +} diff --git a/1.3/source/SizedApparel/SizedApparelApparelBuilder.cs b/1.3/source/SizedApparel/SizedApparelApparelBuilder.cs new file mode 100644 index 0000000..98ad331 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelApparelBuilder.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SizedApparel +{ + //apparel build with apparel parts. but how? + public class SizedApparelApparelBuilder + { + + } +} diff --git a/1.3/source/SizedApparel/SizedApparelBodyPart.cs b/1.3/source/SizedApparel/SizedApparelBodyPart.cs new file mode 100644 index 0000000..8ee5cc7 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelBodyPart.cs @@ -0,0 +1,670 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using HarmonyLib; +//using AlienRace; +using UnityEngine; +using rjw; +using System.Reflection; + +namespace SizedApparel +{ + public struct Depth4Offsets + { + float South; + float North; + float East; + float West; + } + + public struct Rot4Offsets + { + //X: right and left + //Y: Frong or Back + //Z: Up and Down + Vector3 South; + Vector3 North; + Vector3 East; + Vector3 West; + + public Rot4Offsets(Vector3 vector) + { + South = vector; + North = vector; + East = vector; + West = vector; + } + + public Rot4Offsets(Vector3 south, Vector3 north, Vector3 east, Vector3 west) + { + South = south; + North = north; + East = east; + West = west; + } + + public Vector3 GetOffset(Rot4 rotation) + { + if (rotation == Rot4.East) + return East; + if (rotation == Rot4.West) + return West; + if (rotation == Rot4.South) + return South; + if (rotation == Rot4.North) + return North; + else + return Vector3.zero; + } + + } + + public struct RaceNameAndBodyType + { + public string raceName; + public string bodyType; + } + + public class BodyPart + { + public string partName; + public Depth4Offsets depthOffset; + public List offsets; + } + + public class BodyTypeAndOffset + { + //public RaceNameAndBodyType bodyTypeData; + public string bodyType; + public Rot4Offsets offsets = new Rot4Offsets(Vector3.zero); + + public BodyTypeAndOffset(bool useCenter) + { + if (useCenter) + { + offsets = new Rot4Offsets(new Vector3(0.5f, 0, 0.5f)); + } + } + public BodyTypeAndOffset(Vector3 defaultOffset) + { + offsets = new Rot4Offsets(defaultOffset); + } + } + + public enum SizedApparelBodyPartColorOf + { + Skin, Hair, Custom, None + } + + + public enum SizedApparelBodyPartOf + { + All, Torso, Breasts, Crotch, Penis, Vagina, Anus, Belly, Udder, Hips, Thighs, hands, feet, None + } + public static class SizedApparelBodyPartOfExtension + { + public static bool IsPartOf(this SizedApparelBodyPartOf source, SizedApparelBodyPartOf target) + { + if (source == SizedApparelBodyPartOf.None) + return false; + + switch (target) + { + case SizedApparelBodyPartOf.All: + return true; + case SizedApparelBodyPartOf.Torso: + if (source == SizedApparelBodyPartOf.hands || source == SizedApparelBodyPartOf.feet) + return false; + return true; + case SizedApparelBodyPartOf.Breasts: + if (source == SizedApparelBodyPartOf.Breasts) + return true; + return false; + case SizedApparelBodyPartOf.Crotch: + if (source == SizedApparelBodyPartOf.Penis || source == SizedApparelBodyPartOf.Vagina || source == SizedApparelBodyPartOf.Anus) + return true; + return false; + case SizedApparelBodyPartOf.Penis: + if (source == SizedApparelBodyPartOf.Penis) + return true; + return false; + case SizedApparelBodyPartOf.Vagina: + if (source == SizedApparelBodyPartOf.Vagina) + return true; + return false; + case SizedApparelBodyPartOf.Anus: + if (source == SizedApparelBodyPartOf.Anus) + return true; + return false; + case SizedApparelBodyPartOf.Belly: + if (source == SizedApparelBodyPartOf.Belly) + return true; + return false; + case SizedApparelBodyPartOf.Udder: + if (source == SizedApparelBodyPartOf.Udder) + return true; + return false; + case SizedApparelBodyPartOf.Hips: + if (source == SizedApparelBodyPartOf.Hips || source == SizedApparelBodyPartOf.Thighs || source == SizedApparelBodyPartOf.Penis || source == SizedApparelBodyPartOf.Vagina || source == SizedApparelBodyPartOf.Anus) + return true; + return false; + case SizedApparelBodyPartOf.Thighs: + if (source == SizedApparelBodyPartOf.Thighs) + return true; + return false; + case SizedApparelBodyPartOf.hands: + if (source == SizedApparelBodyPartOf.hands) + return true; + return false; + case SizedApparelBodyPartOf.feet: + if (source == SizedApparelBodyPartOf.feet) + return true; + return false; + case SizedApparelBodyPartOf.None: + return false; + + return false; + } + Log.Error("[SizedApparel] missing SizedApparelBodyPartOf!"); + return false; + } + } + + + public class GraphicPointsDef : Def + { + public List points; + } + + public class TextureWithGraphicPoints + { + public string texturePath; // texture is already classified with bodytype + public List points = new List(); + } + + public class GraphicPoint + { + public string pointName; + public Vector2 point = new Vector2(0.5f, 0.5f); + } + public class GraphicPointsWithBodyType + { + public string pointName; + public List points = new List(); + } + + public class PointWithBodyType + { + public string bodyTypeName; //null can be used too + public Vector2 point = new Vector2(0.5f,0.5f); + } + + public struct BodyPartPoint + { + string name; + Vector2 position;//Uv position. not pixel + } + + [Obsolete]//todo + public struct BodyPartSpline + { + + } + + public enum ColorMode + { + Skin, Hair + } + + //Def for Hediff Graphic color options or else. + public class SizedApparelHeddifDef : Def + { + public HediffDef hediffDef; + //public string hediffDefName; + + } + + //Def per graphic(texture) + public class SizedApparelBodyPartGraphicDef : Def + { + public string graphicPath; + public int severityIndex; + public Vector2 pivot = new Vector2(0.5f, 0.5f); // custom pivot of texture. UV. not pixel + //public Dictionary points = new Dictionary(); + //public Dictionary splines = new Dictionary(); + } + + //Def per BodyParts + public class SizedApparelBodyPartDef : Def + { + SizedApparelBodyPartOf bodyPartOf = SizedApparelBodyPartOf.None; + public bool canPose = false; + public bool canAnimate = false; + } + + public class SizedApparelBodyPart + { + static MethodInfo overrideMatMethod = AccessTools.Method(typeof(PawnRenderer), "OverrideMaterialIfNeeded"); + + public SizedApparelBodyPart(Pawn pawn, string bodyPartName, SizedApparelBodyPartOf bodyPartOf, string defaultHediffName, bool isBreast, bool isOverlay , string customPathName = null, SizedApparelBodyPartColorOf colorOf = SizedApparelBodyPartColorOf.Skin) + { + this.pawn = pawn; //owner + this.bodyPartName = bodyPartName; + + this.def = DefDatabase.AllDefs.FirstOrDefault(b => b.defName == bodyPartName); + + this.bodyPartOf = bodyPartOf; + this.defaultHediffName = defaultHediffName; + this.isBreast = isBreast; + this.isOverlay = isOverlay; + this.customPath = customPathName; + this.colorType = colorOf; + } + + public Vector2 OffsetFromUVOffset(Vector2 vector, Mesh mesh , bool isFliped = false) + { + //treat mesh as plane + //Vector3 width = mesh.vertices[2] - mesh.vertices[1]; + //Vector3 height = mesh.vertices[1] - mesh.vertices[2]; + Vector2 loc = new Vector2(0.5f, 0.5f) - vector; + if(!isFliped) + return new Vector2(Mathf.Lerp(mesh.vertices[0].x, mesh.vertices[2].x, loc.x), Mathf.Lerp(mesh.vertices[0].z, mesh.vertices[2].z, loc.y)); + return new Vector2(Mathf.Lerp(mesh.vertices[3].x, mesh.vertices[1].x, loc.x), Mathf.Lerp(mesh.vertices[3].z, mesh.vertices[1].z, loc.y)); + } + + //public Vector2 OffestFromUVOffset(Vector2 vector, Vector2 drawSize, bool isFliped = false) + + public SizedApparelBodyPartDef def; + + public Pawn pawn; + public string bodyPartName; //breast, penis, belly, pubichair... etc. just name. not like architech something + public string customPath = null; + public SizedApparelBodyPartOf bodyPartOf = SizedApparelBodyPartOf.None; + public string defaultHediffName; + + public bool isBreast = false; + public bool isOverlay = false; //write z cache? + + public string currentHediffName; + + public bool isVisible = true; + + public SizedApparelBodyPartColorOf colorType = SizedApparelBodyPartColorOf.Skin; + public Color? customColorOne; + public Color? customColorTwo; + + + //customize + public string customPose = null; + public Vector2? lookAnLocation = null; + public Rot4? rotOverride = null; + + //variation + public string variation = null; + public Color? variationColor; + public colorOverrideMode variationColorMode = colorOverrideMode.Default; + + + //TODO. age setting? + public int minDrawAge = -1; + public int maxDrawAge = -1; + + + + public void SetCustomPose(string newPose, bool autoUpdate = true, bool autoSetPawnGraphicDirty = false) + { + if (customPose == newPose) + return; + customPose = newPose; + if (autoUpdate) + this.UpdateGraphic(); + if(autoSetPawnGraphicDirty) + { + if (pawn == null) + return; + PortraitsCache.SetDirty(pawn); + GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(pawn); + } + } + + public bool CheckCanPose(string targetPose, bool checkApparels, bool mustMatchSize) + { + if (checkApparels) + { + foreach(ApparelGraphicRecord agr in pawn.Drawer.renderer.graphics.apparelGraphics) + { + /* + if (!agr.sourceApparel.def.apparel.bodyPartGroups.Any(bpgd => bpgd.defName == "Torso" || bpgd.defName == "Chest")) + continue; + + if (agr.sourceApparel.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_IgnorePose".ToLower())) + continue; + */ + + string originalPath = SizedApparelsDatabase.GetSupportedApparelOriginalPath(agr.graphic.path); + if (originalPath == null) + return false; + + int outInt = -1; + float outFloat = -1; + SizedApparelsDatabase.SizedApparelDatabaseKey key = new SizedApparelsDatabase.SizedApparelDatabaseKey(originalPath,pawn.def.defName,pawn.story?.bodyType?.defName, pawn.gender, currentHediffName, Math.Min(currentSeverityInt, cappedSeverityInt), false, targetPose); + if (SizedApparelSettings.useGenderSpecificTexture) + key.gender = Gender.None; + var result = SizedApparelsDatabase.GetSupportedApparelSizedPath(key, out outInt, out outFloat); + if (!result.isCustomPose) + return false; + } + } + Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, targetPose); + Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, targetPose); + if (graphic != null || graphicH != null) + return true; + return false; + } + + + //TODO... + public int currentSeverityInt = -1; + public int cappedSeverityInt = 1000; // supported severity from worn apparel graphics + + public Vector2 pivot = new Vector2(0.5f, 0.5f); + + public Vector2 position = Vector2.zero;//offset from pivot //UV. not pixel + + public Dictionary points; + public Dictionary pointsHorny; + + + public float rotation = 0; // +: rotate right, -: rotate left + public Vector2 scale = Vector2.one; + + public Graphic bodyPartGraphic; + public Graphic bodyPartGraphicHorny; + + public Vector2 positionOffset = Vector2.zero; //offset from position //UV. not pixel + public Vector2 positionOffsetSouth = Vector2.zero; + public Vector2 positionOffsetNorth = Vector2.zero; + public Vector2 positionOffsetEast = Vector2.zero; + public Vector2 positionOffsetWest = Vector2.zero; + + public float depthOffset = 0f; + + public float depthOffsetEast = 0.008f; + public float depthOffsetWest = 0.008f; + public float depthOffsetSouth = 0.008f; + public float depthOffsetNorth = 0.008f; + + //bigger = in front + public void SetDepthOffsets(float south, float north, float east, float west) + { + depthOffsetSouth = south; + depthOffsetNorth = north; + depthOffsetEast = east; + depthOffsetWest = west; + } + public void SetPositionOffsets(Vector2 south, Vector2 north, Vector2 east, Vector2 west) + { + positionOffsetSouth = south; + positionOffsetNorth = north; + positionOffsetEast = east; + positionOffsetWest = west; + } + public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, string poseOverride = null) + { + Dictionary var; + return GetBodyPartGraphics(isHorny, out var, mustMatchSize, poseOverride); + } + + public Graphic GetBodyPartGraphics(bool isHorny, out Dictionary outPoints, bool mustMatchSize = false ,string poseOverride = null, string variationOverride = null) + { + if (pawn == null) + { + outPoints = null; + return null; + } + + var comp = pawn.TryGetComp(); + + if (comp == null) + { + outPoints = null; + return null; + } + + + var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, currentHediffName, customPath==null?bodyPartName: customPath, pawn.gender, Math.Min(currentSeverityInt, cappedSeverityInt), isHorny, poseOverride==null?customPose:poseOverride, variationOverride==null?variation: variationOverride); + var result = SizedApparelsDatabase.GetSupportedBodyPartPath(key, isBreast, customPath == null ? bodyPartName : customPath, defaultHediffName); + + if (mustMatchSize) + if (Math.Min(currentSeverityInt, cappedSeverityInt) != result.size) + { + outPoints = null; + return null; + } + + if (result.pathWithSizeIndex == null) + { + outPoints = null; + return null; + } + outPoints = result.points; + return GraphicDatabase.Get(result.pathWithSizeIndex); + } + + public void UpdateGraphic() + { + bodyPartGraphic = GetBodyPartGraphics(false, out points, false); + bodyPartGraphicHorny = GetBodyPartGraphics(true, out pointsHorny, false); + } + + public void UpdateGraphic(int index, int indexCapped = 1000) + { + this.currentSeverityInt = index; + this.cappedSeverityInt = indexCapped; + + UpdateGraphic(); + } + + public void ResetTransform() + { + this.position = Vector2.zero; + this.scale = Vector2.one; + this.rotation = 0; + } + + public void ClearGraphics() + { + this.bodyPartGraphic = null; + this.bodyPartGraphicHorny = null; + this.points = null; + this.pointsHorny = null; + } + public void Clear() + { + currentHediffName = null; + currentSeverityInt = -1; + cappedSeverityInt = 1000; + customPose = null; + rotOverride = null; + + ClearGraphics(); + } + + /* + public void SetHediffData(string name, int severityIndex , string variation = null) + { + currentHediffName = name; + currentSeverityInt = severityIndex; + }*/ + + public void SetHediffData(string name, int severityIndex, int cappedSeverityIndex = 1000, string variation = null) + { + currentHediffName = name; + currentSeverityInt = severityIndex; + this.cappedSeverityInt = cappedSeverityIndex; + this.variation = variation; + } + + public void DrawBodyPart (Vector3 rootLoc, float angle, Rot4 facing, RotDrawMode bodyDrawType, PawnRenderFlags flags, Mesh bodyMesh) + { + if (!isVisible) + return; + if (scale == Vector2.zero) + return; //Don't draw if scale is zero + if (pawn == null) + return; + + PawnRenderer pawnRenderer = pawn.Drawer.renderer; + Shader shader = ShaderDatabase.CutoutComplex; + Color drawColor1 = Color.white; + Color drawColor2 = Color.white; + + bool forceWriteZ = true; + + if(colorType == SizedApparelBodyPartColorOf.Skin) + { + forceWriteZ = true; + if (bodyDrawType == RotDrawMode.Fresh) + { + + shader = pawn.Drawer.renderer.graphics.nakedGraphic.Shader; + if (!ShaderUtility.SupportsMaskTex(shader)) + shader = ShaderDatabase.CutoutSkinOverlay; + drawColor1 = pawn.Drawer.renderer.graphics.nakedGraphic.Color; + drawColor2 = pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo; + } + else if (bodyDrawType == RotDrawMode.Rotting) + { + + shader = pawn.Drawer.renderer.graphics.rottingGraphic.Shader; + if (!ShaderUtility.SupportsMaskTex(shader)) + shader = ShaderDatabase.CutoutSkinOverlay; + drawColor1 = pawn.Drawer.renderer.graphics.rottingGraphic.Color; + drawColor2 = pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo; + } + } + else if (colorType == SizedApparelBodyPartColorOf.Hair) + { + forceWriteZ = false; + shader = ShaderDatabase.Transparent; + if(pawn.story != null) + drawColor1 = pawn.story.hairColor; + } + else if (colorType == SizedApparelBodyPartColorOf.Custom) + { + forceWriteZ = true; + shader = ShaderDatabase.Transparent; + if(customColorOne != null) + drawColor1 = customColorOne.Value; + if (customColorTwo != null) + drawColor2 = customColorTwo.Value; + } + else if (colorType == SizedApparelBodyPartColorOf.None) + { + forceWriteZ = false; + shader = ShaderDatabase.Cutout; + } + + + + + Quaternion quaternion = Quaternion.AngleAxis(angle + rotation, Vector3.up); + Vector3 vector = rootLoc; + + Rot4 targetRot = facing; + if (rotOverride != null) + targetRot = rotOverride.Value; + + if (targetRot == Rot4.South) + { + var loc = OffsetFromUVOffset(positionOffsetSouth, bodyMesh); + vector.x += loc.x; + vector.z += loc.y; + vector.y += depthOffsetSouth; + } + else if(targetRot == Rot4.North) + { + var loc = OffsetFromUVOffset(positionOffsetNorth, bodyMesh); + vector.x += loc.x; + vector.z += loc.y; + vector.y += depthOffsetNorth; + } + else if (targetRot == Rot4.East) + { + var loc = OffsetFromUVOffset(positionOffsetEast, bodyMesh); + vector.x += loc.x; + vector.z += loc.y; + vector.y += depthOffsetEast; + } + else if (targetRot == Rot4.West) + { + var loc = OffsetFromUVOffset(positionOffsetWest, bodyMesh); + vector.x += loc.x; + vector.z += loc.y; + vector.y += depthOffsetWest; + } + + + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(pawn)) + graphic = bodyPartGraphicHorny; + if (graphic == null) + graphic = bodyPartGraphic; + + if (graphic == null) + return; + + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)&&!isOverlay&& forceWriteZ) + { + graphic = graphic.GetColoredVersion(ShaderDatabase.Cutout, drawColor1, drawColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { graphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, drawColor1, drawColor2); + vector.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(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + + + } + } + + + //TODO: Torso Pose? + + + public class SizedApparelBodyDef : Def + { + //public List BodyParts; + + + //defName = raceName ?? could it work? + + public List bodyParts; + + /* + public List penisOffset; + public List vaginaOffset; //TODO + public List udderOffset; //TODO + public List bellyOffset; //TODO + public List breastsOffset; //TODO + public List anusOffset; //TODO + */ + } + + public class SizedApparelBody + { + public string customPoseOfBody = null; + + public bool canCustomPose() + { + //check apparels + return false; + } + } + +} diff --git a/1.3/source/SizedApparel/SizedApparelBodyPartDetail.cs b/1.3/source/SizedApparel/SizedApparelBodyPartDetail.cs new file mode 100644 index 0000000..31d6f8c --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelBodyPartDetail.cs @@ -0,0 +1,272 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using rjw; +using HarmonyLib; +using UnityEngine; +using RimWorld; +using Verse; + +namespace SizedApparel +{ + public enum colorOverrideMode + { + Default, Multiply, Add + } + public class BodyPartVariationWithRace + { + public string hediffName; + public ListvarName = new List(); + + } + + public class SizedApparelBodyPartVariationDef : Def + { + public string bodyPartName; + public Listvariations = new List(); + } + + public class SizedApparelBodyPartDetail : HediffComp + { + + public string variation = null; // null to default + public string bodyPartName; + public SizedApparelBodyPartVariationDef variationDef; + public Color? colorOverride = null;//TODO + public colorOverrideMode colorMode = colorOverrideMode.Default;//TODO + + public override string CompTipStringExtra => "Variation: " + (variation == null ? "Default" : variation) + " (sized apparel)"; + + public override void CompExposeData() + { + Scribe_Values.Look(ref this.variation, "variation", null, false); + //Scribe_Values.Look(ref this.colorOverride, "colorOverride",null, false); + //Scribe_Values.Look(ref this.colorMode, "colorMode", colorOverrideMode.Default, false); + } + + public override void CompPostMake() + { + base.CompPostMake(); + + if (SizedApparelUtility.isBreast(parent.def.defName)) + bodyPartName = "Breasts"; + else if (Genital_Helper.is_vagina(parent)) // SizedApparelUtility.isVagina(parent.def.defName) + bodyPartName = "Vagina"; + else if (SizedApparelUtility.isAnus(parent.def.defName)) + bodyPartName = "Anus"; + else if (SizedApparelUtility.isUdder(parent.def.defName)) + bodyPartName = "Udder"; + else if (Genital_Helper.is_penis(parent)) //SizedApparelUtility.isPenis(parent.def.defName) + bodyPartName = "Penis"; + + else + bodyPartName = parent.def.defName; + + + if (Pawn == null) + return; + if (DefDatabase.DefCount == 0) + { + Log.Warning("[Sized Apparel] Cannot Find Any BodyPart Variation Def. It can be version issue or other mod's patch issue."); + variation = null; + return; + } + try + { + variationDef = DefDatabase.AllDefs?.FirstOrDefault(b => b.bodyPartName == bodyPartName); + } + catch(ArgumentNullException e) + { + Log.Warning("[Sized Apparel] Cannot Find Any BodyPart Variation Def of ( " + bodyPartName + " )!. It can be version issue or other mod's patch issue."); + variation = null; + return; + } + + if (variationDef == null) + return; + if (variationDef.variations == null) + return; + var variations = variationDef.variations?.FirstOrDefault(v => v.hediffName == parent.def.defName); + if (variations == null) + variations = variationDef.variations?.FirstOrDefault(v => v.hediffName == bodyPartName); + if (variations == null) + return; + if (variations.varName.NullOrEmpty()) + return; + + this.variation = variations.varName.RandomElement(); + + if (variation.ToLower() == "null" || variation.ToLower() == "default") + { + variation = null; + } + + } + + + } + public class SizedApparelBodyPartDetailProperties : HediffCompProperties + { + public string bodyPartName; + + public SizedApparelBodyPartDetailProperties() + { + this.compClass = typeof(SizedApparelBodyPartDetail); + } + } + + + public class SizedApparelBodyPartDetailGizmo : Command + { + + } + + + + + + public class SizedApparelBodyPartDetailThing : ThingComp + { + + public string variation = null; // null to default + public string bodyPartName; + public SizedApparelBodyPartVariationDef variationDef; + public Color? colorOverride = null;//TODO + public colorOverrideMode colorMode = colorOverrideMode.Default;//TODO + + + public override string GetDescriptionPart() + { + if(SizedApparelSettings.showBodyPartsVariation) + return "Variation: " +( variation == null?"Default":variation) + " (sized apparel)"; + + return string.Empty; + } + + /* + public override string TransformLabel(string label) + { + return label + "Variation: " + variation == null ? "Default" : variation + " (sized apparel)"; + } + */ + + public override void PostExposeData() + { + Scribe_Values.Look(ref this.variation, "variation", null, false); + //Scribe_Values.Look(ref this.colorOverride, "colorOverride",null, false); + //Scribe_Values.Look(ref this.colorMode, "colorMode", colorOverrideMode.Default, false); + } + + public void InitComp(Pawn pawn = null) + { + HediffDef named = DefDatabase.GetNamed(this.parent.def.defName, true); + List allMaps_FreeColonistsAndPrisonersSpawned = PawnsFinder.AllMaps_FreeColonistsAndPrisonersSpawned; + pawn = ((allMaps_FreeColonistsAndPrisonersSpawned != null) ? allMaps_FreeColonistsAndPrisonersSpawned.RandomElement() : null); + if (pawn == null) + { + List all_AliveOrDead = PawnsFinder.All_AliveOrDead; + pawn = ((all_AliveOrDead != null) ? all_AliveOrDead.RandomElement() : null); + } + SizedApparelBodyPartDetail compHediffBodyPart = HediffMaker.MakeHediff(named, pawn, null).TryGetComp(); + if (compHediffBodyPart != null) + { + //compHediffBodyPart.initComp(pawn, false); + //compHediffBodyPart.updatesize(0f); + this.variation = compHediffBodyPart.variation; + } + } + + + public override void PostPostMake() + { + base.PostPostMake(); + + if (SizedApparelUtility.isBreast(parent.def.defName)) + bodyPartName = "Breasts"; + else if (SizedApparelUtility.isVagina(parent.def.defName)) + bodyPartName = "Vagina"; + else if (SizedApparelUtility.isAnus(parent.def.defName)) + bodyPartName = "Anus"; + else if (SizedApparelUtility.isUdder(parent.def.defName)) + bodyPartName = "Udder"; + else if (SizedApparelUtility.isPenis(parent.def.defName)) + bodyPartName = "Penis"; + + else + bodyPartName = parent.def.defName; + + variationDef = DefDatabase.AllDefs?.FirstOrDefault(b => b.bodyPartName == bodyPartName); + if (variationDef == null) + return; + if (variationDef.variations == null) + return; + var variations = variationDef.variations?.FirstOrDefault(v => v.hediffName == parent.def.defName); + if (variations == null) + variations = variationDef.variations?.FirstOrDefault(v => v.hediffName == bodyPartName); + if (variations == null) + return; + if (variations.varName.NullOrEmpty()) + return; + + this.variation = variations.varName.RandomElement(); + + if (variation.ToLower() == "null" || variation.ToLower() == "default") + { + variation = null; + } + + } + + + } + public class SizedApparelBodyPartDetailThingProperties : CompProperties + { + public string bodyPartName; + + public SizedApparelBodyPartDetailThingProperties() + { + this.compClass = typeof(SizedApparelBodyPartDetailThing); + } + } + + + + [HarmonyPatch(typeof(SexPartAdder), "recipePartAdder")] + public class recipePartAdderPatch + { + public static void Postfix(RecipeDef recipe, Pawn pawn, BodyPartRecord part, List ingredients, Hediff __result) + { + if (__result == null) + return; + Thing thing = ingredients.FirstOrDefault(x => x.def.defName == recipe.addsHediff.defName); + if (thing == null) + return; + SizedApparelBodyPartDetailThing CompThing = thing.TryGetComp(); + SizedApparelBodyPartDetail CompHediff = __result.TryGetComp(); + CompHediff.variation = CompThing.variation; + } + + } + [HarmonyPatch(typeof(SexPartAdder), "recipePartRemover")] + public class recipePartRemoverPatch + { + public static void Postfix(Hediff hd, ref Thing __result) + { + //Thanks! "Stardust" helped + try + { + SizedApparelBodyPartDetailThing CompThing = __result.TryGetComp(); + SizedApparelBodyPartDetail CompHediff = hd.TryGetComp(); + + CompThing.variation = CompHediff.variation; + } + catch (NullReferenceException e) + { + Log.Error(e.StackTrace); + } + } + } + +} diff --git a/1.3/source/SizedApparel/SizedApparelBodyPartEditor.cs b/1.3/source/SizedApparel/SizedApparelBodyPartEditor.cs new file mode 100644 index 0000000..cc3f2e7 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelBodyPartEditor.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SizedApparel +{ + //editing offset for alien race? such as penis, anus offsets, except breast.(breasts position must be matched with apparels.) + class SizedApparelBodyPartEditor + { + } +} diff --git a/1.3/source/SizedApparel/SizedApparelComp.cs b/1.3/source/SizedApparel/SizedApparelComp.cs new file mode 100644 index 0000000..ee8cf16 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelComp.cs @@ -0,0 +1,1271 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using RimWorld; +using rjw; +using Verse; + +namespace SizedApparel +{ + [StaticConstructorOnStartup] + public class ApparelRecorderComp : ThingComp + { + + public bool isDrawAge = true; + + public bool testbool = false; + public ApparelRecorderCompProperties Props => (ApparelRecorderCompProperties)this.props; + public bool hasUpdateBefore = false; + public bool hasUpdateBeforeSuccess = false; + public bool hasGraphicUpdatedBefore = false; // not yet + + public bool needToCheckApparelGraphicRecords = false; + public bool isDirty = true; + + public bool hasUnsupportedApparel = true; + public bool havingSex = false;//Obsolete + public bool hasUpdateForSex = false;//Obsolete + + + public List cachedApparelGraphicRecord = new List(); + + + + public Hediff breastHediff = null; //TODO: Make this as List + public Hediff vaginaHediff = null; + public List penisHediffs = null; // RJW can attach multiple penis + public Hediff anusHediff = null; + + public Hediff udderHediff = null;//RJW 4.6.8: Udder is not partof chest's breast. it attached to torso. + + public float breastSeverity = -1; + + public float breastSeverityCapToDraw = 1000; + public float BreastSeverityCache = 0; + //public float BiggestBreastSeverityInAvailableTextures = 0; + + + //for breasts animation or something. + public Vector3? prePositionCache; + public float? preAngleCache; + public int? preTickCache; + + + public SizedApparelBodyPart bodyPartBreasts;//TODO: Make this as List + public SizedApparelBodyPart bodyPartNipple;//TODO + public List bodyPartPenises = new List(); + public List bodyPartBalls = new List(); + public SizedApparelBodyPart bodyPartVagina; + public SizedApparelBodyPart bodyPartAnus; + public SizedApparelBodyPart bodyPartBelly; + public SizedApparelBodyPart bodyPartMuscleOverlay;//TODO + public SizedApparelBodyPart bodyPartUdder; + public SizedApparelBodyPart bodyPartPubicHair; //TODO + public SizedApparelBodyPart bodyPartHips; + public List bodyPartThighs = new List(); + public List bodyPartHands = new List(); + public List bodyPartFeet = new List(); + + public Graphic graphicSourceNaked = null; //original Graphic + public Graphic graphicSourceRotten = null; //original Graphic + + public Graphic graphicbaseBodyNaked = null; + public Graphic graphicbaseBodyRotten = null; + + [Obsolete] + public Graphic graphicBreasts = null; + [Obsolete] + public Graphic graphicBreasts_horny = null; + [Obsolete] + public Graphic graphicVagina = null; + [Obsolete] + public Graphic graphicVagina_horny = null; + [Obsolete] + public Graphic graphicAnus = null; + [Obsolete] + public Graphic graphicAnus_horny = null; + [Obsolete] + public List graphicPenises = new List(); + [Obsolete] + public List graphicBallsOfPenises = new List(); + [Obsolete] + public Graphic graphicBelly = null; + [Obsolete] + public Graphic graphicUdder = null; //RJW 4.6.8: Udder is not partof chest's breast. it attached to torso. + [Obsolete] + public Graphic graphicUdder_horny = null; + [Obsolete] + public List graphicPenises_horny = new List(); + [Obsolete] + public List graphicBalls_horny = new List();//Does it need? + + //size uncapped breasts graphics. + [Obsolete] + public Graphic graphicBreastsNude = null; + [Obsolete] + public Graphic graphicBreastsNude_horny = null; + + private bool drawingBreastsAddon = false; + + public AlienRaceSetting raceSetting = new AlienRaceSetting(); + + public string customPose = null; + public SizedApparelPose currentCustomPose = null; + + + public bool forceHorny = false; + + + public bool canDrawBreasts = false; + public bool canDrawPenis = false; + public bool canDrawVaginaAndAnus = false; + public bool canDrawTorsoParts = false; //belly and udder + + public override void Initialize(CompProperties props) + { + base.Initialize(props); + Pawn p = parent as Pawn; + + bodyPartBreasts = new SizedApparelBodyPart(p, "Breasts", SizedApparelBodyPartOf.Breasts, "Breasts", true, false); + bodyPartBreasts.SetDepthOffsets(0.0113f, 0.001f, 0.0113f, 0.0113f); + bodyPartNipple = new SizedApparelBodyPart(p, "Nippple", SizedApparelBodyPartOf.Breasts, "Breasts", true, false); + bodyPartBreasts.SetDepthOffsets(0.0114f, 0.000f, 0.0114f, 0.0114f); + + bodyPartUdder = new SizedApparelBodyPart(p, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false); + bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f); + //UdderNipple...? + //bodyPartUdder = new SizedApparelBodyPart(p, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false); + //bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f); + + bodyPartVagina = new SizedApparelBodyPart(p, "Vagina", SizedApparelBodyPartOf.Vagina, "Vagina", false, false); + bodyPartVagina.SetDepthOffsets(0.0088f, 0.0100f, 0.0088f, 0.0088f); + + bodyPartAnus = new SizedApparelBodyPart(p, "Anus", SizedApparelBodyPartOf.Anus, "Anus", false, false); + bodyPartAnus.SetDepthOffsets(0.0093f, 0.0105f, 0.0093f, 0.0093f); + + bodyPartBelly = new SizedApparelBodyPart(p, "Belly", SizedApparelBodyPartOf.Belly, "BellyBulge", false, false); + bodyPartBelly.SetDepthOffsets(0.0098f, 0.0002f, 0.0098f, 0.0098f); + } + + public override void PostExposeData() + { + base.PostExposeData(); + Scribe_Values.Look(ref customPose, "customPose"); // save pawn's custom pose + //Scribe_Values.Look<>(); //TODO: save pubic hair data + } + + + + /* + public override void CompTick() + { + base.CompTick(); + + + } + + public override void CompTickRare() + { + base.CompTickRare(); + }*/ + + string[] testPose = { null, "JiggleUp", "JiggleCenter" }; + string[] testPose2 = { null, "PenisDown" }; + + public void DrawUpdate(Vector3 rootLoc, float angle) // call this in DrawPawnBody + { + //int IdTick = parent.thingIDNumber * 20; //hint from yayo animation mod + if (SizedApparelSettings.autoJiggleBreasts) + { + Vector3 velocity; + if (this.prePositionCache != null) + velocity = this.prePositionCache.Value - rootLoc; + else + velocity = Vector3.zero; + + + + float rotation; + if (this.preAngleCache != null) + rotation = this.preAngleCache.Value - angle; + else + rotation = 0; + + int tick; + if (this.preTickCache != null) + tick = Find.TickManager.TicksGame - this.preTickCache.Value; + else + tick = 1; + + + + this.prePositionCache = rootLoc; + this.preAngleCache = angle; + this.preTickCache = Find.TickManager.TicksGame; + + } + + SetPoseFromPoseSet(testPose2.RandomElement()); + } + + + public bool isApparelGraphicRecordChanged() + { + Pawn pawn = parent as Pawn; + if (pawn == null) + return false; + + var apparelGraphics = pawn.Drawer?.renderer?.graphics?.apparelGraphics; + if (apparelGraphics == null) + return false; + + //return false; //since 1.3 broken. force to return false; + if (!apparelGraphics.SequenceEqual(cachedApparelGraphicRecord)) + { + if (SizedApparelSettings.Debug) + Log.Message("[SizedApparel]:" + pawn + "'s apparel Record Changed! need to updating comp"); + return true; + } + + + return false; + } + + + //not working + public override void PostPostMake() + { + /* + Pawn pawn; + try + { + pawn = (Pawn)parent; + if (pawn != null) + { + if (!pawn.RaceProps.Humanlike) + return; + pawn.Drawer.renderer.graphics.ResolveAllGraphics(); + if (SizedApparelSettings.Debug) + Log.Message("[SizedApparels] Component Inint And Resolve all Graphics for "+ pawn.Name); + } + } + catch + { + + } + */ + } + public void ClearHediffs() + { + breastHediff = null; + vaginaHediff = null; + if(penisHediffs != null) + penisHediffs.Clear(); + anusHediff = null; + + udderHediff = null; + } + public void ClearBreastCacheValue() + { + breastHediff = null; + breastSeverity = -1; + breastSeverityCapToDraw = 1000; + BreastSeverityCache = 0; + } + public void ClearPenisCacheValue() + { + //TODO + } + public void ClearCanDraw() + { + canDrawBreasts = false; + canDrawPenis = false; + canDrawTorsoParts = false; + canDrawVaginaAndAnus = false; + } + public void ClearGraphics(bool clearBreasts = true) + { + hasGraphicUpdatedBefore = false; + graphicbaseBodyNaked = null; + graphicbaseBodyRotten = null; + + //Clear BodyParts + if(clearBreasts) + bodyPartBreasts.Clear(); + bodyPartAnus.Clear(); + bodyPartBelly.Clear(); + bodyPartVagina.Clear(); + + graphicBreasts = null; + graphicVagina = null; + graphicAnus = null; + if (graphicPenises == null) + graphicPenises = new List(); + else + graphicPenises.Clear(); + if (graphicBallsOfPenises == null) + graphicBallsOfPenises = new List(); + else + graphicBallsOfPenises.Clear(); + graphicBelly = null; + + graphicUdder = null; + graphicUdder_horny = null; + + graphicBreasts_horny = null; + graphicVagina_horny = null; + graphicAnus_horny = null; + if (graphicPenises_horny == null) + graphicPenises_horny = new List(); + else + graphicPenises_horny.Clear(); + if (graphicBalls_horny == null) + graphicBalls_horny = new List(); + else + graphicBalls_horny.Clear(); + } + public void ClearAll(bool clearGraphics = true) + { + ClearBreastCacheValue(); + if(clearGraphics) + ClearGraphics(); + ClearHediffs(); + ClearCanDraw(); + hasUnsupportedApparel = false; + hasUpdateBefore = false; + hasUpdateBeforeSuccess = false; + needToCheckApparelGraphicRecords = false; + } + + public void SetDirty(bool clearPawnGraphicSet = false) + { + this.isDirty = true; + if (clearPawnGraphicSet) + { + Pawn pawn = parent as Pawn; + if (pawn == null) + return; + if (pawn.Drawer == null) + return; + if (pawn.Drawer.renderer == null) + return; + pawn.Drawer.renderer.graphics.ClearCache(); + + } + + } + + public void UpdateIfDirty() + { + + } + + public void UpdateBodyGraphics() + { + + } + public void UpdateSettingData() + { + Pawn pawn = parent as Pawn; + if (pawn == null) + return; + + var loc_raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == pawn.def.defName); + if (raceSetting == null) + return; + raceSetting = loc_raceSetting; + } + + public void CheckAgeChanged() + { + Pawn pawn = parent as Pawn; + if (pawn == null) + return; + if (pawn.ageTracker == null) + return; + + //TODO. Cleanup + UpdateSettingData(); + if (raceSetting == null) + return; + + if (raceSetting.drawMinAge < 0 || pawn.ageTracker.AgeBiologicalYearsFloat >= raceSetting.drawMinAge) + isDrawAge = true; + else + isDrawAge = false; + } + + public void Update(bool cache = true, bool fromGraphicRecord = true, bool updateGraphics = true, bool CheckApparel = true) + { + isDirty = false; + bool flag = fromGraphicRecord; + needToCheckApparelGraphicRecords = false; + //flag = false; //TODO:fromGraphicRecord is forced not to do for a while. it will update later + hasUpdateBefore = true; + Pawn pawn = parent as Pawn; + if (pawn == null) + return; + if (SizedApparelSettings.Debug) + Log.Message("[SizedApparel] Updating Component of " + pawn.Name); + if (updateGraphics) + { + ClearGraphics(); + ClearHediffs(); + } + CheckAgeChanged(); + + SizedApparelUtility.GetBreastSeverity(pawn, out breastSeverity, out breastHediff); + if (breastHediff != null) + { + BreastSeverityCache = 1000; + if (CheckApparel) + hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(pawn, breastSeverity, breastHediff, true, flag); + else + hasUnsupportedApparel = false; + //float validBreastTextureSeverity = SizedApparelUtility.GetBreastSeverityValidTextures(pawn, breastHediff); + if (hasUnsupportedApparel) + BreastSeverityCache = breastSeverity; + //float validBreastTextureSeverity = SizedApparelUtility.GetBreastSeverityValidTextures(pawn, breastHediff); + + //breast cache forApparel brests Check. This ignore variation! + //SizedApparelMod.CheckAndLoadAlienRaces(); + + var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, breastHediff.def.defName, "Breasts", pawn.gender ,SizedApparelUtility.BreastSeverityInt(breastHediff.Severity)); + var raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == key.raceName); + + float validBreastTextureSeverity = SizedApparelUtility.BreastSizeIndexToSeverity(SizedApparelsDatabase.GetSupportedBodyPartPath(key,true,"Breasts","Breasts").size); + //if (validBreastTextureSeverity < -5 && SizedApparelSettings.alienRaceSettings.settings[key.raceName].asHumanlike)//old: SizedApparelSettings.UnsupportedRaceToUseHumanlike + // validBreastTextureSeverity = SizedApparelUtility.GetBreastSeverityValidTextures(pawn, breastHediff, "Humanlike"); + BreastSeverityCache = Math.Min(BreastSeverityCache, validBreastTextureSeverity); + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] cached Severity : " + BreastSeverityCache); + } + //penisHediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("penis")); + + //since rjw race support's part name are too variation, not handling it. + + BodyPartRecord genitalPart = Genital_Helper.get_genitalsBPR(pawn); + if (genitalPart != null) + { + var genitalList = Genital_Helper.get_PartsHediffList(pawn, genitalPart); + if (!genitalList.NullOrEmpty()) + { + if (SizedApparelSettings.Debug) + { + foreach (var g in genitalList) + { + Log.Message(" [SizedApparel] "+ pawn.Name + "has hediff in genital (" + g.def.defName + ")"); + } + } + + //penisHediffs = genitalList.FindAll((Hediff h) => SizedApparelUtility.isPenis(h.def.defName)); + penisHediffs = genitalList.FindAll((Hediff h) => Genital_Helper.is_penis(h)); + //vaginaHediff = genitalList.FirstOrDefault((Hediff h) => SizedApparelUtility.isVagina(h.def.defName)); + vaginaHediff = genitalList.FirstOrDefault((Hediff h) => Genital_Helper.is_vagina(h)); + + } + + } + var anusList = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)); + if(!anusList.NullOrEmpty()) + anusHediff = anusList.FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus")); + //udderHediff = Genital_Helper.get_PartsHediffList(pawn, pawn.RaceProps.body.AllParts.Find((BodyPartRecord bpr) => bpr.def.defName == "Torso")).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus")); //not yet supported + + udderHediff = pawn.health?.hediffSet?.hediffs?.FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("udder")); + + var pawnRenderer = pawn.Drawer?.renderer?.graphics; + + if (updateGraphics) + { + string baseBodyString = "_BaseBody"; + string baseBodyStringWithSex; + + if (SizedApparelSettings.useGenderSpecificTexture) + { + if (pawn.gender == Gender.Female) + { + baseBodyStringWithSex = baseBodyString + "F"; + } + else if (pawn.gender == Gender.Male) + { + baseBodyStringWithSex = baseBodyString + "M"; + } + else + { + baseBodyStringWithSex = baseBodyString; // + "N" //Does it need to add N? + } + } + else + baseBodyStringWithSex = baseBodyString; + + + if (pawnRenderer != null) + { + //pawnRenderer.ResolveAllGraphics(); + + + + //TODO. Move BodyTextureSearch to utility + string nakedGraphicPath = null; + if (pawnRenderer.nakedGraphic != null) + { + //path = path.Insert(Math.Max(path.LastIndexOf('/'), 0), "/CustomPose/"+ customPose); + if(graphicSourceNaked == null) + graphicSourceNaked = pawnRenderer.nakedGraphic; + nakedGraphicPath = graphicSourceNaked.path; + + if (customPose != null) + nakedGraphicPath = nakedGraphicPath.Insert(Math.Max(nakedGraphicPath.LastIndexOf('/'), 0), "/CustomPose/" + customPose); + + if (!nakedGraphicPath.Contains(baseBodyString)) + { + if (graphicbaseBodyNaked == null) + { + if (ContentFinder.Get((nakedGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + //graphicSourceNaked = pawnRenderer.nakedGraphic; + Shader shader = pawnRenderer.nakedGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; + } + else if (customPose != null) + { + nakedGraphicPath = pawnRenderer.nakedGraphic.path; + if (ContentFinder.Get((nakedGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + //graphicSourceNaked = pawnRenderer.nakedGraphic; + Shader shader = pawnRenderer.nakedGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + nakedGraphicPath + baseBodyStringWithSex + "_south"); + } + } + } + if (graphicbaseBodyNaked == null) + { + if (ContentFinder.Get((nakedGraphicPath + baseBodyString + "_south"), false) != null) + { + // graphicSourceNaked = pawnRenderer.nakedGraphic; + Shader shader = pawnRenderer.nakedGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyString, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; + } + else if (customPose != null) + { + nakedGraphicPath = pawnRenderer.nakedGraphic.path; + if (ContentFinder.Get((nakedGraphicPath + baseBodyString + "_south"), false) != null) + { + //graphicSourceNaked = pawnRenderer.nakedGraphic; + Shader shader = pawnRenderer.nakedGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyString, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + nakedGraphicPath + baseBodyString + "_south"); + } + + } + } + + } + else + graphicbaseBodyNaked = pawnRenderer.nakedGraphic; + + } + + string rottingGraphicPath = null; + if (pawnRenderer.rottingGraphic != null) + { + if (graphicSourceRotten == null) + graphicSourceRotten = pawnRenderer.rottingGraphic; + rottingGraphicPath = graphicSourceRotten.path; + + if (customPose != null) + rottingGraphicPath = rottingGraphicPath.Insert(Math.Max(rottingGraphicPath.LastIndexOf('/'), 0), "/CustomPose/" + customPose); + + if (!rottingGraphicPath.Contains(baseBodyString)) + { + if (graphicbaseBodyRotten == null) + { + if (ContentFinder.Get((rottingGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + //graphicSourceRotten = pawnRenderer.rottingGraphic; + Shader shader = pawnRenderer.rottingGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; + } + else if (customPose != null) + { + rottingGraphicPath = pawnRenderer.rottingGraphic.path; + if (ContentFinder.Get((rottingGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + graphicSourceRotten = pawnRenderer.rottingGraphic; + Shader shader = pawnRenderer.rottingGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + rottingGraphicPath + baseBodyStringWithSex + "_south"); + } + } + if (graphicbaseBodyRotten == null) + { + if (ContentFinder.Get((rottingGraphicPath + baseBodyString + "_south"), false) != null) + { + //graphicSourceRotten = pawnRenderer.rottingGraphic; + Shader shader = pawnRenderer.rottingGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyString, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; + } + else if (customPose != null) + { + rottingGraphicPath = pawnRenderer.rottingGraphic.path; + if (ContentFinder.Get((rottingGraphicPath + baseBodyString + "_south"), false) != null) + { + graphicSourceRotten = pawnRenderer.rottingGraphic; + Shader shader = pawnRenderer.rottingGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyString, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + rottingGraphicPath + baseBodyString + "_south"); + } + } + } + } + } + else + graphicbaseBodyRotten = pawnRenderer.rottingGraphic; + + } + + /* + //Try to find sized Body if it's valid + int offset = 9999; + int currentBreastSizeIndex = 0; + float currentBreastSeverity = 0; + bool validNakedTexture = false; + bool validRottingTexture = false; + Graphic nakedGraphic; + Graphic rottingGraphic; + while (offset < SizedApparelUtility.size.Length) + { + string breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, true, ref currentBreastSizeIndex, ref currentBreastSeverity); + //search bigger + //SizedApparelSettings.matchBodyTextureToMinimumApparelSize? currentBreastSizeIndex <= minSupportedBreasSizeIndex:true + if (validNakedTexture == false && nakedGraphicPath !=null) + { + if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= breastSeverityCapToDraw : true) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.nakedGraphic = nakedGraphic; + validNakedTexture = true; + } + } + } + if (validRottingTexture == false && rottingGraphicPath != null) + { + if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= breastSeverityCapToDraw : true) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.rottingGraphic = rottingGraphic; + validRottingTexture = true; + } + } + } + + //search smaller + + breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, false, ref currentBreastSizeIndex, ref currentBreastSeverity); + + if (validNakedTexture == false) + { + if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= breastSeverityCapToDraw : true) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.nakedGraphic = nakedGraphic; + validNakedTexture = true; + } + } + } + if (validRottingTexture == false) + { + if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= breastSeverityCapToDraw : true) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.rottingGraphic = rottingGraphic; + validRottingTexture = true; + } + } + } + + if (validNakedTexture == true && validRottingTexture == true) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + "'s body texture has changed."); + break; + } + + offset++; + } + */ + } + + //graphicBreasts = SizedApparelUtility.GetBodyPartGraphic(pawn, breastHediff, true, "Breasts", "Breasts"); + //if(graphicBreasts == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + // graphicBreasts = SizedApparelUtility.GetBodyPartGraphic(pawn, breastHediff, true, "Breasts", "Breasts", false, true, "Humanlike"); + string bodyPartPath = null; + + SizedApparelsDatabase.PathAndSize cachedPathAndSize; + + float breastSeverityCapped = breastSeverity; + if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip + breastSeverityCapped = Math.Min(BreastSeverityCache, breastSeverityCapped); + + string bodyTypeDefName = null; + if (pawn.story != null) + bodyTypeDefName = pawn.story.bodyType?.defName; + + if(breastHediff != null) + { + var breastvar = breastHediff.TryGetComp(); + + bodyPartBreasts.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(breastSeverityCapped), breastvar?.variation); + bodyPartBreasts.UpdateGraphic(); + + + } + + + + + + if (udderHediff != null) + { + var udderVar = udderHediff.TryGetComp(); + + bodyPartUdder.SetHediffData(udderHediff.def.defName, SizedApparelUtility.BreastSeverityInt(udderHediff.Severity), 1000, udderVar?.variation); + bodyPartUdder.UpdateGraphic(); + + } + else + bodyPartUdder.SetHediffData(null, -1); + + + + float bellySeverity = 0; + List pregnancies = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("pregnancy")); + if (!pregnancies.NullOrEmpty()) + { + foreach (Hediff h in pregnancies) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + } + /* + List eggs = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("egg")); + if (!eggs.NullOrEmpty()) + { + foreach (Hediff h in eggs) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + } + List mech = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("mech")); + if (!mech.NullOrEmpty()) + { + foreach (Hediff h in mech) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + } + List parasite = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("parasite")); + if (!parasite.NullOrEmpty()) + { + foreach (Hediff h in parasite) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + }*/ + + //Licentia Lab Hediff + if (SizedApparelPatch.LicentiaActive) + { + Hediff cumflation = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumflation")); + Hediff cumstuffed = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumstuffed")); + bellySeverity += cumflation != null ? cumflation.Severity : 0; + bellySeverity += cumstuffed != null ? cumstuffed.Severity : 0; + } + + if (bellySeverity >= 0) + { + //var bellyVar = breastHediff.TryGetComp(); + string BellyVar = null; + + bodyPartBelly.SetHediffData("BellyBulge", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity),1000, BellyVar); + bodyPartBelly.UpdateGraphic(); + /* + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "BellyBulge", "Belly", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity), false), false, "Belly", "BellyBulge"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicBelly = GraphicDatabase.Get(bodyPartPath); + } + else + graphicBelly = GraphicDatabase.Get(bodyPartPath); + }*/ + //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + //} + } + + + + //graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina"); + //if(graphicVagina == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + // graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", false, true,"Humanlike"); + if (vaginaHediff != null) + { + var vaginaVar = vaginaHediff.TryGetComp(); + bodyPartVagina.SetHediffData(vaginaHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity),1000, vaginaVar?.variation); + bodyPartVagina.UpdateGraphic(); + /* + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), false), false, "Vagina", "Vagina"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicVagina = GraphicDatabase.Get(bodyPartPath); + } + else + graphicVagina = GraphicDatabase.Get(bodyPartPath); + } + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + } + else + graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + }*/ + //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + //} + } + else + bodyPartVagina.SetHediffData(null, -1); + + //graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true); + //if(graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + // graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true, true, "Humanlike"); + /* + graphicPenises.Clear(); + graphicPenises_horny.Clear(); + graphicBallsOfPenises.Clear(); + */ + + //TODO: Optimize + bodyPartPenises.Clear(); + bodyPartBalls.Clear(); + if (penisHediffs != null) + { + + + for (int i = 0; i < penisHediffs.Count; i++) + { + Hediff penisHediff = penisHediffs[i]; + float offsetX = 0; // right and left + float offsetZ = 0; // up and down + float t = (i + 1f) / (penisHediffs.Count + 1); + offsetX = Mathf.Lerp(-0.05f, 0.05f, t); + offsetZ = Mathf.Lerp(-0.02f, 0.02f, t); + + if (penisHediff == null) + continue; + + var penisVar = penisHediff.TryGetComp(); + + SizedApparelBodyPart penis = new SizedApparelBodyPart(pawn, "Penis", SizedApparelBodyPartOf.Penis, "Penis", false, false); + penis.SetDepthOffsets(0.0108f, 0.0025f, 0.0108f, 0.0108f); + penis.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ)); + penis.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity),1000,penisVar?.variation); + penis.UpdateGraphic(); + bodyPartPenises.Add(penis); + + + SizedApparelBodyPart balls = new SizedApparelBodyPart(pawn, "Balls", SizedApparelBodyPartOf.Penis, "Penis", false, false, "Penis/Balls"); + balls.SetDepthOffsets(0.0096f, 0.0085f, 0.0096f, 0.0096f); + balls.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ)); + balls.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation); + balls.UpdateGraphic(); + bodyPartBalls.Add(balls); + + + /* + Graphic penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis"); + if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", false, true, "Humanlike"); + + Graphic penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true); + if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true, true, "Humanlike"); + */ + /* + Graphic penisGraphic = null; + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + penisGraphic = GraphicDatabase.Get(bodyPartPath); + } + else + penisGraphic = GraphicDatabase.Get(bodyPartPath); + } + //if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // penisGraphic = GraphicDatabase.Get(bodyPartPath); + //} + Graphic penisGraphicHorny = null; + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); + } + else + penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); + } + //if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); + //} + + //balls are no need horny graphic. it wiil share sametime + + //Graphic ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false); + //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + // ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false, true, "Humanlike"); + + + Graphic ballGraphic = null; + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + ballGraphic = GraphicDatabase.Get(bodyPartPath); + } + else + ballGraphic = GraphicDatabase.Get(bodyPartPath); + } + //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // ballGraphic = GraphicDatabase.Get(bodyPartPath); + //} + + + if (true)//penisGraphic != null + { + graphicPenises.Add(penisGraphic); + graphicPenises_horny.Add(penisGraphicHorny); + graphicBallsOfPenises.Add(ballGraphic); + } + */ + } + } + /* + graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus"); + if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", false, true, "Humanlike"); + + graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true); + if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true, true, "Humanlike"); + */ + if(anusHediff != null) + { + var anusVar = anusHediff.TryGetComp(); + + bodyPartAnus.SetHediffData(anusHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity),1000, anusVar?.variation); + bodyPartAnus.UpdateGraphic(); + + /* + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicAnus = GraphicDatabase.Get(bodyPartPath); + } + else + graphicAnus = GraphicDatabase.Get(bodyPartPath); + } + //if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicAnus = GraphicDatabase.Get(bodyPartPath); + //} + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); + } + else + graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); + } + //if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); + //}*/ + } + else + bodyPartAnus.SetHediffData(null, -1); + + + + hasGraphicUpdatedBefore = true; + } + + if(CheckApparel) + cachedApparelGraphicRecord = pawnRenderer.apparelGraphics.ToList(); + else + cachedApparelGraphicRecord = new List(); + + hasUpdateBeforeSuccess = true; + } + + + + + + //public bool hasUnsupportedApparel => Props.hasUnsupportedApparel; + //public bool hasUpdateBefore => Props.hasUpdateBefore; + /* + public void SetHasUnsupportedApparel(bool _hasUnsupportedApparel) + { + if(Props !=null) + Props.hasUnsupportedApparel = _hasUnsupportedApparel; + this.hasUnsupportedApparel = _hasUnsupportedApparel; + } + public void SetHasUpdateBefore(bool _hasUpdateBefore) + { + if (Props != null) + Props.hasUpdateBefore = _hasUpdateBefore; + this.hasUpdateBefore = _hasUpdateBefore; + }*/ + public IEnumerable GetAllSizedApparelBodyPart() // can return null bodyparts + { + yield return bodyPartBreasts; + yield return bodyPartNipple; + /* + foreach (SizedApparelBodyPart bp in bodyPartBreasts) + { + yield return bp; + } + foreach (SizedApparelBodyPart bp in bodyPartNipple) + { + yield return bp; + }*/ + foreach (SizedApparelBodyPart bp in bodyPartPenises) + { + yield return bp; + } + foreach (SizedApparelBodyPart bp in bodyPartBalls) + { + yield return bp; + } + yield return bodyPartVagina; + yield return bodyPartAnus; + yield return bodyPartBelly; + yield return bodyPartMuscleOverlay;//TODO + yield return bodyPartUdder; + yield return bodyPartPubicHair; //TODO + yield return bodyPartHips; + foreach (SizedApparelBodyPart bp in bodyPartThighs) + { + yield return bp; + } + foreach (SizedApparelBodyPart bp in bodyPartHands) + { + yield return bp; + } + foreach (SizedApparelBodyPart bp in bodyPartFeet) + { + yield return bp; + } + } + public IEnumerable GetSizedApparelBodyParts(SizedApparelBodyPartOf targetPartOf, bool returnNullPart = false) + { + foreach(SizedApparelBodyPart bp in GetAllSizedApparelBodyPart()) + { + if (bp == null) + { + if (returnNullPart) + yield return bp; + else + continue; + } + + + if (bp.bodyPartOf.IsPartOf(targetPartOf)) + yield return bp; + } + } + + public void SetPoseFromPoseSet(string poseSetName, bool autoUpdate = true, bool autoSetPawnGraphicDirty = false) + { + if (poseSetName == null) + { + ClearAllPose(autoUpdate, autoSetPawnGraphicDirty); + return; + } + + var poseSetDef = DefDatabase.GetNamed(poseSetName,false); + if (poseSetDef == null) + return; + if (poseSetDef.poses.NullOrEmpty()) + return; + foreach (SizedApparelPose pose in poseSetDef.poses) + { + var bodyParts = GetSizedApparelBodyParts(pose.targetBodyPart); + //if (bodyParts == null) + // continue; + if (bodyParts.EnumerableNullOrEmpty()) + continue; + foreach (SizedApparelBodyPart bp in bodyParts.ToList()) + { + if(bp != null) + bp.SetCustomPose(poseSetName, autoUpdate, autoSetPawnGraphicDirty); + } + } + } + public void ClearAllPose(bool autoUpdate = true, bool autoSetPawnGraphicDirty = false) + { + foreach (SizedApparelBodyPart bp in GetAllSizedApparelBodyPart()) + { + if(bp != null) + bp.SetCustomPose(null, autoUpdate, autoSetPawnGraphicDirty); + } + } + public void ClearPose(SizedApparelBodyPartOf targetPartOf , bool autoUpdate = true, bool autoSetPawnGraphicDirty = false) + { + foreach (SizedApparelBodyPart bp in GetSizedApparelBodyParts(targetPartOf)) + { + if(bp != null) + bp.SetCustomPose(null, autoUpdate, autoSetPawnGraphicDirty); + } + } + + } + [StaticConstructorOnStartup] + public class ApparelRecorderCompProperties : CompProperties + { + public bool hasUnsupportedApparel = false; + public bool hasUpdateBefore = false; + + public ApparelRecorderCompProperties() + { + this.compClass = typeof(ApparelRecorderComp); + } + public ApparelRecorderCompProperties(Type compClass) : base(compClass) + { + this.compClass = compClass; + } + + } +} diff --git a/1.3/source/SizedApparel/SizedApparelDubsApparelPatch.cs b/1.3/source/SizedApparel/SizedApparelDubsApparelPatch.cs new file mode 100644 index 0000000..8cc6e14 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelDubsApparelPatch.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; +using HarmonyLib; + +namespace SizedApparel +{ + public static class SizedApparelDubsApparelPatch + { + public static void indoorPostFixPatch(Pawn pawn) + { + PawnGraphicSet graphicSet = pawn.Drawer?.renderer?.graphics; + + if (graphicSet == null) + return; + var comp = pawn.TryGetComp(); + if (comp == null) + return; + comp.needToCheckApparelGraphicRecords = true; + } + + } +} diff --git a/1.3/source/SizedApparel/SizedApparelMain.cs b/1.3/source/SizedApparel/SizedApparelMain.cs new file mode 100644 index 0000000..3a5c770 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelMain.cs @@ -0,0 +1,2046 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using HarmonyLib; +using UnityEngine; +using rjw; +using System.Reflection; + + + +//since I test system alot, source cord is very dirty and not optimized. + +namespace SizedApparel +{ + public struct supportedIndex + { + + } + + + + [StaticConstructorOnStartup] + [HarmonyPatch(typeof(Pawn_HealthTracker), "Notify_HediffChanged")] + public class PawnHealthTrackerPatch + { + public static void Postfix(Hediff hediff, Pawn_HealthTracker __instance, ref Pawn ___pawn) + { + if (___pawn == null) + return; + var comp = ___pawn.TryGetComp(); + if (comp == null) + return; + if (hediff == null) + return; + + if (SizedApparelUtility.isRJWParts(hediff))/// + { + //comp.ClearAll(); + //comp.Update(); + comp.SetDirty(); + //already doing set dirty in hediffchange method. + //___pawn.Drawer.renderer.graphics.SetApparelGraphicsDirty(); + //PortraitsCache.SetDirty(___pawn); + //GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(___pawn); + return; + } + if (SizedApparelUtility.isBellyBulgeHediff(hediff)) + { + comp.SetDirty(); + return; + } + + } + } + + + + + + + [StaticConstructorOnStartup] + public class HeddifPatchForRimNudeWorld + { + //hediff.get_Severity() + public static void GetSeverityPostFix(Hediff __instance) + { + if (__instance.Part != null) + { + + if (__instance.Part.def.defName.Equals(SizedApparelUtility.chestString)) + { + if (__instance.def.defName.EndsWith(SizedApparelUtility.breastsString)) + { + //Log.Message("Found Breast Hediff"); + //_breastSeverity = __instance.Severity; + //_breastHediff = __instance; + //result = true; + //Log.Message(_breastSeverity.ToString()); + } + } + } + } + + //...get_severity() + /* + public static void BodyAddonHediffSeverityGraphicPatch(AlienRace.AlienPartGenerator.BodyAddonHediffSeverityGraphic __instance, ref float __result) + { + if (!SizedApparelPatch.rimNudeWorldActive) { return; } + if (!SizedApparelSettings.matchBreastToSupportedApparelSize) { return; } + if (__instance.path.Contains(SizedApparelUtility.breastsString)) + { + + } + }*/ + } + + + + + + [StaticConstructorOnStartup] + public class BodyPatch + { + public static void SetBodyGraphic(Pawn pawn,bool drawClothFlag = true, bool fromGraphicRecord = true, bool revert = false) + { + //Pawn_ApparelTracker __instance; + + + //GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); + //bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff); + ApparelRecorderComp comp = pawn.TryGetComp(); + if (comp == null) + return; + + if (revert) + { + var pawnRenderer = pawn.Drawer?.renderer?.graphics; + //Log.Message("useBodyTexture"); + + /* + if (!pawnRenderer.AllResolved) + { + pawnRenderer.ResolveAllGraphics(); + }*/ + + if (pawnRenderer == null) + return; + if (comp.graphicSourceNaked != null) + pawnRenderer.nakedGraphic = comp.graphicSourceNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); + if (comp.graphicSourceRotten != null) + pawnRenderer.rottingGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + } + + + if (!comp.hasUpdateBefore) + { + //comp.Update(true, fromGraphicRecord); + } + + float breastSeverity = comp.breastSeverity; + Hediff breastHediff = comp.breastHediff; + + + if (SizedApparelSettings.drawBodyParts == true && SizedApparelSettings.useBodyTexture)//old:SizedApparelSettings.useBodyTexture + { + //if (SizedApparelSettings.Debug) + // Log.Message("[Sized Apparel] Trying to change" + pawn.Name + "'s body texture."); + + var pawnRenderer = pawn.Drawer?.renderer?.graphics; + //Log.Message("useBodyTexture"); + + /* + if (!pawnRenderer.AllResolved) + { + pawnRenderer.ResolveAllGraphics(); + }*/ + + if (pawnRenderer == null) + return; + + string nakedGraphicPath = pawnRenderer.nakedGraphic?.path; + //Log.Message("nakedGraphicPath"); + string rottingGraphicPath = pawnRenderer.rottingGraphic?.path; + //Log.Message("rottingGraphicPath"); + int currentBreastSizeIndex = 0; + float currentBreastSeverity = 0; + Graphic nakedGraphic; + Graphic rottingGraphic; + bool validNakedTexture = false; + bool validRottingTexture = false; + int offset = 0; + + + /* + * Obsolete + if (SizedApparelSettings.DontReplaceBodyTextureOnNude == true && SizedApparelUtility.isPawnNaked(pawn)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + "is Naked. And DontReplaceBodyTextureOnNude Option is active. Changing Body Texture is cancled."); + return; + }*/ + if (!comp.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(pawn) || !drawClothFlag) + { + + if (comp.graphicbaseBodyNaked != null) + { + pawnRenderer.nakedGraphic = comp.graphicbaseBodyNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); + + } + if (comp.graphicbaseBodyRotten != null) + { + pawnRenderer.rottingGraphic = comp.graphicbaseBodyRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + + } + } + else + { + if (comp.graphicSourceNaked != null) + pawnRenderer.nakedGraphic = comp.graphicSourceNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); + if (comp.graphicSourceRotten != null) + pawnRenderer.rottingGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + } + + + return;//no need to replace full body texture anymore. + + if (false && comp.hasUnsupportedApparel && SizedApparelSettings.useUnsupportedBodyTexture)//old method. no need to do. + { + //Log.Message("hasUnsupportedApparel"); + // SetBodyGraphic(__instance, true); + if (true) + { + if ((ContentFinder.Get((nakedGraphicPath + "_UnsupportedApparel" + "_south"), false) != null)) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + "_Unsupported", pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.nakedGraphic = nakedGraphic; + } + if ((ContentFinder.Get((rottingGraphicPath + "_UnsupportedApparel" + "_south"), false) != null)) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + "_UnsupportedApparel", pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.rottingGraphic = rottingGraphic; + } + + } + } + else + { + if(!comp.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(pawn)) + { + + } + if (comp.graphicbaseBodyNaked!=null) + pawnRenderer.nakedGraphic = comp.graphicbaseBodyNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); + if (comp.graphicbaseBodyRotten != null) + pawnRenderer.rottingGraphic = comp.graphicbaseBodyRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + + return;//no need to replace full body texture anymore. + while (offset < SizedApparelUtility.size.Length) + { + string breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, true, ref currentBreastSizeIndex, ref currentBreastSeverity); + //search bigger + //SizedApparelSettings.matchBodyTextureToMinimumApparelSize? currentBreastSizeIndex <= minSupportedBreasSizeIndex:true + if (validNakedTexture == false) + { + if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.nakedGraphic = nakedGraphic; + validNakedTexture = true; + } + } + } + if (validRottingTexture == false) + { + if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.rottingGraphic = rottingGraphic; + validRottingTexture = true; + } + } + } + + //search smaller + + breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, false, ref currentBreastSizeIndex, ref currentBreastSeverity); + + if (validNakedTexture == false) + { + if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.nakedGraphic = nakedGraphic; + validNakedTexture = true; + } + } + } + if (validRottingTexture == false) + { + if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + pawnRenderer.rottingGraphic = rottingGraphic; + validRottingTexture = true; + } + } + } + + if (validNakedTexture == true && validRottingTexture == true) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + "'s body texture has changed."); + break; + } + + offset++; + } + + } + } + + + + return; + /* + if (SizedApparelSettings.useBodyTexture == false) + return; + + //Log.Message("Hello"); + if (pawnGraphicSet == null) + return; + + if (pawnGraphicSet.pawn.RaceProps.Humanlike == false) + return; + + return; + + + //Log.Message("SetBodyGraphic"); + //pawnGraphicSet.ClearCache(); + string path = pawnGraphicSet.pawn.story.bodyType.bodyNakedGraphicPath; + string path_bodyDessicated = pawnGraphicSet.pawn.story.bodyType.bodyDessicatedGraphicPath; + string filename; + string pathname; + string filename_bodyDessicated; + string pathname_bodyDessicated; + pathname = System.IO.Path.GetDirectoryName(path); + filename = System.IO.Path.GetFileName(path); + filename_bodyDessicated = System.IO.Path.GetFileName(path_bodyDessicated); + pathname_bodyDessicated = System.IO.Path.GetDirectoryName(path_bodyDessicated); + + //Log.Message("SetPath"); + bool validBody = false; + bool validDessicatedBody = false; + + //pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic + //pawnGraphicSet.pawn.Drawer.renderer.graphics.dessicatedGraphic + + if (hasUnsupportApparel) + { + //Log.Message("IfhasUnsupportApparel"); + //Graphic newBodyGraphic = null; + //Graphic newRottingGraphic = null; + //string path; + + //Log.Message("tryUnsupportedApparelBodyTexture"); + //OLD::pawnGraphicSet.pawn.Drawer.renderer.graphics + if (pawnGraphicSet.nakedGraphic != null) + if (ContentFinder.Get((pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null) + { + pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic = GraphicDatabase.Get(pawnGraphicSet.nakedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); + validBody = true; + } + if (pawnGraphicSet.dessicatedGraphic != null) + if (ContentFinder.Get((pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null) + { + pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get(pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.rottingGraphic.Shader, pawnGraphicSet.rottingGraphic.drawSize, pawnGraphicSet.rottingGraphic.color, pawnGraphicSet.rottingGraphic.colorTwo); + validDessicatedBody = true; + } + } + else + { + //Log.Message("undo"); + string currentPath = pawnGraphicSet.nakedGraphic.path; + string currentDessicatedPath = pawnGraphicSet.dessicatedGraphic.path; + //Log.Message(currentPath.Substring(0,currentPath.Length - "_UnsupportedApparel".Length)); + if (pawnGraphicSet.nakedGraphic != null) + if (ContentFinder.Get(currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null) + { + pawnGraphicSet.nakedGraphic = GraphicDatabase.Get((currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); + + } + if (pawnGraphicSet.dessicatedGraphic != null) + if (ContentFinder.Get(currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null) + { + pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get((currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); + + } + + }*/ + //pawnGraphicSet.ClearCache(); + } + + + + + + + private static void GetBreastSeverity(Pawn pawn, out float breastSeverity, out Hediff breastHediff) + { + throw new NotImplementedException(); + } + } + + + + + + + + + + //for worn apparel + + + + + + + + + + + //[HarmonyPatch(typeof(ApparelGraphicRecordGetter), "TryGetGraphicApparel")] + /* + [StaticConstructorOnStartup] + [HarmonyPatch(typeof(PawnGraphicSet), "ResolveAllGraphics")] + class BodyfixForUnsupported + { + static void Prefix(PawnGraphicSet __instance) + { + if (!UnityData.IsInMainThread) + return; + if (__instance.pawn == null) + return; + var comp = __instance.pawn.TryGetComp(); + if (comp == null) + return; + comp.ClearAll(); + //comp.Update(); + } + }*/ + + + /* +[StaticConstructorOnStartup] +[HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", typeof(PawnGenerationRequest) )] +class GeneratePawnPatch +{ + Type[] types = { typeof(PawnGenerationRequest) }; + static void Postfix(PawnGenerationRequest request, Pawn __result) + { + if (!UnityData.IsInMainThread) + return; + if (__result != null) + { + //__result.Drawer.renderer.graphics.ResolveAllGraphics(); + __result.Drawer.renderer.graphics.ResolveApparelGraphics(); + } + } +}*/ + [StaticConstructorOnStartup] + //[HarmonyPatch(typeof(Pawn_ApparelTracker), "ExposeData")] + class ApparelTrackerExposePatch + { + static void Postfix(Pawn_ApparelTracker __instance) + { + if (!UnityData.IsInMainThread) + { + return; + } + if (__instance.pawn == null) + return; + if (Scribe.mode == LoadSaveMode.PostLoadInit) + { + ApparelRecorderComp comp = __instance.pawn.TryGetComp(); + if (comp == null) + return; + if (!comp.hasUpdateBefore) + comp.Update(true, false); + } + + } + } + + + //[StaticConstructorOnStartup] + //[HarmonyPatch(typeof(Pawn_ApparelTracker), "Notify_ApparelChanged")] + //rimworld 1.2 => apparelChanged, rimworld 1.3 => apparelAdded, apparelRemoved + public class ApparelTrackerPatch + { + //Prefix + public static void Changed(Pawn_ApparelTracker __instance) + { + /* + if (Current.Game.World == null) + return; + */ + if (!UnityData.IsInMainThread) + { + return; + } + if (__instance.pawn == null) + return; + + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + __instance.pawn.Name + "'s apparels are changed. updating sizedApparels for it."); + + //GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); + //bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff); + ApparelRecorderComp comp = __instance.pawn.TryGetComp(); + if (comp != null) + { + //comp.ClearBreastCacheValue(); + //comp.ClearAll(); + //bool flag = false; + //SizedApparelUtility.GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); + //flag = SizedApparelUtility.hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff); + //flag = SizedApparelUtility.hasUnSupportedApparelFromWornData(__instance.pawn, breastSeverity, breastHediff); + //comp.hasUpdateBefore = true; + //comp.hasUnsupportedApparel = flag; + //comp.breastHediff = breastHediff; ; + //comp.breastSeverity = breastSeverity; + //comp.Update(true, false);//TODO: Coverd But No Graphic may cause Big Issue!!! + //comp.Update(true, true); + + comp.SetDirty(); + + /* + if (SizedApparelSettings.drawBodyParts)//old:SizedApparelSettings.useBodyTexture + BodyPatch.SetBodyGraphic(__instance.pawn); + */ + /* + //Log.Message(comp.testbool.ToString()); + //Log.Message("ApparelChanged"); + //comp.hasUnsupportedApparel = flag; + //comp.hasUpdateBefore = true; + //comp.SetHasUnsupportedApparel(flag); + //comp.SetHasUpdateBefore(true); + //if (__instance.pawn.Drawer.renderer.graphics != null) + + + LongEventHandler.ExecuteWhenFinished(delegate + { + SetBodyGraphic(__instance.pawn.Drawer.renderer.graphics, flag); + } + ); + */ + + } + + } + } + [StaticConstructorOnStartup] + //[HarmonyPatch(typeof(PawnGraphicSet), "SetApparelGraphicsDirty")] + class SetApparelGraphicsDirtyPatch + { + public static bool Prefix(PawnGraphicSet __instance) + { + if (SizedApparelSettings.useBodyTexture) + { + //__instance.SetAllGraphicsDirty(); + //return false; + } + return true; + } + } + + //TODO + [StaticConstructorOnStartup] + //[HarmonyPatch(typeof(PawnGraphicSet), "get_apparelGraphics")] + class PrivatePartsPatch + { + public static void Postfix(PawnGraphicSet __instance, ref List __result) + { + var resualtCach = __result; + + if (SizedApparelSettings.drawBodyParts) + { + var privateParts = new List(); + if (SizedApparelSettings.drawPenis) + { + + } + if (SizedApparelSettings.drawVagina) + { + + } + if (SizedApparelSettings.drawHips) + { + + } + if (SizedApparelSettings.drawHips) + { + + } + if (SizedApparelSettings.drawAnus) + { + + } + } + } + } + + + + //[HarmonyPatch(typeof(PawnGraphicSet), "MatsBodyBaseAt")] + public class MatBodyBaseAtPatch + { + public static void Postfix(PawnGraphicSet __instance, Rot4 facing, RotDrawMode bodyCondition, bool drawClothes, List __result) + { + if (__result == null) + return; + int num = facing.AsInt + 1000 * (int)bodyCondition; + List copy; + copy = __result.ListFullCopy(); + for (int i = 0; i<__result.Count; i++) + { + //SizedApparelsDatabase.GetSupportedApparelOriginalPath(__result[i].g) + } + } + + } + + [StaticConstructorOnStartup] + [HarmonyPatch(typeof(ApparelGraphicRecordGetter), "TryGetGraphicApparel")] + [HarmonyBefore(new string[]{"QualityOfBuilding"})] + public class GetApparelGraphicFix + { + public static void Postfix(Apparel apparel, BodyTypeDef bodyType, ref ApparelGraphicRecord rec, ref bool __result) + { + if (__result == false) + return; + + if (apparel == null) + return; + + if (bodyType == null) + return; + + + if (apparel.Wearer != null) + { + //rec = new ApparelGraphicRecord(null, null); + var comp = apparel.Wearer.TryGetComp(); + + //if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize) + // BreastSeverity = comp.BreastSeverityCache; + int currentBreastSizeIndex = 0; + float currentBreastSeverity = -1; + //int minSupportedBreastSizeIndex = 1000; + //float minSupportedBreastSeverity = 1000; + + //SizedApparelUtility.GetBreastSeverity(apparel.Wearer, out BreastSeverity, out breastHediff); + if (comp != null) + { + + if (comp.hasUpdateBefore == false) + { + //SizedApparelUtility.GetBreastSeverity(apparel.Wearer, out BreastSeverity, out breastHediff); + //comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(apparel.Wearer, BreastSeverity, breastHediff); + //comp.breastSeverity = BreastSeverity; + //comp.breastHediff = breastHediff; + //comp.hasUpdateBefore = true; + //comp.Update(true,false); + } + if (comp.isDirty == true) + { + //return; + //comp.ClearAll(); + //comp.Update(true, false); + } + /* + if (comp.needToCheckApparelGraphicRecords) + { + TODO; + if (comp.isApparelGraphicRecordChanged()) + comp.Update(true, false); + + }*/ + if (comp.needToCheckApparelGraphicRecords) + { + /* + if (comp.isApparelGraphicRecordChanged()) + { + //return; + //comp.Update(true, true); //1.3 + //SizedApparelUtility.UpdateAllApparel(___pawn, true); + }*/ + } + + var breastHediff = comp.breastHediff; + float BreastSeverity = comp.breastSeverity; + + + if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip + BreastSeverity = Math.Min(comp.BreastSeverityCache, BreastSeverity); + + if (comp.hasUnsupportedApparel == false && (comp.bodyPartBreasts.bodyPartGraphic !=null || comp.bodyPartBreasts.bodyPartGraphicHorny != null))//(comp.graphicBreasts!=null|| comp.graphicBreasts_horny != null) + { + Graphic sizedGraphic = null; + + 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); + sizedGraphic = GraphicDatabase.Get(resultPath, rec.graphic.Shader, rec.graphic.drawSize, rec.graphic.color, rec.graphic.colorTwo); + } + + + + if(sizedGraphic != null) + rec = new ApparelGraphicRecord(sizedGraphic, rec.sourceApparel); + + //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + //comp.breastSeverityCapToDraw = Math.Min(comp.breastSeverityCapToDraw, minSupportedBreastSeverity); + } + } + + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[Sized Apparel] " + apparel.Wearer.Name + " doesn't have SizedApparel Compoenet!!"); + + } + } + } + } + + [StaticConstructorOnStartup] + [HarmonyPatch(typeof(PawnGraphicSet), "ClearCache")] + class GraphicSetClearFix + { + public static void Postfix(PawnGraphicSet __instance) + { + if (__instance.pawn == null) + { + return; + } + var comp = __instance.pawn.TryGetComp(); + if (comp == null) + return; + //comp.ClearAll(false); + //comp.needToCheckApparelGraphicRecords = true; + comp.SetDirty(); + } + } + + + + + + + //[HarmonyPatch(typeof(PawnGraphicSet))] + //[HarmonyPatch("ResolveApparelGraphics")] + //[HarmonyBefore(new string[] { "rimworld.erdelf.alien_race.main" })] + [StaticConstructorOnStartup] + //[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")] + class ApparelFix + { + [Obsolete] + public static bool old_old_Prefix(Apparel apparel, BodyTypeDef bodyType, ApparelGraphicRecord rec, ref bool __result) + { + + bool result = true; + bool flag = apparel.def.apparel.wornGraphicPath.NullOrEmpty(); + if (flag) + { + string text = apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName + "_3"; + + bool flag2 = false; + + flag2 = ContentFinder.Get(text + "_north", true) == null || ContentFinder.Get(text + "_east", true) == null || ContentFinder.Get(text + "_south", true) == null; + if (flag2) + { + bool flag3 = apparel.def.apparel.LastLayer != ApparelLayerDefOf.Overhead; + if (flag3) + { + //text = apparel.def.apparel.wornGraphicPath + "_Female"; + Graphic graphic = GraphicDatabase.Get(text, ShaderDatabase.Cutout, apparel.def.graphicData.drawSize, apparel.DrawColor); + rec = new ApparelGraphicRecord(graphic, apparel); + result = false; + __result = true; + } + } + else + { + bool flag4 = apparel.def.apparel.LastLayer == ApparelLayerDefOf.Overhead; + if (flag4) + { + Graphic graphic2 = GraphicDatabase.Get(text, ShaderDatabase.Cutout, apparel.def.graphicData.drawSize, apparel.DrawColor); + rec = new ApparelGraphicRecord(graphic2, apparel); + result = false; + __result = true; + } + } + } + return result; + } + + [Obsolete] + static void old_Postfix(ref PawnGraphicSet __instance) + { + if (Current.Game.World == null) + return; + + // Log.Message("ResolveGraphic"); + if (__instance.pawn.RaceProps.Humanlike) + { + //Log.Message("ResolveApparelGraphics"); + //__instance.pawn.health.hediffSet.HasHediff(Hediff ,BodyPartRecord ,false); + //__instance.pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null, null).Any((BodyPartRecord bpr) => bpr.untranslatedCustomLabel == label || bpr.def.defName == label); + + var comp = __instance.pawn.TryGetComp(); + if (comp != null) + { + bool flag = false; + float BreastSeverity = -1; + Hediff breastHediff = null; + SizedApparelUtility.GetBreastSeverity(__instance.pawn, out BreastSeverity, out breastHediff); + //Log.Message("hasUnsupported? : "+comp.hasUnsupportedApparel.ToString()); + + if (true) //(!comp.hasUpdateBefore) + { + //Log.Message("UpdateFirst"); + /* + if (comp.havingSex) + comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparel(__instance.pawn, BreastSeverity, breastHediff); + else + comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(__instance.pawn, BreastSeverity, breastHediff); + */ + comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(__instance.pawn, BreastSeverity, breastHediff); + comp.hasUpdateBefore = true; + } + if (comp.hasUnsupportedApparel == false) + { + int currentBreastSizeIndex = 0; + int minSupportedBreastSizeIndex = 1000; + float currentBreastSeverity = 0; + float minSupportedBreastSeverity = 1000; + List newAgr = new List(); + foreach (ApparelGraphicRecord agr in __instance.apparelGraphics)//ApparelGraphicRecord agr in curAgr + { + /* + if(apparel != null) + { + ApparelGraphicRecord rec; + if (apparel.def.apparel.wornGraphicPath.NullOrEmpty()) + { + rec = new ApparelGraphicRecord(null, null); + newAgr.Add(rec); + continue; + } + string path; + if (apparel.def.apparel.LastLayer == ApparelLayerDefOf.Overhead || apparel.def.apparel.wornGraphicPath == BaseContent.PlaceholderImagePath) + { + path = apparel.def.apparel.wornGraphicPath; + } + else + { + path = apparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; + } + Shader shader = ShaderDatabase.Cutout; + if (apparel.def.apparel.useWornGraphicMask) + { + shader = ShaderDatabase.CutoutComplex; + } + Graphic graphic = GraphicDatabase.Get(path, shader, apparel.def.graphicData.drawSize, apparel.DrawColor); + rec = new ApparelGraphicRecord(graphic, apparel); + //string endstring = (gender == Gender.Female && (ContentFinder.Get(apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName + "_fem_south", false) != null)) ? "_fem" : null; + //string path = (apparel.def.apparel.LastLayer != ApparelLayerDefOf.Overhead) ? (apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName + endstring) : apparel.def.apparel.wornGraphicPath; + //path = agr.sourceApparel.def.graphic.path; + + //var path = agr.graphic.path; + var ExtraPath = path; + string targetPath; + } + */ + + + string path; + string extraPath; + //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; + path = agr.graphic.path; + if (breastHediff != null) + { + extraPath = path + "_" + breastHediff.def.defName; + + } + else + extraPath = path; + + + int offset = 0; + + + bool validTexture = false; + Graphic graphic = null; + bool findBigger = true; // if false : search smaller first + while (offset < SizedApparelUtility.size.Length) + { + if (breastHediff != null) + { + if (ContentFinder.Get((extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null) // checking special texture like udder + { + minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + graphic = new Graphic(); + graphic = GraphicDatabase.Get(extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Found"); + break; + } + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Not Found."); + } + + if ((ContentFinder.Get((path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null)) + { + minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + graphic = GraphicDatabase.Get(path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Found"); + break; + } + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture."); + offset++; + + } + + if (validTexture == false) + { + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger ."); + } + + + if (validTexture == false) + { + offset = 0; + while (offset < SizedApparelUtility.size.Length) + { + if (breastHediff != null) + { + if (ContentFinder.Get((extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null) // checking special texture like udder + { + minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + graphic = new Graphic(); + graphic = GraphicDatabase.Get(extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Found"); + break; + } + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); + } + + if ((ContentFinder.Get((path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null)) + { + minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + graphic = GraphicDatabase.Get(path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + break; + } + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture."); + offset++; + } + } + + if (validTexture == false) + { + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger ."); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //graphic = GraphicDatabase.Get(path, ShaderDatabase.Cutout, agr.graphic.drawSize, agr.graphic.color); + graphic = agr.graphic; + } + + + ApparelGraphicRecord _Agr = new ApparelGraphicRecord(graphic, agr.sourceApparel); + + //_Agr.sourceApparel. + newAgr.Add(_Agr); + + + } + __instance.apparelGraphics = newAgr; + comp.breastSeverityCapToDraw = minSupportedBreastSeverity; + + if (SizedApparelSettings.useBodyTexture == true) + { + //Log.Message("useBodyTexture"); + if (__instance.nakedGraphic == null || __instance.rottingGraphic == null) + { + __instance.ResolveAllGraphics(); + return; + } + string nakedGraphicPath = __instance.nakedGraphic.path; + //Log.Message("nakedGraphicPath"); + string rottingGraphicPath = __instance.rottingGraphic.path; + //Log.Message("rottingGraphicPath"); + + Graphic nakedGraphic; + Graphic rottingGraphic; + bool validNakedTexture = false; + bool validRottingTexture = false; + int offset = 0; + if (SizedApparelSettings.DontReplaceBodyTextureOnNude == true && SizedApparelUtility.isPawnNaked(__instance.pawn)) + return; + if (comp.hasUnsupportedApparel && SizedApparelSettings.useUnsupportedBodyTexture) + { + //Log.Message("hasUnsupportedApparel"); + // SetBodyGraphic(__instance, true); + if (true) + { + if ((ContentFinder.Get((nakedGraphicPath + "_UnsupportedApparel" + "_south"), false) != null)) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + "_Unsupported", __instance.nakedGraphic.Shader, __instance.nakedGraphic.drawSize, __instance.nakedGraphic.color, __instance.nakedGraphic.colorTwo, __instance.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + __instance.nakedGraphic = nakedGraphic; + } + if ((ContentFinder.Get((rottingGraphicPath + "_UnsupportedApparel" + "_south"), false) != null)) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + "_UnsupportedApparel", __instance.rottingGraphic.Shader, __instance.rottingGraphic.drawSize, __instance.rottingGraphic.color, __instance.rottingGraphic.colorTwo, __instance.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + __instance.rottingGraphic = rottingGraphic; + } + + } + } + else + { + while (offset < SizedApparelUtility.size.Length) + { + string breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, true, ref currentBreastSizeIndex, ref currentBreastSeverity); + //search bigger + //SizedApparelSettings.matchBodyTextureToMinimumApparelSize? currentBreastSizeIndex <= minSupportedBreasSizeIndex:true + if (validNakedTexture == false) + { + if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, __instance.nakedGraphic.Shader, __instance.nakedGraphic.drawSize, __instance.nakedGraphic.color, __instance.nakedGraphic.colorTwo, __instance.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + __instance.nakedGraphic = nakedGraphic; + validNakedTexture = true; + } + } + } + if (validRottingTexture == false) + { + if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, __instance.rottingGraphic.Shader, __instance.rottingGraphic.drawSize, __instance.rottingGraphic.color, __instance.rottingGraphic.colorTwo, __instance.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + __instance.rottingGraphic = rottingGraphic; + validRottingTexture = true; + } + } + } + + //search smaller + + breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, false, ref currentBreastSizeIndex, ref currentBreastSeverity); + + if (validNakedTexture == false) + { + if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true) + { + nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, __instance.nakedGraphic.Shader, __instance.nakedGraphic.drawSize, __instance.nakedGraphic.color, __instance.nakedGraphic.colorTwo, __instance.nakedGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + __instance.nakedGraphic = nakedGraphic; + validNakedTexture = true; + } + } + } + if (validRottingTexture == false) + { + if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) + { + if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true) + { + rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, __instance.rottingGraphic.Shader, __instance.rottingGraphic.drawSize, __instance.rottingGraphic.color, __instance.rottingGraphic.colorTwo, __instance.rottingGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + __instance.rottingGraphic = rottingGraphic; + validRottingTexture = true; + } + } + } + + if (validNakedTexture == true && validRottingTexture == true) + break; + + offset++; + } + } + + + + } + } + //SetBodyGraphic(__instance, comp.hasUnsupportedApparel); + } + + + } + + return; + } + + /* + static void Prefix(ref PawnGraphicSet __instance) + { + if (!UnityData.IsInMainThread) + return; + if (__instance.pawn == null) + return; + var comp = __instance.pawn.TryGetComp(); + if (comp == null) + return; + comp.ClearAll(); + comp.Update(); + }*/ + + static void oldPostfix(ref PawnGraphicSet __instance) + { + if (!UnityData.IsInMainThread) + return; + if (false&&SizedApparelSettings.useBodyTexture)//TODO + { + BodyPatch.SetBodyGraphic(__instance.pawn); + } + } + + } + + + + + //[HarmonyPatch(typeof(PawnGraphicSet), "MatsBodyBaseAt")] + public class PawnGraphicSetPatch + { + public static void Postfix(ref List __result, ref PawnGraphicSet __instance, Rot4 facing, RotDrawMode bodyCondition) + { + + } + } + + //TODO: Patch After RJW (Sexualize_GenerateNewPawnInternal) or just postfix to Sexualize + [HarmonyPatch(typeof(PawnGenerator), "GenerateNewPawnInternal")] + public class PawnGeneratorPatch + { + + } + + [HarmonyPatch(typeof(Corpse), "RotStageChanged")] + public class RotStagePatch + { + public static void Prefix(CompRottable __instance) + { + var comp = __instance.parent.TryGetComp(); + if (comp == null) + return; + comp.SetDirty(); + } + } + + //Should I Patch this? + //[HarmonyPatch(typeof(Pawn_AgeTracker), "RecalculateLifeStageIndex")] + public class AgePatch + { + public static void Postfix(Pawn_AgeTracker __instance, Pawn ___pawn) + { + var comp = ___pawn.TryGetComp(); + if (comp == null) + return; + comp.CheckAgeChanged(); + } + } + + + + //Styling Station patch..? wip + //[HarmonyPatch(typeof(PawnGraphicSet), "MatsBodyBaseAt")] + public class BodyMatPatch + { + public static void Postfix(PawnGraphicSet __instance, RotDrawMode bodyCondition, Rot4 facing, ref List __result, bool drawClothes) + { + List loc = new List(); + + if (bodyCondition == RotDrawMode.Dessicated) + { + return; + } + + for (int i = 0; i< __result.Count; i++) + { + if (bodyCondition == RotDrawMode.Fresh) + { + if (__result[i] == __instance.nakedGraphic.MatAt(facing, null)) + { + + continue; + } + + } + else if (bodyCondition == RotDrawMode.Rotting || __instance.dessicatedGraphic == null) + { + if (__result[i] == __instance.rottingGraphic.MatAt(facing, null)) + { + + + continue; + } + } + + if (drawClothes) + { + + + } + + + loc.Add(__result[i]); + } + + } + } + //RimWorld 1.3 + [HarmonyPatch(typeof(PawnRenderer), "BaseHeadOffsetAt")] + public class BaseHeadOffsetAtPatch + { + public static void Postfix(ref PawnRenderer __instance, Pawn ___pawn, Rot4 rotation, ref Vector3 __result) + { + ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + if (apparelRecorder == null) + return; + if (apparelRecorder.customPose != null) + { + var item = apparelRecorder.currentCustomPose.headOffset.FirstOrDefault(b => b.bodyType == ___pawn.story.bodyType.label); + __result += item.offsets.GetOffset(rotation); + } + } + } + + //RimWorld 1.3 + [HarmonyPatch(typeof(PawnRenderer), "DrawPawnBody")] + public class DrawPawnBodyPatch + { + static MethodInfo overrideMatMethod = AccessTools.Method(typeof(PawnRenderer), "OverrideMaterialIfNeeded"); + + + public static void Prefix(ref PawnRenderer __instance, Pawn ___pawn, PawnRenderFlags flags) + { + if (!SizedApparelSettings.drawBodyParts) + return; + if (___pawn == null) + return; + ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + if (apparelRecorder == null) + return; + //!flags.FlagSet(PawnRenderFlags.StylingStation)&& + bool flag = false; + //if (apparelRecorder.needToCheckApparelGraphicRecords && apparelRecorder.isApparelGraphicRecordChanged()) + /* + if (apparelRecorder.isApparelGraphicRecordChanged()) + { + flag = true; + } + */ + + if (false && flags.FlagSet(PawnRenderFlags.StylingStation))//TODO...? + { + //apparelRecorder.isDirty is allways true + + if (false)//StylingStation Doesn't work with cache! patch in postfix + { + apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes)); + //Log.Message(" [Sized Apparel]StylingStation:: isDirty? : " + apparelRecorder.isDirty); + if(flags.FlagSet(PawnRenderFlags.Clothes)) + SizedApparelUtility.UpdateAllApparel(___pawn, true); + } + + + } + else + { + if ((!apparelRecorder.hasUpdateBefore || apparelRecorder.isDirty)) + { + if (SizedApparelSettings.Debug) + Log.Message("[SizedApparel] trying to draw " + ___pawn.Name + " with unupdated component or SetDirty! Updating it."); + //apparelRecorder.ClearAll(); + //Todo. Async Update? + apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes)); + SizedApparelUtility.UpdateAllApparel(___pawn,true); + } + if (flag) + { + //apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes)); + //apparelRecorder.Update(true, true); 1.3 + //SizedApparelUtility.UpdateAllApparel(___pawn, true); + } + } + if (SizedApparelSettings.drawBodyParts) + BodyPatch.SetBodyGraphic(___pawn, flags.FlagSet(PawnRenderFlags.Clothes), false); + else + BodyPatch.SetBodyGraphic(___pawn, flags.FlagSet(PawnRenderFlags.Clothes), false, false); + } + + public static void Postfix(ref PawnRenderer __instance, Vector3 rootLoc, float angle, Rot4 facing, RotDrawMode bodyDrawType, PawnRenderFlags flags, Pawn ___pawn, Mesh bodyMesh) + { + if (___pawn == null) + return; + ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + if (apparelRecorder == null) + return; + Quaternion quaternion = Quaternion.AngleAxis(angle, Vector3.up); + + if (bodyMesh == null) + return; + + Quaternion quat = Quaternion.AngleAxis(angle, Vector3.up); + + + string defName = __instance.graphics.pawn.def.defName; + + Shader shader = ___pawn.Drawer.renderer.graphics.nakedGraphic.Shader; + Color skinColor = Color.white; + Color skinColor2 = Color.white; + if (bodyDrawType == RotDrawMode.Fresh) + { + shader = ___pawn.Drawer.renderer.graphics.nakedGraphic.Shader; + if (!ShaderUtility.SupportsMaskTex(shader)) + shader = ShaderDatabase.CutoutSkinOverlay; + skinColor = ___pawn.Drawer.renderer.graphics.nakedGraphic.Color; + skinColor2 = ___pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo; + } + else if(bodyDrawType == RotDrawMode.Rotting) + { + shader = ___pawn.Drawer.renderer.graphics.rottingGraphic.Shader; + if (!ShaderUtility.SupportsMaskTex(shader)) + shader = ShaderDatabase.CutoutSkinOverlay; + skinColor = ___pawn.Drawer.renderer.graphics.rottingGraphic.Color; + skinColor2 = ___pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo; + } + + + + if (flags.FlagSet(PawnRenderFlags.StylingStation))//Styling station doesn't affect to real pawn data. so cannot cache to component. + { + + + } + + //breasts are only rendered when all of worn apparels are supported or nude. + if (apparelRecorder.isDrawAge && (!flags.FlagSet(PawnRenderFlags.Clothes) || !apparelRecorder.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(___pawn))) //TODO : Move it to CanDraw + { + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawVagina && SizedApparelUtility.CanDrawVagina(___pawn, flags)) + { + if(apparelRecorder.bodyPartVagina != null) + apparelRecorder.bodyPartVagina.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + /* + //Draw Vagina. AllwaysDraw + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0100f;//not sure what to do + else + vector.y += 0.0088f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicVagina_horny; + if (graphic == null) + graphic = apparelRecorder.graphicVagina; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawAnus && SizedApparelUtility.CanDrawAnus(___pawn, flags)) + { + if (apparelRecorder.bodyPartAnus != null) + apparelRecorder.bodyPartAnus.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + /* + //Draw Anus. //Allways draw + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0105f;//not sure what to do + else + vector.y += 0.0093f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicAnus_horny; + if (graphic == null) + graphic = apparelRecorder.graphicAnus; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBelly && SizedApparelUtility.CanDrawBelly(___pawn, flags)) + { + if (apparelRecorder.bodyPartBelly != null) + apparelRecorder.bodyPartBelly.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + /* + //Draw Belly. Need Complex Hiding Calculation + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0002f;//not sure what to do + else + vector.y += 0.0098f; + Graphic graphic = apparelRecorder.graphicBelly; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawUdder && SizedApparelUtility.CanDrawUdder(___pawn, flags)) + { + if (apparelRecorder.bodyPartUdder != null) + apparelRecorder.bodyPartUdder.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + //Draw Udder. Need Complex Hiding Calculation -> + /* + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0015f;//not sure what to do + else + vector.y += 0.0088f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicUdder_horny; + if (graphic == null) + graphic = apparelRecorder.graphicUdder; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBreasts && SizedApparelUtility.CanDrawBreasts(___pawn, flags) && (SizedApparelSettings.drawSizedApparelBreastsOnlyWorn ? !SizedApparelUtility.isPawnNaked(___pawn, flags) : true)) + { + if (apparelRecorder.bodyPartBreasts != null) + apparelRecorder.bodyPartBreasts.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + + //Log.Message("DrawBreasts for " + ___pawn.Name); + //if (SizedApparelSettings.Debug) + // Log.Message("trying to draw breasts"); + //Draw Breasts. Allways draw + + /* + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.001f;//not sure what to do + else + vector.y += 0.0113f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicBreasts_horny; + if (graphic == null) + graphic = apparelRecorder.graphicBreasts; + + + + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + } + else + { + //Log.Warning("[SizedApparel] Missing Breasts Graphic for: " + ___pawn.Name); + + } + */ + + } + + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawPenis && SizedApparelUtility.CanDrawPenis(___pawn, flags, true)) + { + foreach(SizedApparelBodyPart b in apparelRecorder.bodyPartBalls) + { + b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + } + foreach (SizedApparelBodyPart b in apparelRecorder.bodyPartPenises) + { + b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + } + /* + //Render Penis And Balls + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0025f; + else + vector.y += 0.0108f; + + float offsetX = 0; // right and left + float offsetZ = 0; // up and down + + if(apparelRecorder.graphicPenises != null && apparelRecorder.graphicBallsOfPenises != null) + { + for (int i = 0; i < apparelRecorder.graphicPenises.Count; i++) + { + float t = (i + 1f) / (apparelRecorder.graphicPenises.Count + 1); + offsetX = Mathf.Lerp(-0.1f, 0.1f, t); + offsetZ = Mathf.Lerp(-0.05f, 0.05f, t); + + Graphic penisGraphic = null; + Graphic ballGraphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + { + penisGraphic = apparelRecorder.graphicPenises_horny[i]; + } + if (penisGraphic == null) + penisGraphic = apparelRecorder.graphicPenises[i]; + ballGraphic = apparelRecorder.graphicBallsOfPenises[i];//Balls Doesn't support HornyVariation + if (ballGraphic != null && (SizedApparelSettings.hideBallOfFuta ? Genital_Helper.is_futa(___pawn) : true)) + { + Material mat; + //TODO: vector2.y + Vector3 vector2 = vector; + if (facing == Rot4.North) + vector2.y += 0.0060f; + else + vector2.y -= 0.0012f; + if (facing == Rot4.North || facing == Rot4.South) + vector2.x += offsetX; + else + vector2.x += offsetX * 0.5f; + + if (facing == Rot4.East) + vector2.z += offsetZ; + if (facing == Rot4.West) + vector2.z -= offsetZ; + + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + ballGraphic = ballGraphic.GetColoredVersion(ballGraphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + ballGraphic = ballGraphic.GetColoredVersion(shader, skinColor, skinColor2); + vector2.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + } + if (penisGraphic != null) + { + Material mat; + Vector3 vector2 = vector; + if (facing == Rot4.North || facing == Rot4.South) + vector2.x += offsetX; + else + vector2.x += offsetX * 0.5f; + + if (facing == Rot4.East) + vector2.z += offsetZ; + if (facing == Rot4.West) + vector2.z -= offsetZ; + + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + penisGraphic = penisGraphic.GetColoredVersion(penisGraphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + penisGraphic = penisGraphic.GetColoredVersion(shader, skinColor, skinColor2); + //TODO: vector2.y + vector2.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + } + } + }*/ + + }//Draw BodyParts + + //Draw Modular Apparel Parts + if (flags.FlagSet(PawnRenderFlags.Clothes)) + { + + } + + + + } + + + } + } + //TODO + [HarmonyPatch(typeof(PawnRenderer), "BaseHeadOffsetAt")] + public class HeadOffsetPatch + { + + public static void Postfix(PawnRenderer __instance, Pawn ___pawn, Rot4 rotation, ref Vector3 __result) + { + var comp = ___pawn.TryGetComp(); + if (comp == null) + return; + } + + } + + + + [Obsolete] + public class DrawPawnPatch + { + public static void TryDrawBodyPart(ref PawnRenderer __instance,Graphic graphic,Graphic hornyGraphic, Vector3 rootLoc, Vector3 drawOffset, float angle, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible) + { + + } + + + + public static void RenderPawnInternalPrefix(ref PawnRenderer __instance, Vector3 rootLoc, float angle, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible, Pawn ___pawn) + { + if (!__instance.graphics.AllResolved) + { + __instance.graphics.ResolveAllGraphics(); + } + + if (!SizedApparelSettings.drawBodyParts) + return; + if (___pawn == null) + return; + ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + if (apparelRecorder == null) + return; + if (!apparelRecorder.hasUpdateBefore || apparelRecorder.isDirty) + { + if (SizedApparelSettings.Debug) + Log.Message("[SizedApparel] trying to draw " + ___pawn.Name + " with unupdated component! Updating it."); + apparelRecorder.Update(true,false); + SizedApparelUtility.UpdateAllApparel(___pawn); + } + if (apparelRecorder.needToCheckApparelGraphicRecords) + { + if(apparelRecorder.isApparelGraphicRecordChanged()) + { + //apparelRecorder.Update(true, true); //1.3 + //SizedApparelUtility.UpdateAllApparel(___pawn, true); + } + + } + if (renderBody) + { + BodyPatch.SetBodyGraphic(___pawn,true, false); + } + } + + //Draw Private parts + public static void RenderPawnInternalPostfix(ref PawnRenderer __instance, Vector3 rootLoc, float angle, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible, Pawn ___pawn) + { + + + if (___pawn == null) + return; + ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + if (apparelRecorder == null) + return; + Quaternion quaternion = Quaternion.AngleAxis(angle, Vector3.up); + Mesh mesh = null; + + if (!SizedApparelSettings.drawBodyParts) + { + /* + if (SizedApparelPatch.rimNudeWorldActive && SizedApparelSettings.drawSizedApparelBreastsOnlyWorn && !SizedApparelUtility.isPawnNaked(___pawn)) + { + //TODO + + if (__instance.graphics == null) + return; + if (bodyDrawType == RotDrawMode.Dessicated) //don't draw on skeletone + return; + + if (___pawn.RaceProps.Humanlike)//this.pawn.RaceProps.Humanlike + { + mesh = MeshPool.humanlikeBodySet.MeshAt(bodyFacing); + } + else + { + mesh = __instance.graphics.nakedGraphic.MeshAt(bodyFacing); + } + string defName = __instance.graphics.pawn.def.defName; + + + Vector3 loc = rootLoc; + loc.y += 0.009183673f; + + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector.y += 0.001f;//not sure what to do + else + vector.y += 0.012f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicBreasts_horny; + if (graphic == null) + graphic = apparelRecorder.graphicBreasts; + if (graphic != null) + { + Material breastMat = graphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(breastMat) : breastMat; + breastMat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, breastMat, portrait); + } + } + */ + return; + + } + + if (renderBody) + { + if (__instance.graphics == null) + return; + if (bodyDrawType == RotDrawMode.Dessicated) //don't draw on skeletone + return; + + if (___pawn.RaceProps.Humanlike)//this.pawn.RaceProps.Humanlike + { + mesh = MeshPool.humanlikeBodySet.MeshAt(bodyFacing); + } + else + { + mesh = __instance.graphics.nakedGraphic.MeshAt(bodyFacing); + } + string defName = __instance.graphics.pawn.def.defName; + + + Vector3 loc = rootLoc; + loc.y += 0.009183673f; + + + //breasts are only rendered when all of worn apparels are supported or nude. + if (!apparelRecorder.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(___pawn)) //TODO : Move it to CanDraw + { + //string bodyPartPath = "SizedApparel/BodyParts"; + //string breastsPath; + + //Hediff breastHediff = apparelRecorder.breastHediff; + + //float breastHediffSeverityCap = apparelRecorder.breastSeverityCapToDraw; + //string breastName = breastHediff.def.defName;//Todo + //breastsPath = "SizedApparel/BodyParts/Breasts/Human/testBodyPart_Female"; + /* + if ((ContentFinder.Get((breastsPath + "_south"), false) != null)) + { + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector = vector; + else + vector.y += 0.0092f; + Graphic bodyPartGraphic = GraphicDatabase.Get(breastsPath, ShaderDatabase.Cutout); + Material bodyPartMat = bodyPartGraphic.MatAt(bodyFacing, null); + //bodyPartMat = __instance.OverrideMaterialIfNeeded_NewTemp(bodyPartMat, __instance.pawn, portrait);//private function and values //for damage mat or somthing more + Material baseMat = (!portrait && pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(bodyPartMat) : bodyPartMat; + bodyPartMat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, bodyPartMat, portrait); + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[Sized Apparel] Missing Breast Tesxture: " + breastsPath); + //breastName = "Breasts"; + } + */ + if(SizedApparelSettings.drawBreasts && (SizedApparelSettings.drawSizedApparelBreastsOnlyWorn ? !SizedApparelUtility.isPawnNaked(___pawn): true)) + { + //Log.Message("DrawBreasts for " + ___pawn.Name); + //if (SizedApparelSettings.Debug) + // Log.Message("trying to draw breasts"); + //Draw Breasts. Allways draw + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector.y += 0.001f;//not sure what to do + else + vector.y += 0.012f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicBreasts_horny; + if(graphic == null) + graphic = apparelRecorder.graphicBreasts; + + /* + if(graphic == null) + { + apparelRecorder.Update(); + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicBreasts_horny; + if (graphic == null) + graphic = apparelRecorder.graphicBreasts; + }*/ + + + if (graphic != null) + { + Material mat = graphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat; + mat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait); + } + else + { + //Log.Warning("[SizedApparel] Missing Breasts Graphic for: " + ___pawn.Name); + + } + + + } + if(SizedApparelSettings.drawVagina && SizedApparelUtility.CanDrawVagina(___pawn)) + { + //Draw Vagina. AllwaysDraw + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector.y += 0.0100f;//not sure what to do + else + vector.y += 0.0100f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicVagina_horny; + if (graphic == null) + graphic = apparelRecorder.graphicVagina; + if (graphic != null) + { + Material mat = graphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat; + mat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait); + } + } + if(SizedApparelSettings.drawAnus && SizedApparelUtility.CanDrawAnus(___pawn)) + { + //Draw Anus. //Allways draw + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector.y += 0.0105f;//not sure what to do + else + vector.y += 0.010f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicAnus_horny; + if (graphic == null) + graphic = apparelRecorder.graphicAnus; + if (graphic != null) + { + Material mat = graphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat; + mat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait); + } + } + if (SizedApparelSettings.drawUdder && SizedApparelUtility.CanDrawUdder(___pawn)) + { + //Draw Udder. Need Complex Hiding Calculation -> + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector.y += 0.0015f;//not sure what to do + else + vector.y += 0.0095f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = apparelRecorder.graphicUdder_horny; + if (graphic == null) + graphic = apparelRecorder.graphicUdder; + if (graphic != null) + { + Material mat = graphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat; + mat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait); + } + } + if(SizedApparelSettings.drawBelly && SizedApparelUtility.CanDrawBelly(___pawn)) + { + //Draw Belly. Need Complex Hiding Calculation + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector.y += 0.0002f;//not sure what to do + else + vector.y += 0.0105f; + Graphic graphic = apparelRecorder.graphicBelly; + if (graphic != null) + { + Material mat = graphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat; + mat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait); + } + } + + //Rimworld 1.2 doesn't have PawnRenderFlags! + if (SizedApparelSettings.drawPenis && SizedApparelUtility.CanDrawPenis(___pawn,PawnRenderFlags.None, false)) + { + //Render Penis And Balls + Vector3 vector = rootLoc; + if (bodyFacing == Rot4.North) + vector.y += 0.0025f; + else + vector.y += 0.015f; + + float offsetX = 0; + + for (int i = 0; i < apparelRecorder.graphicPenises.Count; i++) + { + float t = (i + 1f) / (apparelRecorder.graphicPenises.Count + 1); + offsetX = Mathf.Lerp(-0.1f, 0.1f, t); + + + Graphic penisGraphic = null; + Graphic ballGraphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + { + penisGraphic = apparelRecorder.graphicPenises_horny[i]; + } + if (penisGraphic == null) + penisGraphic = apparelRecorder.graphicPenises[i]; + ballGraphic = apparelRecorder.graphicBallsOfPenises[i];//Balls Doesn't support HornyVariation + if (penisGraphic != null) + { + //TODO: vector2.y + Vector3 vector2 = vector; + vector2.x += offsetX; + Material mat = penisGraphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat; + mat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector2, quaternion, mat, portrait); + } + if (SizedApparelSettings.hideBallOfFuta) + if (Genital_Helper.is_futa(___pawn)) + continue;//skip rendering ball + if (ballGraphic != null) + { + //TODO: vector2.y + Vector3 vector2 = vector; + if (bodyFacing == Rot4.North) + vector2.y += 0.0080f; + else + vector2.y -= 0.002f; + vector2.x += offsetX; + Material mat = ballGraphic.MatAt(bodyFacing, null); + Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat; + mat = __instance.graphics.flasher.GetDamagedMat(baseMat); + GenDraw.DrawMeshNowOrLater(mesh, vector2, quaternion, mat, portrait); + } + } + } + + } + + } + } + } +} + + diff --git a/1.3/source/SizedApparel/SizedApparelPoseSet.cs b/1.3/source/SizedApparel/SizedApparelPoseSet.cs new file mode 100644 index 0000000..ff7eb81 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelPoseSet.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using RimWorld; +using HarmonyLib; +using UnityEngine; + +namespace SizedApparel +{ + /* + [HarmonyPatch(typeof(PawnRenderer), "BaseHeadOffsetAt")] + [HarmonyAfter(new string[] + { + "rimworld.erdelf.alien_race.main" + })] + */ + //TODO + public static class PawnRenderer_BaseHeadOffsetAt_Patch_For_Pose + { + [HarmonyPostfix] + public static void BaseHeadOffsetAtPostfix_Post(PawnRenderer __instance, Rot4 rotation, ref Vector3 __result, ref Pawn ___pawn) + { + return; + + /* + var comp = ___pawn.TryGetComp(); + + if (comp == null) + return; + if (comp.customPose == null) + return; + + SizedApparelPoseDef poseDef = DefDatabase.GetNamed(comp.customPose); + if (poseDef == null) + return; + + Rot4Offsets? headOffset = new Rot4Offsets(); + + string bodyType = ___pawn.story?.bodyType?.defName; + if (bodyType == null) + { + bodyType = "default"; + headOffset = poseDef.headOffset.FirstOrDefault(b => b.bodyType.ToLower() == "default" | b.bodyType.ToLower() == "null").offsets; + } + else + { + headOffset = poseDef.headOffset.FirstOrDefault(b => b.bodyType.ToLower() == bodyType.ToLower()).offsets; + } + + if (headOffset == null) + return; + */ + + + //headOffset. + + //TODO: Mesh Based Scaled Offset + //__result = __result + headOffset; + + + + return; + } + } + public class SizedApparelPoseSetDef : Def + { + + public List poses; + + } + + + public class SizedApparelPose + { + //public string poseName; use defName as PoseName + public SizedApparelBodyPartOf targetBodyPart = SizedApparelBodyPartOf.Torso; + public List headOffset; + + } + +} diff --git a/1.3/source/SizedApparel/SizedApparelPubicHair.cs b/1.3/source/SizedApparel/SizedApparelPubicHair.cs new file mode 100644 index 0000000..38a8ec3 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelPubicHair.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; +using HarmonyLib; +using UnityEngine; +using rjw; + +namespace SizedApparel +{ + [HarmonyPatch(typeof(PawnGraphicSet), "CalculateHairMats")] + public static class CalculateHairMatsPatch + { + + } + + public abstract class PubicHairDef : StyleItemDef + { + + } + + class SizedApparelPubicHair + { + } + + + public static class IdeoStyleTackerPatch + { + + } +} diff --git a/1.3/source/SizedApparel/SizedApparelRJWPatch.cs b/1.3/source/SizedApparel/SizedApparelRJWPatch.cs new file mode 100644 index 0000000..bc1aecf --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelRJWPatch.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using HarmonyLib; +using UnityEngine; +using rjw; + +namespace SizedApparel +{ + + //sexualize_pawn patch + class SexualizePawnPatch + { + static void Postfix(Pawn pawn) + { + if (!UnityData.IsInMainThread) + return; + ApparelRecorderComp comp = pawn?.TryGetComp(); + if (comp == null) + return; + comp.SetDirty(); + /* + comp.ClearAll(); + var graphicSet = pawn.Drawer?.renderer?.graphics; + if (graphicSet != null) + { + pawn.Drawer.renderer.graphics.ResolveAllGraphics(); + //pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); + BodyPatch.SetBodyGraphic(pawn); + }*/ + + /* + float breastSeverity = comp.breastSeverity; + Hediff breastHediff = comp.breastHediff; + SizedApparelUtility.GetBreastSeverity(pawn, out breastSeverity, out breastHediff); + SizedApparelUtility.hasUnSupportedApparelFromWornData(pawn, breastSeverity, breastHediff, true); + comp.hasUpdateBefore = true;*/ + + } + } + //since Sized Apparel Logic Changed, it doesn't need to do job patch for rjw. + [Obsolete] + [StaticConstructorOnStartup] + //[HarmonyPatch(typeof(SexUtility), "DrawNude")] + class DrawNudePatch + { + static void Prefix(Pawn pawn, bool keep_hat_on) + { + + if (!UnityData.IsInMainThread) + return; + + //Log.Message("Hello"); + if (RJWPreferenceSettings.sex_wear == RJWPreferenceSettings.Clothing.Clothed) + { + + } + else + { + //SetBodyGraphic(pawn.Drawer.renderer.graphics, false); + } + } + static void OldPostfix(Pawn pawn) + { + if (pawn == null) + return; + //GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); + //bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff); + ApparelRecorderComp comp = pawn.TryGetComp(); + if (comp != null) + { + /* + LongEventHandler.ExecuteWhenFinished(delegate + { + float breastSeverity; + Hediff breastHediff; + bool flag = false; + GetBreastSeverity(pawn, out breastSeverity, out breastHediff); + flag = hasUnSupportedApparel(pawn, breastSeverity, breastHediff); + if (!comp.hasUpdateBefore) + comp.SetHasUpdateBefore(true); + comp.SetHasUnsupportedApparel(flag); + } + ); + */ + + //Log.Message("CheckApparel"); + if (!comp.hasUpdateBefore) + comp.hasUpdateBefore = true; + if (!comp.hasUpdateForSex) + { + comp.hasUpdateForSex = true; + float breastSeverity; + Hediff breastHediff; + bool flag = false; + SizedApparelUtility.GetBreastSeverity(pawn, out breastSeverity, out breastHediff); + //Log.Message("GetServerity"); + //flag = SizedApparelUtility.hasUnSupportedApparel(pawn, breastSeverity, breastHediff); + flag = SizedApparelUtility.hasUnSupportedApparelFromWornData(pawn, breastSeverity, breastHediff); + comp.hasUnsupportedApparel = flag; + } + + //Log.Message("SetFlag"); + /* + //Log.Message(comp.testbool.ToString()); + //Log.Message("ApparelChanged"); + //comp.hasUnsupportedApparel = flag; + //comp.hasUpdateBefore = true; + //comp.SetHasUnsupportedApparel(flag); + //comp.SetHasUpdateBefore(true); + //if (__instance.pawn.Drawer.renderer.graphics != null) + + + LongEventHandler.ExecuteWhenFinished(delegate + { + SetBodyGraphic(__instance.pawn.Drawer.renderer.graphics, flag); + } + ); + */ + + } + + } + public void todoPostfix(Pawn pawn) + { + if (pawn == null) + return; + ApparelRecorderComp comp = pawn.TryGetComp(); + if (comp == null) + return; + comp.SetDirty(); + } + } + + [Obsolete] + [StaticConstructorOnStartup] + //[HarmonyPatch(typeof(JobDriver_SexBaseInitiator), "Start")] + class SexStartPatch + { + static void Postfix(JobDriver_SexBaseInitiator __instance) + { + //Log.Warning("SexStart"); + + + + ApparelRecorderComp pawnARC = __instance.pawn.TryGetComp(); + if (pawnARC != null) + { + if (__instance.pawn.RaceProps.Humanlike) + { + pawnARC.havingSex = true; + pawnARC.hasUpdateForSex = false; + __instance.pawn.Drawer.renderer.graphics.SetApparelGraphicsDirty(); + } + } + if (__instance.Partner == null) + return; + var partner = __instance.Partner as Pawn; + if (partner == null) + return; + ApparelRecorderComp partnerARC = partner.TryGetComp(); + if (partnerARC != null) + { + if (partner.RaceProps.Humanlike) + { + partnerARC.havingSex = true; + pawnARC.hasUpdateForSex = false; + partner.Drawer.renderer.graphics.SetApparelGraphicsDirty(); + } + } + } + } + [Obsolete] + [StaticConstructorOnStartup] + //[HarmonyPatch(typeof(JobDriver_SexBaseInitiator), "End")] + class SexEndPatch + { + static void Postfix(JobDriver_SexBaseInitiator __instance) + { + + + ApparelRecorderComp pawnARC = __instance.pawn.TryGetComp(); + + if (pawnARC != null) + { + pawnARC.havingSex = false; + pawnARC.hasUpdateForSex = false; + pawnARC.hasUpdateBefore = false; + float breastSeverity; + Hediff breastHediff; + bool flag = true; + if (__instance.pawn.RaceProps.Humanlike) + { + SizedApparelUtility.GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); + //Log.Message("GetServerity"); + flag = SizedApparelUtility.hasUnSupportedApparelFromWornData(__instance.pawn, breastSeverity, breastHediff); + pawnARC.hasUnsupportedApparel = flag; + PortraitsCache.SetDirty(__instance.pawn); + __instance.pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); + } + pawnARC.hasUnsupportedApparel = flag; + } + + if (__instance.Partner == null) + return; + var partner = __instance.Partner as Pawn; + if (partner == null) + return; + ApparelRecorderComp partnerARC = partner.TryGetComp(); + if (partnerARC != null) + { + partnerARC.havingSex = false; + partnerARC.hasUpdateForSex = false; + partnerARC.hasUpdateBefore = false; + float breastSeverity; + Hediff breastHediff; + bool flag = true; + + if (partner.RaceProps.Humanlike) + { + SizedApparelUtility.GetBreastSeverity(partner, out breastSeverity, out breastHediff); + //Log.Message("GetServerity"); + flag = SizedApparelUtility.hasUnSupportedApparelFromWornData(partner, breastSeverity, breastHediff); + partnerARC.hasUnsupportedApparel = flag; + partner.Drawer.renderer.graphics.ResolveApparelGraphics(); + PortraitsCache.SetDirty(partner); + } + partnerARC.hasUnsupportedApparel = flag; + + } + + + } + + } + +} diff --git a/1.3/source/SizedApparel/SizedApparelRNWPatch.cs b/1.3/source/SizedApparel/SizedApparelRNWPatch.cs new file mode 100644 index 0000000..3971a36 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelRNWPatch.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using HarmonyLib; +//using AlienRace; +using UnityEngine; +using rjw; + + + + +namespace SizedApparel +{ + + //[HarmonyPatch(typeof(RimNudeWorld.GenitalPatch), "Postfix")] + [StaticConstructorOnStartup] + public class SizedApparelRNWPatch + { + static bool Prefix(Pawn pawn) + { + if (pawn == null) + return false; + + return true; + } + + } + + + public class RevealingApparelPatch + { + static void Postfix( Pawn pawn, ref bool __result) + { + if (__result == false) + return; + var comp = pawn.TryGetComp(); + if (comp == null) + return; + if (comp.hasUnsupportedApparel) + return; + if(pawn.apparel.WornApparel != null) + { + if(pawn.apparel.WornApparel.Any((Apparel ap) =>( ap.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_IgnorBreastSize".ToLower())))) + __result = false; + } + return; + } + } + + +} diff --git a/1.3/source/SizedApparel/SizedApparelSettingcs.cs b/1.3/source/SizedApparel/SizedApparelSettingcs.cs new file mode 100644 index 0000000..d2a4b07 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelSettingcs.cs @@ -0,0 +1,743 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Unity; +using UnityEngine; +using Verse; + +namespace SizedApparel +{ + //include Human, set humanlike's custom setting + //Only few settings are allow in ModSetting. other needs to be set in Def (xml) file + + public class AlienRaceSetting : IExposable + { + public string raceName = null; + public bool overrideDef = false; + public bool asHumanlike = true; + public float drawMinAge = -1; //pawn's Biological age. -1 to ignore. + + public AlienRaceSetting(string raceName) + { + this.raceName = raceName; + } + public AlienRaceSetting() + { + + } + + public void ExposeData() + { + Scribe_Values.Look(ref raceName, "raceName", null); + Scribe_Values.Look(ref overrideDef, "overrideDef", false); + Scribe_Values.Look(ref asHumanlike, "asHumanlike", true); + Scribe_Values.Look(ref drawMinAge, "drawMinAge", -1); + } + + //public int ageYoung = -1; //use receDefName_young folder. -1 to ignore + //public int ageOld = -1; //use raceDefName_old folder. -1 to ignore. + } + + + public class SizedApparelSettings : ModSettings + { + public static bool Debug = false; + public static bool DetailLog = false; + public static bool autoClearCacheOnWriteSetting = true; + + public static bool useBodyTexture = true;//for user who not use rimnudeworld + + public static bool useGenderSpecificTexture = true; + + public static bool matchBodyTextureToMinimumApparelSize = true;//for avoiding breasts cliping + + public static bool useBreastSizeCapForApparels = true; + + public static bool DontReplaceBodyTextureOnNude = true; + //public static bool DontReplaceBodyTextureOnUnsupported = true; + + + + //TODO: Standalone render bodyparts. + public static bool drawBodyParts = true;//for user who not use rimnudeworld + public static bool drawBreasts = true; + public static bool drawPenis = true; + public static bool drawVagina = true; + public static bool drawMuscleOverlay = true; + public static bool drawHips = true;//TODO + public static bool drawAnus = true; + public static bool drawBelly = false;//TODO + public static bool drawUdder = false;//TODO + public static bool hideBallOfFuta = false; + public static bool hidePenisOfMale = false; + public static bool matchBreastToSupportedApparelSize = true;//for avoiding breasts cliping + + public static bool useBodyPartsVariation = true; + public static bool showBodyPartsVariation = true; + + public static bool autoJiggleBreasts = true; + + //RimNudeWorld + public static bool drawSizedApparelBreastsOnlyWorn = false; + public static bool hideRimNudeWorldBreasts = false;//disable rimnudeworld breasts. + + [Obsolete] + public static bool useUnsupportedBodyTexture = true;//bodytexture when wearing unsupported apparel. + public static bool useSafeJobBreasts = true; + + public static bool changeBodyType; + public static bool fatToFemale; + public static bool hulkToThin; + + public static bool onlyForFemale = true; + public static bool useRandomSize = true;//for user who play without rimjobworld + public static float randomSizeMin = 0.01f; + public static float randomSizeMax = 1.01f; + + //Lagacy Variable + public static bool useTitanic = true; + public static bool useColossal = true; + public static bool useGargantuan = true; + public static bool useMassive = true; + public static bool useEnormous = true; + public static bool useHuge = true; + public static bool useLarge = true; + public static bool useAverage = true; + public static bool useSmall = true; + public static bool useTiny = true; + public static bool useNipples = true; + + + + //Alien Race Settings + [Obsolete] + public static bool UnsupportedRaceToUseHumanlike = false; + public static List alienRaces = new List(); + public static List alienRacesAllowHumanlikTextures = new List(); //This Value Will be Saved and loaded + public static string alienRaceSearch = ""; + public static Vector2 alienRacesListScrollPos; + public static List alienRaceSettings = new List(); + + //Force All Apparel as supported + public static bool ForcedSupportApparel = false; + + + + public static bool getUseSettingFromIndex(int target) + { + if (target < 0) + return false; + else if (target == 0) + return useNipples; + else if (target == 1) + return useTiny; + else if (target == 2) + return useSmall; + else if (target == 3) + return useAverage; + else if (target == 4) + return useLarge; + else if (target == 5) + return useHuge; + else if (target == 6) + return useEnormous; + else if (target == 7) + return useMassive; + else if (target == 8) + return useGargantuan; + else if (target == 9) + return useColossal; + else if (target == 10) + return useTitanic; + else + return false; + } + + + + + public static bool useUnderBreasts = true; + public static float UnderBreastsOffset = -0.0013f; + + public override void ExposeData() + { + + Scribe_Values.Look(ref Debug, "Debug", false); + Scribe_Values.Look(ref DetailLog, "DetailLog", false); + Scribe_Values.Look(ref autoClearCacheOnWriteSetting, "autoClearCacheOnWriteSetting", true); + + //force to use it. this is important thing. + //Scribe_Values.Look(ref useBreastSizeCapForApparels, "useBreastSizeCapForApparels", true); + + Scribe_Values.Look(ref useBodyTexture, "useBodyTexture", true); + Scribe_Values.Look(ref useGenderSpecificTexture, "useGenderSpecificTexture", true); + + Scribe_Values.Look(ref matchBodyTextureToMinimumApparelSize, "matchBodyTextureToMinimumApparelSize", true); + Scribe_Values.Look(ref matchBreastToSupportedApparelSize, "matchBreastToSupportedApparelSize", true); + + //Unsurpported to forced Surpported + //Scribe_Values.Look(ref UnsupportedRaceToUseHumanlike, "UnsupportedRaceToUseHumanlike", false); + Scribe_Values.Look(ref ForcedSupportApparel, "ForcedSupportApparel", false); + + + Scribe_Collections.Look(ref alienRaceSettings, "alienSettings", LookMode.Deep); + if (Scribe.mode == LoadSaveMode.LoadingVars) + { + if (alienRaceSettings == null) + { + alienRaceSettings = new List(); + } + } + if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs) + { + if(!alienRaceSettings.NullOrEmpty()) + alienRaceSettings.RemoveAll((AlienRaceSetting x) => string.IsNullOrEmpty(x.raceName)); + } + + Scribe_Values.Look(ref useUnsupportedBodyTexture, "useUnsupportedBodyTexture", true); + Scribe_Values.Look(ref DontReplaceBodyTextureOnNude, "DontReplaceBodyTextureOnNude", false); + + Scribe_Values.Look(ref hideRimNudeWorldBreasts, "hideRimNudeWorldBreasts", false); + Scribe_Values.Look(ref useSafeJobBreasts, "useSafeJobBreasts", true); + + Scribe_Values.Look(ref useRandomSize, "useRandomSize", true); + Scribe_Values.Look(ref randomSizeMin, "randomSizeMin", 0.01f); + Scribe_Values.Look(ref randomSizeMax, "randomSizeMax", 1.01f); + + Scribe_Values.Look(ref drawBodyParts, "drawBodyParts", true); + Scribe_Values.Look(ref useBodyPartsVariation, "useBodyPartsVariation", true); // forse true for now. TODO + Scribe_Values.Look(ref showBodyPartsVariation, "showBodyPartsVariation", true); + + Scribe_Values.Look(ref drawMuscleOverlay, "drawMuscleOverlay", true); + Scribe_Values.Look(ref drawBreasts, "drawBreasts", true); + Scribe_Values.Look(ref drawSizedApparelBreastsOnlyWorn, "drawSizedApparelBreastsOnlyWorn", false); + Scribe_Values.Look(ref drawPenis, "drawPenis", true); + Scribe_Values.Look(ref drawVagina, "drawVagina", true); + Scribe_Values.Look(ref drawAnus, "drawAnus", true); + Scribe_Values.Look(ref drawUdder, "drawUdder", true); + Scribe_Values.Look(ref drawBelly, "drawBelly", true); + + + //force to draw all size type + /* + Scribe_Values.Look(ref useTitanic, "useTitanic", true); + Scribe_Values.Look(ref useColossal, "useColossal", true); + Scribe_Values.Look(ref useGargantuan, "useGargantuan", true); + Scribe_Values.Look(ref useMassive, "useMassive", true); + Scribe_Values.Look(ref useEnormous, "useEnormous", true); + Scribe_Values.Look(ref useHuge, "useHuge", true); + Scribe_Values.Look(ref useLarge, "useLarge", true); + Scribe_Values.Look(ref useAverage, "useAverage", true); + Scribe_Values.Look(ref useSmall, "useSmall", true); + Scribe_Values.Look(ref useTiny, "useTiny", true); + Scribe_Values.Look(ref useNipples, "useNipples", true); + */ + + Scribe_Values.Look(ref useUnderBreasts, "useUnderBreasts",true); + Scribe_Values.Look(ref UnderBreastsOffset, "UnderBreastsOffset", -0.0013f); + + //TODO: Humanlike Setting Per Race + //Scribe_Values.Look(ref alienRacesAllowHumanlikTextures, "alienRacesAllowHumanlikTextures"); + + base.ExposeData(); + } + + } + + public class SizedApparelMod : Mod + { + + SizedApparelSettings settings; + private static Vector2 ScrollPos = Vector2.zero; + private static List alienDefList = new List(); // to load aliens and compare with modsetting + + public override void WriteSettings() + { + base.WriteSettings(); + if(SizedApparelSettings.autoClearCacheOnWriteSetting) + ClearCache(); + } + + public static void CheckAndLoadAlienRaces() + { + if(alienDefList == null) + alienDefList = new List(); + if (alienDefList.Count == 0) + { + IEnumerable HumanlikeRaces; + HumanlikeRaces = DefDatabase.AllDefs.Where(b => b.race?.Humanlike == true); + + foreach (ThingDef raceDef in HumanlikeRaces) + { + //Default Value Is True + alienDefList.Add(raceDef.defName); + } + } + } + + public static void ClearCache(bool clearPawnGraphicSet = true) + { + SizedApparelsDatabase.ClearAll(); + if (Find.CurrentMap != null) + { + foreach (Pawn pawn in Find.CurrentMap.mapPawns.AllPawns) + { + if (pawn == null) + continue; + var comp = pawn.TryGetComp(); + if (comp != null) + comp.SetDirty(clearPawnGraphicSet); + } + } + } + + public SizedApparelMod(ModContentPack content) : base(content) + { + this.settings = GetSettings(); + } + + public override void DoSettingsWindowContents(Rect inRect) + { + + const float alienRaceSettingHeight = 120; + + CheckAndLoadAlienRaces(); + Listing_Standard listingStandard = new Listing_Standard(); + //Rect rect = new Rect(0f, 0f, inRect.width, 950); + //Rect rect = inRect.ExpandedBy(0.9f); + Rect leftRect = new Rect(inRect.position, new Vector2(inRect.width / 2, inRect.height)); + Rect rightRect = new Rect(inRect.position + new Vector2(inRect.width / 2,0), new Vector2(inRect.width / 2, inRect.height)); + //rect.xMax *= 0.9f; + //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)); + listingStandard.Begin(leftRect); + listingStandard.maxOneColumn = true; + + listingStandard.CheckboxLabeled("Debug Log", ref SizedApparelSettings.Debug, "Debug logs.\nDefault: false"); + if (SizedApparelSettings.Debug) + { + listingStandard.CheckboxLabeled("Debug Log (Detail)", ref SizedApparelSettings.DetailLog, "Debug logs for checking missing textures.\nDefault: false"); + + } + listingStandard.GapLine(1f); + listingStandard.CheckboxLabeled("Auto Clear Cache On Close Setting", ref SizedApparelSettings.autoClearCacheOnWriteSetting, "Auto clear cache data to apply Setting.\nDefault: true"); + if(SizedApparelSettings.autoClearCacheOnWriteSetting == false) + { + listingStandard.Label("If you changed options, try Clear Cache to apply. Some options may need to restart"); + if (listingStandard.ButtonTextLabeled("Clear Cache", "Press If you changed Option."))//\n do not push unless you really need. \n if this button still not work. reload savefile. if still not work, reload rimworld" + { + ClearCache(); + } + } + + listingStandard.Gap(); + + + listingStandard.Gap(8); + listingStandard.GapLine(5f); + /* + listingStandard.Label("Optimization",-1,""); + //listingStandard.CheckboxLabeled("Debug Log", ref SizedApparelSettings.Debug, "Debug logs.\nDefault: false"); + listingStandard.Gap(8); + listingStandard.Label("no more optimization setting yet.\n It's hardly optimized already :)", -1, ""); + listingStandard.GapLine(5f); + */ + //listingStandard.CheckboxLabeled("Use Breast Size Cap from Apparels(recommended: true)", ref SizedApparelSettings.useBreastSizeCapForApparels, "unite breast size from apparels. Smallest value will be used.\nIf you change this option, you need to redress Pawn\nDefault: true"); + + + //listingStandard.BeginScrollView(rect, ref ScrollPos, ref rect); + //listingStandard.Label("Body(Torso)Texture Option", -1, ""); + //listingStandard.CheckboxLabeled("use Body (Torso) Texture", ref SizedApparelSettings.useBodyTexture, "change body texture if the pawn is wearing supported apparels only.\nIt may override bodytexture you use.\nIf you use rimnudeworld, don't use this option.\nDefault: false"); + //if (SizedApparelSettings.useBodyTexture == true) + //{ + // listingStandard.CheckboxLabeled(" use unsupportedApparel Body Texture", ref SizedApparelSettings.useUnsupportedBodyTexture, "Use \"_UnsupportedApparel\" Body Texture when pawn is wearing unsupported apparel.\nIf this option is false, the body will be default texture.\nDefault: true"); + // listingStandard.CheckboxLabeled(" Match BodyTexture To Minimum ApparelSize", ref SizedApparelSettings.matchBodyTextureToMinimumApparelSize, "Avoid Clipping When breasts bigger than supported sized apparel.\nDefault: true"); + // + //} + listingStandard.Gap(8); + listingStandard.Label("Other Mod Compatibility"); + + listingStandard.Gap(8); + listingStandard.GapLine(5f); + listingStandard.CheckboxLabeled(" Forced compatibility of unsupported apparel", ref SizedApparelSettings.ForcedSupportApparel, "It may have clipping issue.\nDefault: false"); + + + /* + if(SizedApparelPatch.DubsApparelTweaksActive == true) + { + listingStandard.Label(" Dubs Apparel Tweaks Patched! (may not work in 1.3)"); + listingStandard.Gap(8); + }*/ + + //sizeList.EndScrollView(ref rect); + //listingStandard.EndSection(sizeList); + //listingStandard.EndScrollView(ref sizeScrollRect); + listingStandard.Label("Non RimJobWorld Compatibility (wip)", -1, "User Who play without RimJobWorld"); + if (!SizedApparelPatch.RJWActive) + { + if (SizedApparelPatch.SJWActive) + { + listingStandard.Label(" SafeJobWorld is Actived ", -1, ""); + listingStandard.CheckboxLabeled(" use SafeJobWorld's Breasts(Hidden to player but it exist)", ref SizedApparelSettings.useSafeJobBreasts, "use BreastsSize from SJW.\nDefault: true"); + + } + if(SizedApparelPatch.SJWActive? SizedApparelSettings.useSafeJobBreasts==false : true) + { + listingStandard.CheckboxLabeled(" use Random Breasts Size(not yet work)", ref SizedApparelSettings.useRandomSize, "use breasts random size for pawn.\nDefault: true"); + listingStandard.Label(" random Size Min: " + SizedApparelSettings.UnderBreastsOffset.ToString(), -1, "Defualt: 0.01"); + SizedApparelSettings.randomSizeMin = listingStandard.Slider(SizedApparelSettings.randomSizeMin, 0f, 2f); + listingStandard.Label(" random Size Max: " + SizedApparelSettings.UnderBreastsOffset.ToString(), -1, "Defualt: 1.00"); + SizedApparelSettings.randomSizeMax = listingStandard.Slider(SizedApparelSettings.randomSizeMax, SizedApparelSettings.randomSizeMin, 2f); + + } + if (SizedApparelPatch.SJWActive == false) + { + + + } + } + else + { + listingStandard.Label(" RimJobWorld is Actived ", -1, ""); + } + + listingStandard.Gap(12); + listingStandard.Label("AlienRace Compatibility (wip)", -1, ""); + + //listingStandard.CheckboxLabeled(" Unsupported race render as \"Humanlike\" ", ref SizedApparelSettings.UnsupportedRaceToUseHumanlike, "If unchecked, unsupported humanlike race will not be patched!\nIf you change this option, you need to restart rimworld or clear cache\nDefault: false"); + + + + + + if (SizedApparelPatch.alienRaceActive) + { + listingStandard.Label(" AlienRace is Actived ", -1, ""); + //listingStandard.CheckboxLabeled("Force to use Human's BodyParts for unsuported Alien races", null, ""); + + //TODO: Allow Humanlike Settings Per Races + /* + SizedApparelSettings.alienRaces = SizedApparelsDatabase.GetAlienRacesDefNames(); + + listingStandard.Label("Alien Race Settings", -1f, null); + + SizedApparelSettings.alienRaceSearch = listingStandard.TextEntry(SizedApparelSettings.alienRaceSearch, 1); + RaceSettings(new Rect(0f, 60f, 16f, 300f), SizedApparelSettings.alienRaces, ref SizedApparelSettings.alienRacesAllowHumanlikTextures, null); + + listingStandard.Gap(listingStandard.verticalSpacing); + */ + /* + Widgets.BeginScrollView(aliensRect, ref ScrollPos, leftRect); + List alienSettingListLoc = new List(); + foreach(var item in SizedApparelsDatabase.AlienRaceUseHumanlike) + { + //Widgets.CheckboxLabeled(aliensRect, item.Key, ref); + } + Widgets.EndScrollView(); + */ + } + else + { + listingStandard.Label(" AlienRace is not Actived ", -1, ""); + } + + //Rect outRect = new Rect(0f, 35f, rect.width, rect.height - 35f); + /* + const float alienSettingHeight = 80; + Rect outRect = listingStandard.GetRect(listingStandard.CurHeight); + outRect = new Rect(outRect.x, outRect.y, outRect.width, alienSettingHeight); + Rect viewRect = new Rect(0, 0, outRect.width - 16f, 100 );//alienDefList.Count * 30f + Widgets.BeginScrollView(outRect, ref ScrollPos, viewRect, true); + Widgets.Label(new Rect(0f, 0f, 30f, 10f), "hello"); + Widgets.Label(new Rect(0f, 0f, 30f, 10f), "world"); + */ + //Log.Message(alienDefList.Count.ToString()); + //float h = alienDefList.Count <= 1 ? alienRaceSettingHeight : alienRaceSettingHeight * 1.8f; + + + //Rect rect = Race_ListingStandard.GetRect(h); + //rect.x = 0; + //rect.y = 0; + //Rect ScrollViewRect = new Rect(0, 0, rect.width - 16f, alienDefList.Count * alienRaceSettingHeight); + //Widgets.BeginScrollView(rect, ref ScrollPos, ScrollViewRect, true); + + float h = alienDefList.Count * alienRaceSettingHeight; + Listing_Standard Race_ListingStandard = listingStandard.BeginSection(h); + foreach (var raceName in alienDefList) + { + Race_ListingStandard.Label(raceName); + Race_ListingStandard.GapLine(1f); + 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); + } + Race_ListingStandard.CheckboxLabeled("If Unsupported, Use Humanlike", ref raceSetting.asHumanlike, "This Race will use Humanlike 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 = Race_ListingStandard.Slider(raceSetting.drawMinAge, raceSetting.drawMinAge <= 100 ? -1: 100, raceSetting.drawMinAge >= 100 ? 1000 : 100); + Race_ListingStandard.Gap(); + } + + listingStandard.EndSection(Race_ListingStandard); + Widgets.EndScrollView(); + //listingStandard.Gap(alienSettingHeight); + + listingStandard.GapLine(4f); + + listingStandard.Gap(16); + listingStandard.Label("RimNudeWorld Compatibility (WIP)", -1, ""); + + //listingStandard.CheckboxLabeled(" Don't Replace Body Texture On Nude", ref SizedApparelSettings.DontReplaceBodyTextureOnNude, "Only Replace BodyTexture On Not Nude. Trigers are Torso And Chests.\nDefault: False"); + if (SizedApparelPatch.rimNudeWorldActive) + { + listingStandard.Label(" RimNudeWorld is On!. Please check SizedApparel's Body parts render option", -1, "disable all body parts render except the breasts. and set it to only worn option true"); + listingStandard.CheckboxLabeled(" use Sized Apparel Breasts graphic when worn.", ref SizedApparelSettings.drawSizedApparelBreastsOnlyWorn, "use Sized Apparel's breasts render for breasts of apparel. it will be hidden when the pawn is naked and rimnudeworld will handle nude. \ndefault = true;"); + //listingStandard.CheckboxLabeled(" Hide RimNudeWorld Breasts Addon", ref SizedApparelSettings.hideRimNudeWorldBreasts, "For User Who Use Body(Torso) Texture option, remove double drawn breasts.\nYou can use this option as only using Rimnudeworld genital and else without breasts.\nDefault: False"); + + if (listingStandard.ButtonTextLabeled("Easy Setting Button", "Apply Rimnude Setting")) + { + SizedApparelSettings.drawSizedApparelBreastsOnlyWorn = true; + SizedApparelSettings.useBodyTexture = false; + SizedApparelSettings.drawBreasts = true; + SizedApparelSettings.drawPenis = false; + SizedApparelSettings.drawVagina = false; + SizedApparelSettings.drawAnus = false; + SizedApparelSettings.drawBelly = false; + } + + + if (false)//SizedApparelSettings.hideRimNudeWorldBreasts == false + { + //listingStandard.CheckboxLabeled(" match Breast Texture To Minimum ApparelSize (not work)", ref SizedApparelSettings.matchBreastTextureToMinimumApparelSize, "Avoid Clipping When breasts bigger than supported sized apparel.\nDefault: true"); + + //listingStandard.CheckboxLabeled(" use Under Breasts addon (RimNudeWorld)(not recomanded)", ref SizedApparelSettings.useUnderBreasts, "draw breasts under apparel."); + listingStandard.Label(" Under Breasts Offset: " + SizedApparelSettings.UnderBreastsOffset.ToString(), -1, "offset from defeault layer offset. Defualt: -0.0013"); + SizedApparelSettings.UnderBreastsOffset = listingStandard.Slider(SizedApparelSettings.UnderBreastsOffset, -0.025f, 0.025f); + } + if (SizedApparelSettings.useBodyTexture) + { + + } + } + else + { + listingStandard.Label(" RimNudeWorld is not Actived ", -1, ""); + if (listingStandard.ButtonTextLabeled("Easy Setting Button", "Apply Non Rimnude Setting")) + { + SizedApparelSettings.drawSizedApparelBreastsOnlyWorn = false; + SizedApparelSettings.useBodyTexture = true; + SizedApparelSettings.drawBreasts = true; + SizedApparelSettings.drawPenis = true; + SizedApparelSettings.drawVagina = true; + SizedApparelSettings.drawAnus = true; + SizedApparelSettings.drawBelly = true; + } + } + + listingStandard.End(); + + + listingStandard.Begin(rightRect); + listingStandard.Label("If you changed the option, try change apparels or reload save", -1); + listingStandard.Label("Body Part Render Option (wip)",-1,"standalone BodyPart Render System from this mod. It's for user who don't use RimNudeWorld\nIf you use RimNudeWorld, you should turn off this."); + + listingStandard.CheckboxLabeled("Use Gender Specific Textures.", ref SizedApparelSettings.useGenderSpecificTexture,"Use Gender Specific texture for body and apparel if it's valid. \nDefault: true"); + listingStandard.GapLine(1); + listingStandard.CheckboxLabeled("Draw Body Parts", ref SizedApparelSettings.drawBodyParts, "Draw Breasts..etc. when the pawn is wearing supported apparels. \nDefault: true"); + if (SizedApparelSettings.drawBodyParts) + { + listingStandard.CheckboxLabeled(" Use (Sized Apparel) Body Texture", ref SizedApparelSettings.useBodyTexture, "change pawn's body texture when the pawn is wearing supported apparels. Recommanded\nDefault: true"); + + + + listingStandard.CheckboxLabeled(" Draw Muscle Overlay (wip)", ref SizedApparelSettings.drawMuscleOverlay, "\nDisable this option when you use RimNudeWorld"); + + listingStandard.CheckboxLabeled(" Draw Breasts", ref SizedApparelSettings.drawBreasts, "this option is why this mod exist.\nDefault: true"); + if (SizedApparelSettings.drawBreasts) + { + listingStandard.CheckboxLabeled(" Match Breasts size to supported apparels",ref SizedApparelSettings.matchBreastToSupportedApparelSize, "to avoid breasts clipping(when breasts are bigger), you need this option.\nDefault: true"); + listingStandard.CheckboxLabeled(" draw Breasts on worn pawn only (RimNudeWorld)", ref SizedApparelSettings.drawSizedApparelBreastsOnlyWorn, "when the pawn is nude, the breasts graphic for sized apparel will be hidden. \nDefault: false" ); + } + listingStandard.CheckboxLabeled(" Draw Penis", ref SizedApparelSettings.drawPenis,"Disable this option when you use RimNudeWorld"); + listingStandard.CheckboxLabeled(" Draw Vagina", ref SizedApparelSettings.drawVagina, "Disable this option when you use RimNudeWorld"); + listingStandard.CheckboxLabeled(" Draw Anus", ref SizedApparelSettings.drawAnus, "Disable this option when you use RimNudeWorld"); + listingStandard.CheckboxLabeled(" Draw Belly Buldge", ref SizedApparelSettings.drawBelly, "Disable this option when you use RimNudeWorld"); + + listingStandard.CheckboxLabeled(" Hide Balls of Futa", ref SizedApparelSettings.hideBallOfFuta, "Hide Balls from penis of Futa.\nDefault: false"); + listingStandard.CheckboxLabeled(" Hide Penis of Man(Not Work yet)", ref SizedApparelSettings.hidePenisOfMale, "this option is for someone who really hate to see male's dick around.\nDefault: false"); + + //listingStandard.Gap(); + //listingStandard.CheckboxLabeled(" Use Body Part Variation", ref SizedApparelSettings.useBodyPartsVariation, "Use graphic variation such as inverted nipple.\nDefault: true"); + //listingStandard.CheckboxLabeled(" Show Body Part Variaion Button(WIP)", ref SizedApparelSettings.showBodyPartsVariationIcon, "WIP. Not work for now.\nDefault: true"); + + listingStandard.Gap(); + //listingStandard.CheckboxLabeled(" Use BodyPart Variation", ref SizedApparelSettings.useBodyPartsVariation, ""); //TODO + listingStandard.CheckboxLabeled(" Show BodyPart Variation Description", ref SizedApparelSettings.showBodyPartsVariation, "Show more info in bodyparts that sized apparel added. such as inverted nipple"); + } + /* + listingStandard.Gap(4); + listingStandard.Label("Breast Size Toggle Option", -1, "default option is setted for RimnudeWorld. you should not change this unless you have the textures for that size."); + listingStandard.Gap(4); + //Rect sizeScrollRect = new Rect(inRect.position+ new Vector2(0, listingStandard.CurHeight), inRect.size/3); + //Vector2 sizeScrollPosition = new Vector2(0.9f, 0.5f); + //listingStandard.BeginScrollView(sizeScrollRect, ref sizeScrollPosition, ref sizeScrollRect); + //Listing_Standard sizeList = listingStandard.BeginSection_NewTemp(150); + + //sizeList.BeginScrollView(rect, ref ScrollPos, ref rect); + + listingStandard.CheckboxLabeled(" use Nipples", ref SizedApparelSettings.useNipples, "use Nipples(Flat breasts) Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Tiny", ref SizedApparelSettings.useTiny, "use Tiny breasts Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Small", ref SizedApparelSettings.useSmall, "use Small breasts Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Average", ref SizedApparelSettings.useAverage, "use Average breasts Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Large", ref SizedApparelSettings.useLarge, "use Large breasts Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Huge", ref SizedApparelSettings.useHuge, "use Huge breasts Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Enormous", ref SizedApparelSettings.useEnormous, "use Enormous breasts Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Massive", ref SizedApparelSettings.useMassive, "use Massive breasts Sized Apparel.\nDefault: true"); + listingStandard.CheckboxLabeled(" use Gargantuan", ref SizedApparelSettings.useGargantuan, "use Gargantuan breasts Sized Apparel.\nDefault: true"); + 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"); + */ + listingStandard.End(); + + //listingStandard.EndScrollView(ref rect); + base.DoSettingsWindowContents(inRect); + } + + public override string SettingsCategory() + { + return "Sized Apparel for RJW"; + } + + + + + + + //copy from BnC + public static bool Contai(string source, string toCheck, StringComparison comp) + { + return source != null && source.IndexOf(toCheck, comp) >= 0; + } + //copy from BnC + public static void RaceSettings(Rect rect, List label, ref List alienRacesToAllowHumanlikes, string tooltip = null) + { + bool flag = !GenText.NullOrEmpty(tooltip); + if (flag) + { + bool flag2 = Mouse.IsOver(rect); + if (flag2) + { + Widgets.DrawHighlight(rect); + } + TooltipHandler.TipRegion(rect, tooltip); + } + bool flag3 = GenList.NullOrEmpty(alienRacesToAllowHumanlikes); + if (flag3) + { + alienRacesToAllowHumanlikes = new List(); + } + Listing_Standard listing_Standard = new Listing_Standard(); + Rect rect2 = rect; + Rect rect3 = rect; + rect3.height = (float)label.Count * 30f; + rect3.width -= 16f; + Widgets.BeginScrollView(rect2, ref SizedApparelSettings.alienRacesListScrollPos, rect3, true); + listing_Standard.Begin(rect3); + for (int i = 0; i < SizedApparelSettings.alienRaces.Count; i++) + { + bool flag4 = GenList.NullOrEmpty(alienRacesToAllowHumanlikes) || !alienRacesToAllowHumanlikes.Contains(label[i]); + bool flag5 = SizedApparelSettings.alienRaceSearch == null || Contai(SizedApparelSettings.alienRaces[i], SizedApparelSettings.alienRaceSearch.ToLower(), StringComparison.OrdinalIgnoreCase); + if (flag5) + { + WidgetRow widgetRow = new WidgetRow(rect.x,listing_Standard.CurHeight, UIDirection.RightThenUp, 99999f, 1f); + widgetRow.Label(label[i], rect.width * 0.8f, null, -1f); + + + bool flag6 = label[i] != "Human"; + if (flag6) + { + widgetRow.ToggleableIcon(ref flag4, TexButton.IconBook, "Use Shared Body Parts texture (\"Humanlike\" body plarts).\nIf Unchecked, the race will use race's owned texture. \n If the race not have supported textures, try this option.", null, null); + } + else + { + //TODO: should I let human can use humanlike textures? + widgetRow.Icon(TexButton.IconBook, "Human Race is forced to use \"Human\" Textures. not \"Humanlike\""); + } + + + /* + bool flag7 = widgetRow.ButtonIcon(TexButton.ToggleTweak, "Allow Humanlike Body parts rendering from Sized Apparel(NOT RIMNUDE!)", null, null, null, true, -1f); + if (flag7) + { + bool flag8 = Current.Game != null; + if (flag8) + { + bool flag9 = !Find.WindowStack.TryRemove(typeof(RaceEditorWindow), true); + if (flag9) + { + RaceSettings sizeSettings = RaceUtility.GetSizeSettings(DefDatabase.GetNamed(label[i], false)); + RaceEditorWindow raceEditorWindow = new RaceEditorWindow(); + raceEditorWindow.alienRace = DefDatabase.GetNamed(label[i], true); + bool flag10 = sizeSettings != null; + if (flag10) + { + raceEditorWindow.raceSettings = sizeSettings; + raceEditorWindow.headOffset = sizeSettings.headOffset; + raceEditorWindow.sizeModifier = sizeSettings.sizeModifier; + raceEditorWindow.hairSizeModifier = sizeSettings.hairSizeModifier; + raceEditorWindow.headSizeModifier = sizeSettings.headSizeModifier; + raceEditorWindow.scaleChild = sizeSettings.scaleChild; + raceEditorWindow.scaleTeen = sizeSettings.scaleTeen; + } + Find.WindowStack.Add(raceEditorWindow); + } + } + else + { + Messages.Message("You need to be in-game to open size editor", MessageTypeDefOf.RejectInput, true); + } + } + */ + bool flag11 = !flag4; + if (flag11) + { + bool flag12 = !alienRacesToAllowHumanlikes.Contains(label[i]); + if (flag12) + { + alienRacesToAllowHumanlikes.Add(label[i]); + } + } + else + { + bool flag13 = alienRacesToAllowHumanlikes.Contains(label[i]); + if (flag13) + { + alienRacesToAllowHumanlikes.Remove(label[i]); + } + } + listing_Standard.Gap(30f); + } + } + listing_Standard.End(); + Widgets.EndScrollView(); + } + } + +} diff --git a/1.3/source/SizedApparel/SizedApparelStyleStationPatch.cs b/1.3/source/SizedApparel/SizedApparelStyleStationPatch.cs new file mode 100644 index 0000000..8e82e3f --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelStyleStationPatch.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; +using HarmonyLib; +using UnityEngine; +using rjw; +using System.Reflection; +using System.Reflection.Emit; + +namespace SizedApparel +{ + //TODO...? + //[HarmonyPatch(typeof(Dialog_StylingStation), "DrawTabs")] + public class SizedApparelStyleStationDrawTabsPatch + { + public static void Postfix(Rect rect, ref Vector2 ___hairScrollPosition, Dialog_StylingStation __instance, List ___tabs, Dialog_StylingStation.StylingTab ___curTab, float ___viewRectHeight, List ___tmpStyleItems, bool ___devEditMode, Pawn ___pawn) + { + + switch (___curTab) + { + case (Dialog_StylingStation.StylingTab)24: + + //Draw PubicHair Tab Code here! + + return; + default: + return; + } + } + + static void DrawStylingTypePubicHair(Dialog_StylingStation dialog_StylingStation, Rect rect) + { + + } + + static void AddPubicHairTab(Dialog_StylingStation stylingStation, List tabs) + { + var curTabField = AccessTools.Field(typeof(Dialog_StylingStation), "curTab"); + tabs.Add(new TabRecord("PubicHair".Translate().CapitalizeFirst(), delegate () + { + + curTabField.SetValue(stylingStation, (Dialog_StylingStation.StylingTab)24); + }, (Dialog_StylingStation.StylingTab)curTabField.GetValue(stylingStation) == (Dialog_StylingStation.StylingTab)24)); + } + + static IEnumerable Transpiler(IEnumerable instructions) + { + bool isHair = false; + MethodInfo tabAdd = AccessTools.DeclaredMethod(typeof(List),"Add"); + foreach (var instruction in instructions) + { + if(instruction.opcode == OpCodes.Ldstr) + { + if (instruction.OperandIs("Hair")) + isHair = true; + else + isHair = false; + } + + + if (isHair && instruction.opcode == OpCodes.Callvirt && instruction.OperandIs(tabAdd)) + { + yield return instruction;//finish add hairTab + + yield return new CodeInstruction(OpCodes.Ldarg_0); + yield return new CodeInstruction(OpCodes.Ldarg_0); + //Log.Message("this"); + yield return new CodeInstruction(OpCodes.Ldfld, AccessTools.DeclaredField(typeof(Dialog_StylingStation),"tabs")); + //Log.Message("tabs"); + //yield return new CodeInstruction(OpCodes.Ldarg_0); + //Log.Message("this"); + //yield return new CodeInstruction(OpCodes.Ldfld, AccessTools.DeclaredField(typeof(Dialog_StylingStation), "curTab")); + //Log.Message("curtab"); + yield return new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(SizedApparelStyleStationDrawTabsPatch), "AddPubicHairTab")); + //Log.Message("call"); + //yield return new CodeInstruction(OpCodes.Ldarg_0); + + //yield return new CodeInstruction(OpCodes.Ldarg_0); + //yield return new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(Dialog_StylingStation), "tabs")); + //yield return new CodeInstruction(OpCodes.Ldstr,"PubicHair".Translate().CapitalizeFirst()); + + //yield return new CodeInstruction(OpCodes.Ldarg_0); + //yield return new CodeInstruction(OpCodes.Ldarg_0); + + + + + isHair = false; + } + else + yield return instruction; + + } + yield break; + } + } +} + diff --git a/1.3/source/SizedApparel/SizedApparelUtility.cs b/1.3/source/SizedApparel/SizedApparelUtility.cs new file mode 100644 index 0000000..1315215 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelUtility.cs @@ -0,0 +1,2208 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using HarmonyLib; +using UnityEngine; +using rjw; + +namespace SizedApparel +{ + public static class SizedApparelUtility + { + //DefName, BodyTypeName, targetTextureInt(index is breasts hediff) + //static Dictionary>> sizedApparelSupportCache = new Dictionary>>(); + + + //those breasts size codes are hard coded. maybe some days, It needs to be fixed + public static string chestString = "Chest"; + public static string breastsString = "Breasts"; + + static string Titanic = "_10"; + static string Colossal = "_9"; + static string Gargantuan = "_8"; + static string Massive = "_7"; + static string Enormous = "_6"; + static string Huge = "_5"; + static string Large = "_4"; + static string Average = "_3"; + static string Small = "_2"; + static string Tiny = "_1"; + static string Nipples = "_0"; + //static String[] size = new string[10] { "_0", "_1", "_2", "_3", "_4", "_5" , "_6", "_7", "_8", "_9"}; + public static string[] size = new string[11] { Nipples, Tiny, Small, Average, Large, Huge, Enormous, Massive, Gargantuan, Colossal, Titanic }; + + public static int findAvailableSmallerSizeFromSetting(int current) + { + + int target = current; + target = Math.Min(target, size.Length - 1); + while (target > 0) + { + if (SizedApparelSettings.getUseSettingFromIndex(target) == false) + target--; + else + break; + } + return target; + } + public static int findAvailableBiggerSizeFromSetting(int current) + { + + int target = current; + + while (target < size.Length) + { + if (SizedApparelSettings.getUseSettingFromIndex(target) == false) + target++; + else + break; + } + target = Math.Min(target, size.Length - 1); + return target; + } + public static int findAvailableSizeFromSetting(int current, bool findBigger) + { + if (findBigger) + return findAvailableBiggerSizeFromSetting(current); + else + return findAvailableSmallerSizeFromSetting(current); + } + + + public static bool GetBreastSeverity(Pawn pawn, out float BreastSeverity, out Hediff breastHediff) + { + + //string breastsString = + ; + float _breastSeverity = -1; + Hediff _breastHediff = null; + bool result = false; + + if (SizedApparelPatch.RJWActive || (SizedApparelPatch.SJWActive&&SizedApparelSettings.useSafeJobBreasts)) + { + //__instance.pawn.health.hediffSet.HasHediff(Hediff ,BodyPartRecord ,false); + //__instance.pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null, null).Any((BodyPartRecord bpr) => bpr.untranslatedCustomLabel == label || bpr.def.defName == label); + + //-------------------------------------------------------------------------------------------------- + /* + foreach (Hediff hediff in pawn.health.hediffSet.hediffs) + { + if (hediff != null) + { + + if (hediff.Part != null) + { + + if (hediff.Part.def.defName.Equals(chestString)) + { + if (hediff.def.defName.EndsWith(breastsString)) + { + //Log.Message("Found Breast Hediff"); + _breastSeverity = hediff.Severity; + _breastHediff = hediff; + result = true; + //Log.Message(_breastSeverity.ToString()); + } + } + } + } + }*/ + var breastList = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn)); + Hediff hediff = null; + if(!breastList.NullOrEmpty()) + hediff = breastList.FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("breast")); + if(hediff != null) + { + _breastSeverity = hediff.Severity; + _breastHediff = hediff; + result = true; + } + }//Find Breasts in chest + if(SizedApparelSettings.Debug) + Log.Message("[Sized Apparel]" + pawn.Name + "'s breasts severity: " + _breastSeverity.ToString()); + BreastSeverity = _breastSeverity; + breastHediff = _breastHediff; + return result; + + } + public static Graphic GetSizedApparelGraphic(Graphic sourceGraphic, float breastSeverity, string wearerDefName = null, string breastHediff = null, string customPose = null, Gender gender = Gender.None) + { + int currentBreastSizeIndex = -1; + float currentBreastSeverity = -1; + string s; + bool flag = false; + return GetSizedApparelGraphic(sourceGraphic, breastSeverity, out currentBreastSizeIndex, out currentBreastSeverity, out flag, out s, wearerDefName, breastHediff, customPose, gender); + } + + public static Graphic GetSizedApparelGraphic(Graphic sourceGraphic, float breastSeverity , out int indexOut, out float severityOut, out bool result, out string hediffResult, string wearerDefName = null, string breastHediffName = null, string customPose = null, Gender gender = Gender.None) + { + indexOut = -1; + severityOut = -1; + result = false; + hediffResult = null; + + if (sourceGraphic == null) + { + return null; + } + + + string path; + string extraPath = null; + string raceExtraPath = null; + string racePath = null; + + + + + //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; + path = sourceGraphic.path; + + if (customPose != null) + { + path = path.Insert(Math.Max(path.LastIndexOf('/'), 0), "/CustomPose/"+ customPose); + } + + string genderSting; + if (gender == Gender.Female) + { + genderSting = "F"; + } + if (gender == Gender.Male) + { + genderSting = "M"; + } + else + genderSting = string.Empty; + + path = path + genderSting; + + if (wearerDefName != null) + racePath = path + "_" + wearerDefName; + if (breastHediffName != null) + { + extraPath = path + "_" + breastHediffName; + if (wearerDefName != null) + raceExtraPath = path + "_" + wearerDefName + "_" + breastHediffName; + } + + + + + + + int offset = 0; + + + + bool validTexture = false; + Graphic graphic = null; + bool findBigger = true; // if false : search smaller first + string pathString = ""; + while (offset < SizedApparelUtility.size.Length) + { + if (breastHediffName != null) + { + if(raceExtraPath != null) + { + pathString = raceExtraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + validTexture = true; + result = true; + hediffResult = breastHediffName; + //Log.Message(extraPath + BreastSeverityString(breastSeverity, offset, findBigger) + ":Extra Texture Found"); + break; + } + } + + + pathString = extraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + validTexture = true; + result = true; + hediffResult = breastHediffName; + //Log.Message(extraPath + BreastSeverityString(breastSeverity, offset, findBigger) + ":Extra Texture Found"); + break; + } + + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); + + if(racePath != null) + { + pathString = racePath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + validTexture = true; + result = true; + hediffResult = null; + //Log.Message(path + BreastSeverityString(breastSeverity, offset, findBigger) + ":Texture Found"); + break; + } + } + + + pathString = path + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + result = true; + hediffResult = null; + //Log.Message(path + BreastSeverityString(breastSeverity, offset, findBigger) + ":Texture Found"); + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); + + //Log.Warning(path + BreastSeverityString(breastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture."); + offset++; + if (indexOut == -1) + break; + } + if (validTexture == false) + { + offset = 0; + while (offset < SizedApparelUtility.size.Length) + { + if (breastHediffName != null) + { + if (raceExtraPath != null) + { + pathString = raceExtraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + result = true; + hediffResult = breastHediffName; + //Log.Message(extraPath + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Extra Texture Found"); + break; + } + } + + pathString = extraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + result = true; + hediffResult = breastHediffName; + //Log.Message(extraPath + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Extra Texture Found"); + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); + + //Log.Warning(extraPath + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); + } + + if(racePath != null) + { + pathString = racePath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + result = true; + hediffResult = null; + //Log.Message(path + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Texture Found"); + break; + } + } + + pathString = path + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); + graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + result = true; + hediffResult = null; + //Log.Message(path + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Texture Found"); + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); + + //Log.Warning(path + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture."); + offset++; + if (indexOut == -1) + break; + } + } + + if (validTexture == false) + { + + //Log.Warning(path + BreastSeverityString(breastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger ."); + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + path + ")apparel texture is not patched::missing texture"); + + graphic = sourceGraphic; + } + else + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + path + ")apparel texture has been patched"); + + } + + + + //rec = new ApparelGraphicRecord(graphic, rec.sourceApparel); + result = validTexture; + + + //Find Humanlike for Alien. ps. null for search defealt texturepath + if(result == false & wearerDefName != null) + { + GetSizedApparelGraphic(sourceGraphic, breastSeverity, null , breastHediffName, customPose); + } + return graphic; + + } + + [Obsolete] + public static SizedApparelBodyPartDef TryGetSizedApparelBodyPart(string bodyPartName) + { + return null; + } + + + public static bool isPragnencyHediff(Hediff h) + { + return h.def.defName.ToLower().Contains("pregnancy"); + } + + public static bool isBellyBulgeHediff(Hediff h) + { + if (isPragnencyHediff(h)) + return true; + if (SizedApparelPatch.LicentiaActive) + { + if (h.def.defName.ToLower().Contains("cumflation")) + return true; + if (h.def.defName.ToLower().Contains("cumstuffed")) + return true; + } + return false; + } + + public static bool isRJWParts(Hediff h) + { + return (isBreast(h.def.defName) || Genital_Helper.is_penis(h) || Genital_Helper.is_vagina(h) || isAnus(h.def.defName)); + //return (isBreast(defname)|| isPenis(defname)|| isVagina(defname)|| isAnus(defname)); + } + public static bool isBreast(string defname) + { + string lower = defname.ToLower(); + if (lower.Contains("breast")) + return true; + return false; + } + public static bool isUdder(string defname) + { + string lower = defname.ToLower(); + if (lower.Contains("udder")) + return true; + return false; + } + + [Obsolete] + public static bool isPenis(string defname) + { + string lower = defname.ToLower(); + if (lower.Contains("penis") || lower.Contains("dick") || (lower.Contains("tentacle") || lower.Contains("ovipositorm")))//(lower.Contains("tentacle")&&lower.Contains("penis") is for fertility. not for graphic + return true; + return false; + } + [Obsolete] + public static bool isVagina(string defname) + { + string lower = defname.ToLower(); + if (lower.Contains("vagina") || lower.Contains("ovipositorf")) + return true; + return false; + } + public static bool isAnus(string defname) + { + string lower = defname.ToLower(); + if (lower.Contains("anus")) + return true; + return false; + } + + //find valid breasts texture to choose apparel. + public static float GetBreastSeverityValidTextures(Pawn pawn, Hediff hediff, string customDefName = null) + { + ApparelRecorderComp comp = pawn.TryGetComp(); + if (comp == null) + return -1; + + + if (comp.hasUpdateBefore == false) + { + //comp.Update(true, true); + } + + if (pawn == null) + return -1; + if (hediff == null) + return -1; + string defName; + if (customDefName == null) + defName = pawn.def.defName; + else + defName = customDefName; + + string bodyPartsFolderPath = "SizedApparel/BodyParts/"; + string defaultHediffName = "Breasts"; + string graphicFolderPath = bodyPartsFolderPath + defName + "/" + "Breasts" + "/"; + string fileName; + string extraFileName; + string bodyType = null; + if (pawn.story != null) + bodyType = pawn.story.bodyType?.defName; + if (bodyType != null) + { + fileName = defaultHediffName + ("_" + bodyType); + extraFileName = hediff.def.defName + ("_" + bodyType); + } + else + { + fileName = defaultHediffName; + extraFileName = hediff.def.defName; + } + string path = graphicFolderPath + fileName; + string extraPath = graphicFolderPath + extraFileName; + //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; + + //SizedApparelsDatabase.BodyPartDatabaseKey key = new SizedApparelsDatabase.BodyPartDatabaseKey(,) + //SizedApparelsDatabase.GetSupportedBodyPartPath() + + int offset = 0; + float targetBreastSeverity = hediff.Severity; + + bool validTexture = false; + bool findBigger = true; // if false : search smaller first + string pathString = ""; + int currentSizeIndex = -1; + float currentSeverity = -1; + while (offset < SizedApparelUtility.size.Length) + { + if (hediff != null) + { + pathString = extraPath + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, findBigger, ref currentSizeIndex, ref currentSeverity); + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); + + + validTexture = true; + break; + } + } + + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); + + pathString = path + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, findBigger, ref currentSizeIndex, ref currentSeverity); + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); + + validTexture = true; + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); + + offset++; + if (currentSizeIndex == -1) + break; + } + if (validTexture == false) + { + offset = 0; + while (offset < SizedApparelUtility.size.Length) + { + if (hediff != null) + { + pathString = extraPath + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); + + validTexture = true; + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); + + } + else + pathString = path + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); + + validTexture = true; + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); + + offset++; + if (currentSizeIndex == -1) + break; + } + } + + if (validTexture == false) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + path + ")Breasts texture is not patched::missing texture"); + return -10; + } + else + {// ValidTextureFound + return currentSeverity; + } + + } + + //It's heavy search. Do Not Call this function rapidly + public static Graphic GetBodyPartGraphic(string raceDefName, string bodyTypeName, string hediffDefName, bool isBreast, int sizeIndex, string folderName, string defaultHediffName, out int indexOut, out string hediffResult, bool hornyGraphic = false, string customRaceDefName = null, string variation = null, Gender gender = Gender.None) + { + Graphic graphic = null; //for return + //rec = new ApparelGraphicRecord(null, null); + string defName = raceDefName; + + if (customRaceDefName != null) + defName = customRaceDefName; + + string bodyType = bodyTypeName; + string bodyPartsFolderPath = "SizedApparel/BodyParts/"; + string graphicFolderPath; + string targetFolderName = folderName; + if (hornyGraphic) + graphicFolderPath = bodyPartsFolderPath + defName + "/" + targetFolderName + "/Horny/"; + else + graphicFolderPath = bodyPartsFolderPath + defName + "/" + targetFolderName + "/"; + string fileName; + string extraFileName = null; + if (bodyType != null) + { + fileName = defaultHediffName + ("_" + bodyType); + if(hediffDefName != null) + extraFileName = hediffDefName + ("_" + bodyType); + } + else + { + fileName = defaultHediffName; + if (hediffDefName != null) + extraFileName = hediffDefName; + } + hediffResult = null; + //if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize) + // BreastSeverity = comp.BreastSeverityCache; + int currentSizeIndex = -1; + float currentSeverity = -1; + //int minSupportedBreastSizeIndex = 1000; + //float minSupportedBreastSeverity = 1000; + + //SizedApparelUtility.GetBreastSeverity(apparel.Wearer, out BreastSeverity, out breastHediff); + + string genderString; + if(gender == Gender.Female) + { + genderString = "F"; + } + if (gender == Gender.Female) + { + genderString = "M"; + } + else + genderString = string.Empty; + + + string path = graphicFolderPath + fileName + genderString; + string extraPath = graphicFolderPath + extraFileName + genderString; + //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; + + + int offset = 0; + + float SeverityCapped; + + if (isBreast) + SeverityCapped = SizedApparelUtility.BreastSizeIndexToSeverity(sizeIndex); + else + SeverityCapped = SizedApparelUtility.PrivatePartSizeIndexToSeverity(sizeIndex); + + bool validTexture = false; + + bool findBigger = true; // if false : search smaller first + string pathString = ""; + string pathStringWithVariatione = ""; + while (offset < SizedApparelUtility.size.Length) + { + if (hediffDefName != null) + { + if (isBreast) + pathString = extraPath + SizedApparelUtility.BreastSeverityString(SeverityCapped, offset, findBigger, ref currentSizeIndex, ref currentSeverity); + else + pathString = extraPath + SizedApparelUtility.PrivatePartsSevertyStringNotBreast(SeverityCapped, offset, findBigger, ref currentSizeIndex, ref currentSeverity); + + if (variation != null) + { + pathStringWithVariatione = pathString + "_" + variation; + if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); + + graphic = GraphicDatabase.Get(pathStringWithVariatione); + validTexture = true; + hediffResult = hediffDefName; + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); + } + + + + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); + + + //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + //minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + //graphic = new Graphic(); + graphic = GraphicDatabase.Get(pathString); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + hediffResult = hediffDefName; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Found"); + break; + } + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Not Found."); + } + + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); + + if (isBreast) + pathString = path + SizedApparelUtility.BreastSeverityString(SeverityCapped, offset, findBigger, ref currentSizeIndex, ref currentSeverity); + else + pathString = path + SizedApparelUtility.PrivatePartsSevertyStringNotBreast(SeverityCapped, offset, findBigger, ref currentSizeIndex, ref currentSeverity); + + if (variation != null) + { + pathStringWithVariatione = pathString + "_" + variation; + if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); + + graphic = GraphicDatabase.Get(pathStringWithVariatione); + validTexture = true; + hediffResult = hediffDefName; + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); + } + + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); + + //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + //minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + graphic = GraphicDatabase.Get(pathString); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + hediffResult = defaultHediffName; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Found"); + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); + + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture."); + offset++; + if (currentSizeIndex == -1) + break; + } + if (validTexture == false) + { + offset = 0; + while (offset < SizedApparelUtility.size.Length) + { + if (hediffDefName != null) + { + if (isBreast) + pathString = extraPath + SizedApparelUtility.BreastSeverityString(SeverityCapped, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); + else + pathString = extraPath + SizedApparelUtility.PrivatePartsSevertyStringNotBreast(SeverityCapped, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); + + if (variation != null) + { + pathStringWithVariatione = pathString + "_" + variation; + if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); + + graphic = GraphicDatabase.Get(pathStringWithVariatione); + validTexture = true; + hediffResult = hediffDefName; + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); + } + + if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); + + //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + //minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + //graphic = new Graphic(); + graphic = GraphicDatabase.Get(pathString); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + hediffResult = hediffDefName; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Found"); + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); + + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); + } + if (isBreast) + pathString = path + SizedApparelUtility.BreastSeverityString(SeverityCapped, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); + else + pathString = path + SizedApparelUtility.PrivatePartsSevertyStringNotBreast(SeverityCapped, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); + + if (variation != null) + { + pathStringWithVariatione = pathString + "_" + variation; + if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); + + graphic = GraphicDatabase.Get(pathStringWithVariatione); + validTexture = true; + hediffResult = hediffDefName; + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); + } + + if ((ContentFinder.Get((pathString + "_south"), false) != null)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); + + //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + //minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity); + graphic = GraphicDatabase.Get(pathString); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + validTexture = true; + hediffResult = defaultHediffName; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + break; + } + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); + + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture."); + offset++; + if (currentSizeIndex == -1) + break; + } + } + + if (validTexture == false) + { + + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger ."); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //graphic = GraphicDatabase.Get(path, ShaderDatabase.Cutout, agr.graphic.drawSize, agr.graphic.color); + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + path + ")BodyPart texture is not patched::missing texture"); + + } + else + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] (" + path + ")BodyPart texture has been patched"); + + } + + indexOut = currentSizeIndex; + + if(graphic == null & gender != Gender.None) + { + //try search genderless graphic + graphic = GetBodyPartGraphic(raceDefName, bodyTypeName, hediffDefName, isBreast, sizeIndex, folderName, defaultHediffName, out indexOut, out hediffResult, hornyGraphic, customRaceDefName, variation, Gender.None); + } + + if (graphic == null & hornyGraphic == true) + { + //try search normal Graphic instead of HornyGraphic + graphic = GetBodyPartGraphic(raceDefName, bodyTypeName, hediffDefName, isBreast, sizeIndex, folderName, defaultHediffName, out indexOut, out hediffResult, false, customRaceDefName, variation, gender); + } + + return graphic; + + } + /* + public static Graphic GetBodyPartGraphic(Pawn pawn, Hediff hediff, bool isBreast, string folderName, string defaultHediffName, bool hornyGraphic = false, bool updateComp = false, string customRaceDefName = null) + { + int i = -1; + string s = null; + return GetBodyPartGraphic(pawn, hediff, isBreast, folderName, defaultHediffName, out i,out s, hornyGraphic, updateComp, customRaceDefName); + } + + public static Graphic GetBodyPartGraphic(Pawn pawn, Hediff hediff, bool isBreast, string folderName, string defaultHediffName, out int indexOut,out string hediffResult, bool hornyGraphic = false, bool updateComp = false, string customRaceDefName = null) + { + Graphic graphic = null; //for return + indexOut = -1; + hediffResult = null; + if (pawn == null) + return null; + if (hediff == null) + return null; + //rec = new ApparelGraphicRecord(null, null); + Graphic nakedGraphic = pawn.Drawer?.renderer?.graphics?.nakedGraphic; + if (nakedGraphic == null) + return null; + var rotComp = pawn.TryGetComp(); + if (rotComp!=null) + { + if (rotComp.Stage == RotStage.Rotting) + nakedGraphic = pawn.Drawer.renderer.graphics.rottingGraphic; + } + + ApparelRecorderComp comp = pawn.TryGetComp(); + string defName = pawn.def.defName; + if (customRaceDefName != null) + defName = customRaceDefName; + string bodyType = null; + if (pawn.story != null) + bodyType = pawn.story.bodyType?.defName; + string bodyPartsFolderPath = "SizedApparel/BodyParts/"; + string graphicFolderPath; + if (hornyGraphic) + graphicFolderPath = bodyPartsFolderPath + defName + "/" + folderName + "/Horny/"; + else + graphicFolderPath = bodyPartsFolderPath + defName + "/" + folderName + "/"; + string fileName; + string extraFileName; + if(bodyType != null) + { + fileName = defaultHediffName + ("_" + bodyType); + extraFileName = hediff.def.defName + ("_" + bodyType); + } + else + { + fileName = defaultHediffName; + extraFileName = hediff.def.defName; + } + + //if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize) + // BreastSeverity = comp.BreastSeverityCache; + //int currentSizeIndex = 0; + //float currentSeverity = -1; + //int minSupportedBreastSizeIndex = 1000; + //float minSupportedBreastSeverity = 1000; + + //SizedApparelUtility.GetBreastSeverity(apparel.Wearer, out BreastSeverity, out breastHediff); + if (comp != null) + { + + if (comp.hasUpdateBefore == false) + { + if (updateComp) + { + //SizedApparelUtility.GetBreastSeverity(apparel.Wearer, out BreastSeverity, out breastHediff); + //comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(apparel.Wearer, BreastSeverity, breastHediff); + //comp.breastSeverity = BreastSeverity; + //comp.breastHediff = breastHediff; + //comp.hasUpdateBefore = true; + //comp.Update(true,true,false); + } + + } + float SeverityCapped = hediff.Severity; ; + if (isBreast) + { + if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip + SeverityCapped = Math.Min(comp.BreastSeverityCache, SeverityCapped); + } + + + + + + if (comp.hasUnsupportedApparel == false) + { + int index; + if (isBreast) + index = SizedApparelUtility.BreastSeverityInt(hediff.Severity); + else + index = SizedApparelUtility.PrivatePartSeverityInt(hediff.Severity); + + Graphic partGraphic = GetBodyPartGraphic(pawn.def.defName, pawn.story?.bodyType?.defName, hediff.def.defName, hornyGraphic, index, folderName, defaultHediffName,out indexOut, out hediffResult, hornyGraphic, customRaceDefName); + if(partGraphic != null) + { + graphic = GraphicDatabase.Get(partGraphic.path, nakedGraphic.Shader, nakedGraphic.drawSize, nakedGraphic.color, nakedGraphic.colorTwo); + } + + + + + + + //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); + //comp.breastSeverityCapToDraw = Math.Min(comp.breastSeverityCapToDraw, minSupportedBreastSeverity); + } + } + + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[Sized Apparel] " + pawn.Name + " doesn't have SizedApparel Compoenet!!"); + + } + return graphic; + + }*/ + + //TODO + public static Graphic GetBodyGraphic() + { + return null; + } + + public static bool IsHorny(Pawn pawn) + { + var comp = pawn.TryGetComp(); + if(comp != null) + { + if (comp.forceHorny == true) + return true; + } + + JobDriver_Sex sexDriver = null; + if (pawn.jobs != null) + sexDriver = pawn.jobs?.curDriver as rjw.JobDriver_Sex; + if (sexDriver != null) + { + return true; + } + if (pawn.needs == null) + return false; + + bool flag = (xxx.is_hornyorfrustrated(pawn)); + return flag; + bool erect = false; + + Need_Sex needSex = null; + if (pawn.needs != null) + needSex = pawn.needs.TryGetNeed(); + + JobDriver_Sex dri = null; + if (pawn.jobs != null) + dri = pawn.jobs.curDriver as rjw.JobDriver_Sex; + + + //Log.Message("find needSex"); + if (needSex == null) + return false; + + //Log.Warning(needSex.CurLevel.ToString()); + if (needSex.CurLevel >= needSex.thresh_ahegao() || needSex.CurLevel < needSex.thresh_neutral()) + { + erect = true; + } + + + if (dri != null) + { + erect = true; + } + + return false; + } + + + public static float BreastSizeIndexToSeverity(int index) + { + switch (index) + { + case -1: + return 0; + case 0: + return 0.01f; + case 1: + return 0.02f; + case 2: + return 0.2f; + case 3: + return 0.4f; + case 4: + return 0.6f; + case 5: + return 0.8f; + case 6: + return 1.0f; + case 7: + return 1.2f; + case 8: + return 1.4f; + case 9: + return 1.6f; + case 10: + return 1.8f; + + default: + return 0; + } + } + public static float PrivatePartSizeIndexToSeverity(int index) + { + switch (index) + { + case -1: + return 0; + case 0: + return 0.01f; + case 1: + return 0.2f; + case 2: + return 0.4f; + case 3: + return 0.6f; + case 4: + return 0.8f; + case 5: + return 1.01f; + default: + return 0; + } + } + public static int PrivatePartSeverityInt(float Severity) + { + if (Severity < 0f) + { + return -1; + } + else if (Severity < 0.01f) + { + return 0; + } + else if (Severity < 0.2f) + { + return 0; + } + else if (Severity < 0.40f) + { + return 1; + } + else if (Severity < 0.60f) + { + return 2; + } + else if (Severity < 0.80f) + { + return 3; + } + else if (Severity < 1.01f) + { + return 4; + } + else + { + return 5; + } + } + + public static int BreastSeverityInt(float BreastSeverity) + { + if (BreastSeverity < 0f) + { + return -1; + } + if (BreastSeverity < 0.01f) + { + return 0; + } + else if (BreastSeverity < 0.02f) + { + return 0; + } + else if (BreastSeverity < 0.2f) + { + return 1; + } + else if (BreastSeverity < 0.40f) + { + return 2; + } + else if (BreastSeverity < 0.60f) + { + return 3; + } + else if (BreastSeverity < 0.80f) + { + return 4; + } + else if (BreastSeverity < 1.0f) + { + return 5; + } + else if (BreastSeverity < 1.2f) + { + return 6; + } + else if (BreastSeverity < 1.4f) + { + return 7; + } + else if (BreastSeverity < 1.6f) + { + return 8; + } + else if (BreastSeverity < 1.8f) + { + return 9; + } + else + { + return 10; + } + } + + public static string PrivatePartsSevertyStringNotBreast(float severity, int offset, bool findBigger, ref int outTargetIndex, ref float outTargetSeverity) + { + int targetIndex = -1; + float targetSeverity = 0; + int result = -1; + if (offset >= 0) + { + { + if (severity < 0f)//Error Serverity + { + targetIndex = -1; + targetSeverity = 0; + } + else if (severity < 0.2f) + { + targetIndex = 0; + targetSeverity = 0.01f; + } + else if (severity < 0.4f) + { + targetIndex = 1; + targetSeverity = 0.2f; + } + else if (severity < 0.6f) + { + targetIndex = 2; + targetSeverity = 0.4f; + } + else if (severity < 0.8f) + { + targetIndex = 3; + targetSeverity = 0.6f; + } + else if (severity < 1.01f) + { + targetIndex = 4; + targetSeverity = 0.80f; + } + else + { + targetIndex = 5; + targetSeverity = 1.01f; + } + //if (targetIndex - offset < 0) + // return "_-1"; + } + + if (findBigger) + { + if (size.Length - (targetIndex + offset) > 0) + { + + //size.Length< targetIndex + offset + /* + if (size[targetIndex + offset] != null) + return size[targetIndex + offset]; + */ + //result = findAvailableBiggerSizeFromSetting(targetIndex + offset); + result = (targetIndex + offset); + outTargetIndex = result; + //targetSeverity = BreastSizeIndexToSeverity(result); + targetSeverity = PrivatePartSizeIndexToSeverity(result); + outTargetSeverity = targetSeverity; + return size[result]; + } + } + else + { + if (targetIndex - offset < 0) + return "_-1"; + if (size.Length - (targetIndex - offset) > 0) + { + /* + if (size[targetIndex - offset] != null) + return size[targetIndex - offset]; + */ + //result = findAvailableSmallerSizeFromSetting(targetIndex - offset); + result = (targetIndex - offset); + outTargetIndex = result; + //targetSeverity = BreastSizeIndexToSeverity(result); + targetSeverity = PrivatePartSizeIndexToSeverity(result); + outTargetSeverity = targetSeverity; + return size[result]; + } + } + } + return "_-1"; + } + + + public static string BreastSeverityString(float BreastSeverity, int offset, bool findBigger) + { + int breastResultIndex = 0; + float breastResultFloat = 0; + return BreastSeverityString(BreastSeverity, offset, findBigger, ref breastResultIndex, ref breastResultFloat); + } + + + + public static string BreastSeverityString(float BreastSeverity, int offset, bool findBigger, ref int outTargetIndex, ref float outTargetSeverity) + { + + { + /* old method + if (offset == 0) + { + if (BreastSeverity <= 0.1f) + return micro; //micro, flat + if (BreastSeverity <= 0.05f) + return small; // small , tight + if (BreastSeverity <= 0.25f) + return average; // average + if (BreastSeverity <= 0.70f) + return large; // large , loose + if (BreastSeverity <= 0.90f) + return huge; // huge , gaping + if (BreastSeverity <= 1.01f) + return oversized; // oversized + return String.Empty; // none + } + if (offset == 1) + { + if (BreastSeverity <= 0.1f) + return micro; //micro, flat + if (BreastSeverity <= 0.05f) + return small; // small , tight + if (BreastSeverity <= 0.25f) + return average; // average + if (BreastSeverity <= 0.70f) + return large; // large , loose + if (BreastSeverity <= 0.90f) + return huge; // huge , gaping + if (BreastSeverity <= 1.01f) + return oversized; // oversized + return String.Empty; // none + } + if (offset == 2) + { + if (BreastSeverity <= 0.1f) + return micro; //micro, flat + if (BreastSeverity <= 0.05f) + return small; // small , tight + if (BreastSeverity <= 0.25f) + return average; // average + if (BreastSeverity <= 0.70f) + return large; // large , loose + if (BreastSeverity <= 0.90f) + return huge; // huge , gaping + if (BreastSeverity <= 1.01f) + return oversized; // oversized + return String.Empty; // none + } + if (offset == 3) + { + if (BreastSeverity <= 0.1f) + return micro; //micro, flat + if (BreastSeverity <= 0.05f) + return small; // small , tight + if (BreastSeverity <= 0.25f) + return average; // average + if (BreastSeverity <= 0.70f) + return large; // large , loose + if (BreastSeverity <= 0.90f) + return huge; // huge , gaping + if (BreastSeverity <= 1.01f) + return oversized; // oversized + return String.Empty; // none + } + if (offset == 4) + { + if (BreastSeverity <= 0.1f) + return micro; //micro, flat + if (BreastSeverity <= 0.05f) + return small; // small , tight + if (BreastSeverity <= 0.25f) + return average; // average + if (BreastSeverity <= 0.70f) + return large; // large , loose + if (BreastSeverity <= 0.90f) + return huge; // huge , gaping + if (BreastSeverity <= 1.01f) + return oversized; // oversized + return String.Empty; // none + } + if (offset == 5) + { + if (BreastSeverity <= 0.1f) + return micro; //micro, flat + if (BreastSeverity <= 0.05f) + return small; // small , tight + if (BreastSeverity <= 0.25f) + return average; // average + if (BreastSeverity <= 0.70f) + return large; // large , loose + if (BreastSeverity <= 0.90f) + return huge; // huge , gaping + if (BreastSeverity <= 1.01f) + return oversized; // oversized + return String.Empty; // none + } + return String.Empty; // none } + */ + }//Old Method + int targetIndex = -1; + float targetSeverity = 0; + int result = -1; + if (offset >= 0) + { + { + if (BreastSeverity < 0f)//Error Serverity + { + targetIndex = -1; + targetSeverity = 0; + } + else if (BreastSeverity < 0.02f) + { + targetIndex = findAvailableSmallerSizeFromSetting(0); + targetSeverity = 0.01f; + } + else if (BreastSeverity < 0.2f) + { + targetIndex = findAvailableSmallerSizeFromSetting(1); + targetSeverity = 0.02f; + } + else if (BreastSeverity < 0.40f) + { + targetIndex = findAvailableSmallerSizeFromSetting(2); + targetSeverity = 0.2f; + } + else if (BreastSeverity < 0.60f) + { + targetIndex = findAvailableSmallerSizeFromSetting(3); + targetSeverity = 0.40f; + } + else if (BreastSeverity < 0.80f) + { + targetIndex = findAvailableSmallerSizeFromSetting(4); + targetSeverity = 0.60f; + } + else if (BreastSeverity < 1.0f) + { + targetIndex = findAvailableSmallerSizeFromSetting(5); + targetSeverity = 0.80f; + } + else if (BreastSeverity < 1.2f) + { + targetIndex = findAvailableSmallerSizeFromSetting(6); + targetSeverity = 1.0f; + } + else if (BreastSeverity < 1.4f) + { + targetIndex = findAvailableSmallerSizeFromSetting(7); + targetSeverity = 1.2f; + } + else if (BreastSeverity < 1.6f) + { + targetIndex = findAvailableSmallerSizeFromSetting(8); + targetSeverity = 1.4f; + } + else if (BreastSeverity < 1.8f) + { + targetIndex = findAvailableSmallerSizeFromSetting(9); + targetSeverity = 1.6f; + } + else + { + targetIndex = findAvailableSmallerSizeFromSetting(10); + targetSeverity = 1.8f; + } + //if (targetIndex - offset < 0) + // return "_-1"; + } + + if (findBigger) + { + if (size.Length - (targetIndex + offset) > 0) + { + + //size.Length< targetIndex + offset + /* + if (size[targetIndex + offset] != null) + return size[targetIndex + offset]; + */ + result = findAvailableBiggerSizeFromSetting(targetIndex + offset); + outTargetIndex = result; + targetSeverity = BreastSizeIndexToSeverity(result); + outTargetSeverity = targetSeverity; + return size[result]; + } + } + else + { + if (targetIndex - offset < 0) + return "_-1"; + if (size.Length - (targetIndex - offset) > 0) + { + /* + if (size[targetIndex - offset] != null) + return size[targetIndex - offset]; + */ + result = findAvailableSmallerSizeFromSetting(targetIndex - offset); + outTargetIndex = result; + targetSeverity = BreastSizeIndexToSeverity(result); + outTargetSeverity = targetSeverity; + return size[result]; + } + } + } + return "_-1"; + } + + public static bool isPawnNaked(Pawn pawn, PawnRenderFlags flags = PawnRenderFlags.Clothes, bool fromGraphicRecord = true) + { + if (!flags.FlagSet(PawnRenderFlags.Clothes)) + return true; + if (fromGraphicRecord) + { + if (pawn.Drawer?.renderer?.graphics?.apparelGraphics == null) + return true; + foreach (ApparelGraphicRecord ap in pawn.Drawer.renderer.graphics.apparelGraphics)//Apparel ap in pawn.apparel.WornApparel + { + foreach (BodyPartGroupDef bpgd in ap.sourceApparel.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + if (bpgd.defName == "Chest" || bpgd.defName == "Torso") + { + return false; + } + } + } + } + else + { + if (pawn.apparel == null) + return true; + foreach (Apparel ap in pawn.apparel.WornApparel) + { + foreach (BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + if (bpgd.defName == "Chest" || bpgd.defName == "Torso") + { + return false; + } + } + } + } + + return true; + } + + + + + + + //for displayed apparel only + [Obsolete] + public static bool hasUnSupportedApparel(Pawn pawn, float BreastSeverity, Hediff breastHediff)//only check chest and torso for now + { + + /* + ApparelRecorderComp apparelRecorder = pawn.TryGetComp(); + if(apparelRecorder == null) + { + Log.Message("No ApparelRecorder Found"); + //Log.Message("Add ApparelRecorder"); + apparelRecorder = new ApparelRecorderComp(); + pawn.AllComps.Add(apparelRecorder); + apparelRecorder.Initialize(new ApparelRecorderCompProperties()); + + + } + */ + //Log.Message("Check hasUnSupportedApparel"); + bool hasUnsupportedApparel = false; + + foreach (ApparelGraphicRecord ap in pawn.Drawer.renderer.graphics.apparelGraphics)//Apparel ap in pawn.apparel.WornApparel + { + bool isChest = false; + foreach (BodyPartGroupDef bpgd in ap.sourceApparel.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + if (bpgd.defName == "Chest" || bpgd.defName == "Torso") + { + isChest = true; + break; + } + } + if (isChest) + { + string path; + string extraPath; + string searchingPath; + int offset = 0; + int currentIndex = 0; + float currentSeverity = 0; + //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; + //path = agr.graphic.path; + //path = ap.def.apparel.wornGraphicPath + "_" + pawn.story.bodyType.defName; + if (pawn.story?.bodyType?.defName != null) + path = ap.sourceApparel.def.apparel.wornGraphicPath + "_" + pawn.story.bodyType.defName; + else + path = ap.sourceApparel.def.apparel.wornGraphicPath; + if (breastHediff != null) + { + extraPath = path + "_" + breastHediff.def.defName; + } + else + extraPath = path; + + bool validTexture = false; + + bool findBigger = true; // if false : search smaller first + while (offset < size.Length) + { + if (breastHediff != null) + { + searchingPath = extraPath + BreastSeverityString(BreastSeverity, offset, findBigger,ref currentIndex,ref currentSeverity) + "_south"; + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + + if (ContentFinder.Get((searchingPath), false) != null) // checking special texture like udder + { + validTexture = true; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Found"); + break; + } + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Not Found."); + } + searchingPath = path + BreastSeverityString(BreastSeverity, offset, findBigger, ref currentIndex,ref currentSeverity) + "_south"; + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + if ((ContentFinder.Get((searchingPath), false) != null)) + { + validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Found"); + break; + } + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture."); + offset++; + + } + + if (validTexture == false) + { + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger ."); + } + + + if (validTexture == false) + { + offset = 0; + while (offset < size.Length) + { + if (breastHediff != null) + { + searchingPath = extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentIndex,ref currentSeverity) + "_south"; + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + if (ContentFinder.Get((searchingPath), false) != null) // checking special texture like udder + { + validTexture = true; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Found"); + break; + } + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); + } + searchingPath = path + BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentIndex, ref currentSeverity) + "_south"; + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + if ((ContentFinder.Get((searchingPath), false) != null)) + { + validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + break; + } + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture."); + offset++; + } + } + + if (validTexture == false) + { + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. hide breasts ."); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //graphic = GraphicDatabase.Get(path, ShaderDatabase.Cutout, agr.graphic.drawSize, agr.graphic.color); + hasUnsupportedApparel = true; + if (SizedApparelSettings.Debug == false) + break; + Log.Warning("[Sized Apparel] " + pawn.Name + "'s Unsupported Apparel: " + path); + } + + } + + + } + + //apparelRecorder.SetHasUnsupportedApparel(hasUnsupportedApparel); + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] "+pawn.Name + " has unsupported apparel?: " + hasUnsupportedApparel.ToString()); + return hasUnsupportedApparel; + } + + public static bool hasUnSupportedApparelFromWornData(Pawn pawn, float BreastSeverity, Hediff breastHediff, bool cacheToComp = false, bool fromGraphicRecord = false)//only check chest and torso for now + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": hasUnSupportedApparel Testing..."); + /* + ApparelRecorderComp apparelRecorder = pawn.TryGetComp(); + if(apparelRecorder == null) + { + Log.Message("No ApparelRecorder Found"); + //Log.Message("Add ApparelRecorder"); + apparelRecorder = new ApparelRecorderComp(); + pawn.AllComps.Add(apparelRecorder); + apparelRecorder.Initialize(new ApparelRecorderCompProperties()); + + + } + */ + //Log.Message("Check hasUnSupportedApparel"); + bool hasUnsupportedApparel = false; + var comp = pawn.TryGetComp(); + if (!pawn.RaceProps.Humanlike) + return true; + List apparels = new List(); + if (!fromGraphicRecord) + { + foreach (Apparel worn in pawn.apparel.WornApparel) + { + //Only apparel that has graphic + if(worn.Graphic!=null) + apparels.Add(worn); + } + } + + /* + if (isPawnNaked(pawn, fromGraphicRecord)) + { + if (cacheToComp) + comp.hasUnsupportedApparel = false; + return false; + }*/ + + else + { + foreach (ApparelGraphicRecord agr in pawn.Drawer.renderer.graphics.apparelGraphics) + { + apparels.Add(agr.sourceApparel); + } + } + if(cacheToComp) + comp.BreastSeverityCache = 1000; + + foreach (Apparel ap in apparels)//Apparel ap in pawn.apparel.WornApparel + { + bool isChest = false; + + if (ap.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_IgnorBreastSize".ToLower()))//skip tags + continue; + + foreach (BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + if (bpgd.defName == "Chest" || bpgd.defName == "Torso") + { + isChest = true; + break; + } + } + + + //isChest = (ap.def.apparel.bodyPartGroups.First((BodyPartGroupDef bpgd) => bpgd.defName == "Chest" || bpgd.defName == "Torso")!=null); + if (isChest) + { + /////TODO: caching Apparel Check Data + /* + if (!sizedApparelSupportCache.ContainsKey(ap.def.defName)) + sizedApparelSupportCache.Add(ap.def.defName, new Dictionary>()); + var apparelCache = sizedApparelSupportCache[ap.def.defName]; + if (!apparelCache.ContainsKey(pawn.story.bodyType.defName)) + apparelCache.Add(pawn.story.bodyType.defName, new List()); + var apparelBodyTypeCache = apparelCache[pawn.story.bodyType.defName]; + int breastSeverityInt = BreastSeverityInt(BreastSeverity); + if (apparelBodyTypeCache.Count <= breastSeverityInt) + { + + }*/ + + + string path; + string extraPath; + string searchingPath; + int offset = 0; + int currentIndex = 0; + float currentSeverity = BreastSeverity; + //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; + //path = agr.graphic.path; + //path = ap.def.apparel.wornGraphicPath + "_" + pawn.story.bodyType.defName; + path = ap.WornGraphicPath + "_" + pawn.story.bodyType.defName; + if (breastHediff != null) + { + extraPath = path + "_" + breastHediff.def.defName; + } + else + extraPath = path; + string resultPath = null; + bool resultOut = false; + var key = new SizedApparelsDatabase.SizedApparelDatabaseKey(path, pawn.def.defName, pawn.story?.bodyType?.defName, pawn.gender, breastHediff?.def.defName, SizedApparelUtility.BreastSeverityInt(BreastSeverity)); + if (SizedApparelSettings.useGenderSpecificTexture) + key.gender = Gender.None; + var result = SizedApparelsDatabase.GetSupportedApparelSizedPath(key,out currentIndex, out currentSeverity).pathWithSizeIndex; + if (comp != null) + { + if (cacheToComp) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] apparel's breasts severity" + currentSeverity); + if (SizedApparelSettings.ForcedSupportApparel) + comp.BreastSeverityCache = currentSeverity; + else + comp.BreastSeverityCache = Math.Min(currentSeverity, comp.BreastSeverityCache); + } + } + if (result == null) + { + if (!SizedApparelSettings.ForcedSupportApparel) + { + hasUnsupportedApparel = true; + break; + } + } + continue; + + bool validTexture = false; + + bool findBigger = true; // if false : search smaller first + while (offset < size.Length) + { + if (breastHediff != null) + { + searchingPath = extraPath + BreastSeverityString(BreastSeverity, offset, findBigger, ref currentIndex, ref currentSeverity) + "_south"; + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + if (ContentFinder.Get((searchingPath), false) != null) // checking special texture like udder + { + validTexture = true; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Found"); + if (comp != null) + { + if (cacheToComp) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] apparel's breasts severity" + currentSeverity); + comp.BreastSeverityCache = Math.Min(currentSeverity, comp.BreastSeverityCache); + } + } + break; + } + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Not Found."); + } + searchingPath = path + BreastSeverityString(BreastSeverity, offset, findBigger, ref currentIndex, ref currentSeverity) + "_south"; + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + if ((ContentFinder.Get((searchingPath), false) != null)) + { + validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Found"); + if (comp != null) + { + if (cacheToComp) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] apparel's breasts severity" + currentSeverity); + comp.BreastSeverityCache = Math.Min(currentSeverity, comp.BreastSeverityCache); + } + } + break; + } + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture."); + offset++; + + } + + if (validTexture == false) + { + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger ."); + } + + + if (validTexture == false) + { + offset = 0; + while (offset < size.Length) + { + if (breastHediff != null) + { + searchingPath = extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentIndex, ref currentSeverity) + "_south"; + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + if (ContentFinder.Get((searchingPath), false) != null) // checking special texture like udder + { + validTexture = true; + //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Found"); + if (comp != null) + { + if (cacheToComp) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] apparel's breasts severity" + currentSeverity); + comp.BreastSeverityCache = Math.Min(currentSeverity, comp.BreastSeverityCache); + } + } + break; + } + //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); + } + searchingPath = (path + BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentIndex, ref currentSeverity) + "_south"); + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); + if ((ContentFinder.Get(searchingPath, false) != null)) + { + validTexture = true; + //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); + if (comp != null) + { + if (cacheToComp) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] apparel's breasts severity" + currentSeverity); + comp.BreastSeverityCache = Math.Min(currentSeverity, comp.BreastSeverityCache); + } + } + break; + } + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture."); + offset++; + } + } + + if (validTexture == false) + { + //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. hide breasts ."); + //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); + //graphic = GraphicDatabase.Get(path, ShaderDatabase.Cutout, agr.graphic.drawSize, agr.graphic.color); + hasUnsupportedApparel = true; + + if (SizedApparelSettings.Debug == false) + break; + Log.Warning("[Sized Apparel] " + pawn.Name + "'s Unsupported Apparel: " + path); + } + + } + + + } + + //apparelRecorder.SetHasUnsupportedApparel(hasUnsupportedApparel); + if (SizedApparelSettings.Debug) + { + Log.Message("[Sized Apparel]" + pawn.Name + " has unsupported apparel?: " + hasUnsupportedApparel.ToString()); + if(cacheToComp) + Log.Message("[Sized Apparel] cached breasts severity" + comp.BreastSeverityCache); + } + + + + + return hasUnsupportedApparel; + } + + public static void UpdateAllApparel(Pawn pawn, bool onlyGraphicRecords = false)//need to be update before call it + { + if (pawn == null) + return; + var comp = pawn.TryGetComp(); + if (comp == null) + return; + PawnGraphicSet pawnGraphicSet = pawn.Drawer?.renderer?.graphics; + if (pawnGraphicSet == null) + return; + if (pawnGraphicSet.apparelGraphics.NullOrEmpty()) + return; + if(onlyGraphicRecords) + { + if (pawn.story == null) + return; + + //List copy = pawnGraphicSet.apparelGraphics.ToList(); + List loc = new List(); + for (int i = 0; i< pawnGraphicSet.apparelGraphics.Count; i++) + { + ApparelGraphicRecord agr = pawnGraphicSet.apparelGraphics[i]; + ApparelGraphicRecord graphicOut; + + BodyTypeDef bodyType = null; + if (pawn.story != null) + bodyType = pawn.story.bodyType; + + if (ApparelGraphicRecordGetter.TryGetGraphicApparel(agr.sourceApparel, bodyType, out graphicOut)) + { + //agr.graphic = graphicOut.graphic; + loc.Add(graphicOut); + } + // + + //bool flag = false; + //GetApparelGraphicFix.Postfix(agr.sourceApparel, pawn.story.bodyType, ref agr, ref flag); + //agr.graphic = graphicOut.graphic; + } + pawnGraphicSet.apparelGraphics = loc; + + return; + } + + pawnGraphicSet.ResolveApparelGraphics(); + } + + + public static bool CanDrawBreasts(Pawn pawn, PawnRenderFlags flags = PawnRenderFlags.None, bool fromGraphicRecord = true) + { + if (pawn == null) + return false; + var comp = pawn.TryGetComp(); + if (comp == null) + return false; + if (!flags.FlagSet(PawnRenderFlags.Clothes)) + return true; + if (comp.hasUnsupportedApparel) + return isPawnNaked(pawn, flags, fromGraphicRecord); + return true; + } + + public static bool CanDrawPenis(Pawn pawn, PawnRenderFlags flags = PawnRenderFlags.None, bool fromGraphicRecord = true)//Notion: like pants, there is apparel with no graphic but still cover penis. + { + if (pawn == null) + return false; + var comp = pawn.TryGetComp(); + if (comp == null) + return false; + if (!flags.FlagSet(PawnRenderFlags.Clothes)) + return true; + if (fromGraphicRecord) + { + if (pawn.Drawer?.renderer?.graphics?.apparelGraphics == null) + return true; + foreach (ApparelGraphicRecord ap in pawn.Drawer.renderer.graphics.apparelGraphics)//Apparel ap in pawn.apparel.WornApparel + { + foreach (BodyPartGroupDef bpgd in ap.sourceApparel.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + + if (ap.sourceApparel.def.apparel.CoversBodyPart(Genital_Helper.get_genitalsBPR(pawn)) || ap.sourceApparel.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs)) + { + if (ap.sourceApparel.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_ShowPrivateCrotch".ToLower())) + { + //if (SizedApparelSettings.Debug) + // Log.Message("[SizedApparel]" + pawn.Name + "'s Genitals has coverd but showing for graphic. apparel:" + ap.sourceApparel.def.defName); + continue; + } + return false; + } + } + } + } + else + { + if (pawn.apparel == null) + return true; + foreach (Apparel ap in pawn.apparel.WornApparel) + { + foreach (BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + if (ap.def.apparel.CoversBodyPart(Genital_Helper.get_genitalsBPR(pawn)) || ap.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs)) + { + if (ap.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_ShowPrivateCrotch".ToLower())) + { + //if (SizedApparelSettings.Debug) + // Log.Message("[SizedApparel]" + pawn.Name + "'s Genitals has coverd but showing for graphic. apparel:" + ap.def.defName); + continue; + } + return false; + } + } + } + } + return true; + } + + public static bool CanDrawVagina(Pawn pawn, PawnRenderFlags flags = PawnRenderFlags.None) + { + if (pawn == null) + return false; + var comp = pawn.TryGetComp(); + if (comp == null) + return false; + + if (!flags.FlagSet(PawnRenderFlags.Clothes)) + return true; + return true; + } + + public static bool CanDrawAnus(Pawn pawn, PawnRenderFlags flags = PawnRenderFlags.None) + { + if (pawn == null) + return false; + var comp = pawn.TryGetComp(); + if (comp == null) + return false; + if (!flags.FlagSet(PawnRenderFlags.Clothes)) + return true; + + return true; + } + + public static bool CanDrawUdder(Pawn pawn, PawnRenderFlags flags = PawnRenderFlags.None)//TODO + { + + return false; + + if (!flags.FlagSet(PawnRenderFlags.Clothes)) + return true; + } + + public static bool CanDrawBelly(Pawn pawn, PawnRenderFlags flags = PawnRenderFlags.None, bool fromGraphicRecord = true) + { + if (pawn == null) + return false; + var comp = pawn.TryGetComp(); + if (comp == null) + return false; + + if (!flags.FlagSet(PawnRenderFlags.Clothes)) + return true; + + if (fromGraphicRecord) + { + if (pawn.Drawer?.renderer?.graphics?.apparelGraphics == null) + return true; + foreach (ApparelGraphicRecord ap in pawn.Drawer.renderer.graphics.apparelGraphics)//Apparel ap in pawn.apparel.WornApparel + { + if (ap.sourceApparel.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_ShowBelly".ToLower())) + continue; + foreach (BodyPartGroupDef bpgd in ap.sourceApparel.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + if (bpgd.defName == "Torso") + { + return false; + } + } + } + } + else + { + if (pawn.apparel == null) + return true; + foreach (Apparel ap in pawn.apparel.WornApparel) + { + if (ap.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_ShowBelly".ToLower())) + continue; + foreach (BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups)//BodyPartGroupDef bpgd in ap.def.apparel.bodyPartGroups + { + if (bpgd.defName == "Torso") + { + return false; + } + } + } + } + + return true; + + } + + } + + + +} diff --git a/1.3/source/SizedApparel/SizedApparelforRJW.csproj b/1.3/source/SizedApparel/SizedApparelforRJW.csproj new file mode 100644 index 0000000..50ddab0 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelforRJW.csproj @@ -0,0 +1,102 @@ + + + + + Debug + AnyCPU + {B06471B4-4C6C-478B-B94D-71CC53ABD24D} + Library + Properties + SizedApparel + SizedApparelforRJW + v4.7.2 + 512 + true + + + + true + full + false + ..\..\1.3\Assemblies\ + DEBUG;TRACE + prompt + 4 + false + true + + + none + true + ..\..\1.3\Assemblies\ + TRACE + prompt + 4 + false + true + + + + ..\..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll + False + + + ..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\..\..\..\..\..\workshop\content\294100\818773962\v1.1\Assemblies\HugsLib.dll + False + + + ..\..\..\rimnude-unofficial\1.3 Assembly\Assemblies\RimNudeWorld.dll + False + + + ..\..\..\RJW\1.3\Assemblies\RJW.dll + False + + + + + + + + + ..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll + False + + + ..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + ..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1.3/source/SizedApparel/SizedApparelforRJW.sln b/1.3/source/SizedApparel/SizedApparelforRJW.sln new file mode 100644 index 0000000..84732db --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelforRJW.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.1000 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SizedApparelforRJW", "SizedApparelforRJW.csproj", "{B06471B4-4C6C-478B-B94D-71CC53ABD24D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B06471B4-4C6C-478B-B94D-71CC53ABD24D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B06471B4-4C6C-478B-B94D-71CC53ABD24D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B06471B4-4C6C-478B-B94D-71CC53ABD24D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B06471B4-4C6C-478B-B94D-71CC53ABD24D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CF3F9836-AE71-4CAE-8FFC-72BEB9FFBA91} + EndGlobalSection +EndGlobal diff --git a/1.3/source/SizedApparel/SizedApparelsDatabase.cs b/1.3/source/SizedApparel/SizedApparelsDatabase.cs new file mode 100644 index 0000000..0716f00 --- /dev/null +++ b/1.3/source/SizedApparel/SizedApparelsDatabase.cs @@ -0,0 +1,372 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; +using HarmonyLib; +using UnityEngine; +using rjw; + +namespace SizedApparel +{ + + public static class SizedApparelsDatabase + { + + public struct BodyGraphicKey + { + + } + + + public struct SizedApparelDatabaseKey + { + public string pathWithoutSizeIndex; // Do Not Include Size Data to path! bodytype could be included + public string raceName; + public string bodyTypeName; + public Gender gender; + public string hediffName; + public int targetSize; + public bool isHorny; + public string customPose; + public string variation; + + + public SizedApparelDatabaseKey(string path, string race, string bodyType = null, Gender genderInput = Gender.None , string hediff = null, int size = -1, bool horny = false, string customPose = null, string variation = null) + { + this.pathWithoutSizeIndex = path; + this.raceName = race; + this.bodyTypeName = bodyType; + this.gender = genderInput; + this.hediffName = hediff; + this.targetSize = size; + this.isHorny = horny; + this.customPose = customPose; + this.variation = variation; + } + } + public struct SizedApparelDatabaseKeyComparer : IEqualityComparer + { + public bool Equals(SizedApparelDatabaseKey x, SizedApparelDatabaseKey y) + { + if (x.targetSize != y.targetSize) + return false; + return true && (x.pathWithoutSizeIndex == y.pathWithoutSizeIndex) && (x.bodyTypeName == y.bodyTypeName) && (x.raceName == y.raceName)&& (x.gender == y.gender) && (x.hediffName == y.hediffName) && (x.isHorny == y.isHorny) && (x.customPose == y.customPose) && (x.variation == y.variation); + } + + public int GetHashCode(SizedApparelDatabaseKey obj) + { + return obj.GetHashCode(); + } + } + public struct BodyPartDatabaseKey + { + public string raceName; + public string bodyTypeName; + public string hediffName; + public string folderPath; + public Gender gender; + public int targetSize; + public bool isHorny; + public string customPose; // null custom pose as default pose + public string variation; // null variation as default graphic + + public BodyPartDatabaseKey(string race, string bodyType = null, string hediff = null, string path = null, Gender pawnGender = Gender.None, int size = -1, bool horny = false, string customPose = null, string variation = null) + { + this.raceName = race; + this.bodyTypeName = bodyType; + this.hediffName = hediff; + this.folderPath = path; + this.gender = pawnGender; + this.targetSize = size; + this.isHorny = horny; + this.customPose = customPose; + this.variation = variation; + } + } + public struct BodyPartDatabaseKeyComparer : IEqualityComparer + { + public bool Equals(BodyPartDatabaseKey x, BodyPartDatabaseKey y) + { + if (x.targetSize != y.targetSize) + return false; + return true && (x.raceName == y.raceName) && (x.bodyTypeName == y.bodyTypeName) && (x.hediffName == y.hediffName) && ( x.folderPath == y.folderPath)&& (x.gender == y.gender) && (x.isHorny == y.isHorny) && (x.customPose == y.customPose) && (x.variation == y.variation); + } + + public int GetHashCode(BodyPartDatabaseKey obj) + { + return obj.GetHashCode(); + } + } + public struct PathAndSize + { + public string pathWithSizeIndex; + public int size; + public bool isUnsupportedHumanlikePath; + public bool isCustomPose; + public string hediffName; + public Dictionary points; + + public PathAndSize(string path, int index, bool unsupportedHumanlike = false, bool customPose = false, string hediff = null ,Dictionary pointsInput = null) + { + this.pathWithSizeIndex = path; + this.size = index; + this.isUnsupportedHumanlikePath = unsupportedHumanlike; + this.isCustomPose = customPose; + this.hediffName = hediff; + this.points = pointsInput; + } + } + + private static Dictionary SizedApparelBodyGraphic = new Dictionary(); // TODO + private static Dictionary SupportedApparelResultPath = new Dictionary(new SizedApparelDatabaseKeyComparer()); + private static Dictionary SupportedBodyPartResultPath = new Dictionary(new BodyPartDatabaseKeyComparer()); + private static Dictionary SupportedApparelOriginalPath = new Dictionary(); + + //AlienRace AllowHumanlike. Need to Restart or Clear cache to change options + + + + public static Dictionary AlienRaceUseHumanlike = new Dictionary(); + private static void ResetAlienRaceUseHumanlike() + { + AlienRaceUseHumanlike.Clear(); + IEnumerable HumanlikeRaces; + HumanlikeRaces = DefDatabase.AllDefs.Where(b =>b.race?.Humanlike == true); + + foreach (ThingDef raceDef in HumanlikeRaces) + { + //Default Value Is True + AlienRaceUseHumanlike.Add(raceDef.defName, true); + } + } + + public static bool GetAlienRaceUseHumanlike(string raceDef) + { + if (AlienRaceUseHumanlike.NullOrEmpty()) + { + ResetAlienRaceUseHumanlike(); + } + if (AlienRaceUseHumanlike.ContainsKey(raceDef)) + return AlienRaceUseHumanlike[raceDef]; + return false; + } + + public static List GetAlienRacesDefNames() + { + if (AlienRaceUseHumanlike.NullOrEmpty()) + { + ResetAlienRaceUseHumanlike(); + } + //It must have one or more elements: human. + return AlienRaceUseHumanlike.Keys.ToList(); + } + + + public static void ClearAll() + { + SupportedApparelResultPath.Clear(); + SupportedBodyPartResultPath.Clear(); + SupportedApparelOriginalPath.Clear(); + AlienRaceUseHumanlike.Clear(); + } + + //Apparels, Bodyparts can be used + public static PathAndSize GetSupportedApparelSizedPath(SizedApparelDatabaseKey key) + { + int currentSize = -1; + float currentSeverity = -1; + return GetSupportedApparelSizedPath(key, out currentSize, out currentSeverity); + + } + + public static string GetSupportedApparelOriginalPath(string path) + { + string outString; + if (SupportedApparelOriginalPath.TryGetValue(path, out outString)) + return outString; + return null; + } + + public static Dictionary GetGraphicPoints(string textuerPath) + { + //DefDatabase<> + return null; + } + + public static PathAndSize GetSupportedApparelSizedPath(SizedApparelDatabaseKey key, out int indexOut, out float currentSeverityOut) + { + if (SupportedApparelResultPath.ContainsKey(key)) + { + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] SizedApparelDataBase::ValidKey: "+ key.pathWithoutSizeIndex); + var value = SupportedApparelResultPath.TryGetValue(key); + indexOut = value.size; + currentSeverityOut = SizedApparelUtility.BreastSizeIndexToSeverity(value.size); + if (SizedApparelSettings.Debug) + Log.Message("[Sized Apparel] SizedApparelDataBase::Result Path: " + value.pathWithSizeIndex); + return value; + } + + + if (SizedApparelSettings.Debug) + Log.Message(" [Sized Apparel] SizedApparelDataBase::Key Not Found: " + key.pathWithoutSizeIndex); + + PathAndSize result; + Graphic sourceGraphic = GraphicDatabase.Get(key.pathWithoutSizeIndex); + bool flag; + bool customPose = true; //default none pose also custom pose + string hediffResult; + string targetRaceName; + //if (GetAlienRaceUseHumanlike(key.raceName)) + //TODO. AlienRaceHumanlike + /* + var pawnDef = DefDatabase.GetNamed(key.raceName); + if (pawnDef != null) + { + if(pawnDef.isHumanlike) + targetRaceName = "Humanlike"; + } + + else + targetRaceName = key.raceName;*/ + targetRaceName = key.raceName; + Graphic graphic = null; + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult, targetRaceName, key.hediffName, key.customPose, key.gender);//key.customPose + if(graphic == null && key.gender != Gender.None) + { + //try Genderless + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult, targetRaceName, key.hediffName, key.customPose, Gender.None);//key.customPose + } + + if (key.customPose != null && graphic == null) + { + customPose = false; + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult , targetRaceName, key.hediffName , null ,key.gender); + if (graphic == null && key.gender != Gender.None) + { + //try Genderless + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult, targetRaceName, key.hediffName, null, Gender.None);//key.customPose + } + } + + //Try Find Different Target Size + if (flag == true) + { + result = new PathAndSize(graphic.path, indexOut, false, customPose, hediffResult); + SupportedApparelResultPath.SetOrAdd(key, result); + SupportedApparelOriginalPath.SetOrAdd(result.pathWithSizeIndex, key.pathWithoutSizeIndex); + } + else + { + result = new PathAndSize(null, -1); + SupportedApparelResultPath.SetOrAdd(key, result); + SupportedApparelOriginalPath.SetOrAdd(key.pathWithoutSizeIndex, key.pathWithoutSizeIndex); + } + return result; + } + + public static PathAndSize GetSupportedBodyPartPath(BodyPartDatabaseKey key, bool isBreast, string folderName, string defaultHediffName) + { + PathAndSize result; + if (SupportedBodyPartResultPath.ContainsKey(key)) + return SupportedBodyPartResultPath.TryGetValue(key); + int currentSize = -1; + string hediffResult; + Graphic graphic = null; + if (key.customPose != null) + { + 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); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + if (key.bodyTypeName != null) + 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); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + } + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, null, key.variation, key.gender); + if (graphic != null) + { + result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + if (key.bodyTypeName != null) + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, null, key.variation, key.gender); + if (graphic != null) + { + result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + + //SizedApparelMod.CheckAndLoadAlienRaces(); + //HumanLike Search + var raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == key.raceName); + if (raceSetting !=null && !raceSetting.asHumanlike) //old: !SizedApparelSettings.UnsupportedRaceToUseHumanlike + { + //Cannot find Any result + result = new PathAndSize(null, -1); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + if (key.customPose != null) + { + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); + if (graphic != null) + { + result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + if (key.bodyTypeName != null) + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); + if (graphic != null) + { + result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + } + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); + if (graphic != null) + { + result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + if (key.bodyTypeName != null) + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); + if (graphic != null) + { + result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + + + //Cannot find Any result + result = new PathAndSize(null, -1); + SupportedBodyPartResultPath.SetOrAdd(key, result); + return result; + } + + } +} diff --git a/1.3/source/SizedApparel/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/1.3/source/SizedApparel/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..057ed7f --- /dev/null +++ b/1.3/source/SizedApparel/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/1.3/source/SizedApparel/obj/Debug/SizedApparelforRJW.csproj.AssemblyReference.cache b/1.3/source/SizedApparel/obj/Debug/SizedApparelforRJW.csproj.AssemblyReference.cache new file mode 100644 index 0000000..5147ecf Binary files /dev/null and b/1.3/source/SizedApparel/obj/Debug/SizedApparelforRJW.csproj.AssemblyReference.cache differ diff --git a/1.4/Assemblies/SizedApparelforRJW.dll b/1.4/Assemblies/SizedApparelforRJW.dll new file mode 100644 index 0000000..e437a4f Binary files /dev/null and b/1.4/Assemblies/SizedApparelforRJW.dll differ diff --git a/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Anus.xml b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Anus.xml new file mode 100644 index 0000000..8562e93 --- /dev/null +++ b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Anus.xml @@ -0,0 +1,25 @@ + + + + + AnusDetail + Anus + +
  • + + Anus + +
  • default
  • +
  • Donut
  • + + +
  • + + + + + +
  • +
    +
    +
    diff --git a/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Breasts.xml b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Breasts.xml new file mode 100644 index 0000000..98c3e6a --- /dev/null +++ b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Breasts.xml @@ -0,0 +1,25 @@ + + + + + BreastDetail + Breasts + +
  • + + Breasts + +
  • default
  • +
  • InvertedNipple
  • + + +
  • + + + + + +
  • +
    +
    +
    diff --git a/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Penis.xml b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Penis.xml new file mode 100644 index 0000000..d6b7584 --- /dev/null +++ b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Penis.xml @@ -0,0 +1,18 @@ + + + + + PenisDetail + Penis + +
  • + + Penis + +
  • default
  • + + + +
    +
    +
    diff --git a/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Vagina.xml b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Vagina.xml new file mode 100644 index 0000000..50a0c7a --- /dev/null +++ b/1.4/Defs/BodyPartDetailDefs/BodypartDetail_Vagina.xml @@ -0,0 +1,18 @@ + + + + + VaginaDetail + Vagina + +
  • + + Vagina + +
  • default
  • +
  • Puffy
  • + + +
    +
    +
    diff --git a/Defs/Defs(BodyDefsWip).zip b/1.4/Defs/Defs(BodyDefsWip).zip similarity index 100% rename from Defs/Defs(BodyDefsWip).zip rename to 1.4/Defs/Defs(BodyDefsWip).zip diff --git a/Defs/Defs(wip).zip b/1.4/Defs/Defs(wip).zip similarity index 100% rename from Defs/Defs(wip).zip rename to 1.4/Defs/Defs(wip).zip diff --git a/1.4/Patches/ApparelPatches/Tip_TagList.txt b/1.4/Patches/ApparelPatches/Tip_TagList.txt new file mode 100644 index 0000000..4ccc66a --- /dev/null +++ b/1.4/Patches/ApparelPatches/Tip_TagList.txt @@ -0,0 +1,18 @@ + +SizedApparel_ShowBelly + -don't hide belly even the apparel covers torso + +SizedApparel_ShowPrivateCrotch + -don't hide crotch(genitals and anus) even the apparel covers genitals + +SizedApparel_ShowUdder + -don't hide udder even the apparel covers udder + -wip (not work yet) + +SizedApparel_IgnorBreastSize + -sized apparel mod will just ignore the apparel during calculate breasts size of apparels + -this tag is useful to skip. good example is ratkin shield (the shield is covering breasts) + +SizedApparel_IgnorePose + -when the custom pose is checking posed apparel texture, skip current apparel + -wip \ No newline at end of file diff --git a/1.4/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml b/1.4/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml new file mode 100644 index 0000000..b380b71 --- /dev/null +++ b/1.4/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml @@ -0,0 +1,33 @@ + + + + + +
  • Biotech
  • +
    + + Normal + +
  • + Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags + + Defs/ThingDef[defName = "Apparel_Sash"]/apparel + + +
  • SizedApparel_IgnorBreastSize
  • +
  • SizedApparel_ShowPrivateCrotch
  • + + + + + Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags + +
  • SizedApparel_IgnorBreastSize
  • +
  • SizedApparel_ShowPrivateCrotch
  • +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/1.4/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml.bak b/1.4/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml.bak new file mode 100644 index 0000000..16b1323 --- /dev/null +++ b/1.4/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml.bak @@ -0,0 +1,31 @@ + + + + + +
  • Biotech
  • +
    + + Normal + +
  • + Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags + + Defs/ThingDef[defName = "Apparel_Sash"]/apparel + + +
  • SizedApparel_IgnorBreastSize
  • + + + + + Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags + +
  • SizedApparel_IgnorBreastSize
  • +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/1.4/Patches/ApparelPatches/VanillaCorePatch/DusterShowCrotchPatch.xml b/1.4/Patches/ApparelPatches/VanillaCorePatch/DusterShowCrotchPatch.xml new file mode 100644 index 0000000..34ede94 --- /dev/null +++ b/1.4/Patches/ApparelPatches/VanillaCorePatch/DusterShowCrotchPatch.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + Normal + +
  • + Defs/ThingDef[defName = "Apparel_Duster"]/apparel/tags + + Defs/ThingDef[defName = "Apparel_Duster"]/apparel + + +
  • SizedApparel_ShowPrivateCrotch
  • + + + + + Defs/ThingDef[defName = "Apparel_Duster"]/apparel/tags + +
  • SizedApparel_ShowPrivateCrotch
  • +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/1.4/Patches/ApparelPatches/VanillaCorePatch/ShirtBasicShowCrotchPatch.xml b/1.4/Patches/ApparelPatches/VanillaCorePatch/ShirtBasicShowCrotchPatch.xml new file mode 100644 index 0000000..7840c82 --- /dev/null +++ b/1.4/Patches/ApparelPatches/VanillaCorePatch/ShirtBasicShowCrotchPatch.xml @@ -0,0 +1,25 @@ + + + + Normal + +
  • + Defs/ThingDef[defName = "Apparel_BasicShirt"]/apparel/tags + + Defs/ThingDef[defName = "Apparel_BasicShirt"]/apparel + + +
  • SizedApparel_ShowPrivateCrotch
  • + + + + + Defs/ThingDef[defName = "Apparel_BasicShirt"]/apparel/tags + +
  • SizedApparel_ShowPrivateCrotch
  • +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/1.4/Patches/ApparelPatches/VanillaIdeoPatch/IdeoApparelPatch.xml b/1.4/Patches/ApparelPatches/VanillaIdeoPatch/IdeoApparelPatch.xml new file mode 100644 index 0000000..a548d83 --- /dev/null +++ b/1.4/Patches/ApparelPatches/VanillaIdeoPatch/IdeoApparelPatch.xml @@ -0,0 +1,31 @@ + + + + + +
  • Ideology
  • +
    + + Normal + +
  • + Defs/ThingDef[defName = "Apparel_BodyStrap"]/apparel/tags + + Defs/ThingDef[defName = "Apparel_BodyStrap"]/apparel + + +
  • SizedApparel_IgnorBreastSize
  • + + + + + Defs/ThingDef[defName = "Apparel_BodyStrap"]/apparel/tags + +
  • SizedApparel_IgnorBreastSize
  • +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/1.4/Patches/ApparelRecorderCompPatch.xml b/1.4/Patches/ApparelRecorderCompPatch.xml new file mode 100644 index 0000000..f656b11 --- /dev/null +++ b/1.4/Patches/ApparelRecorderCompPatch.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + /Defs/ThingDef[@Name="BasePawn"]/comps + +
  • + SizedApparel.ApparelRecorderComp +
  • +
    +
    + +
    \ No newline at end of file diff --git a/1.4/Patches/HediffPatches/PrivateHediffPartsPatches.xml b/1.4/Patches/HediffPatches/PrivateHediffPartsPatches.xml new file mode 100644 index 0000000..faec3cd --- /dev/null +++ b/1.4/Patches/HediffPatches/PrivateHediffPartsPatches.xml @@ -0,0 +1,68 @@ + + + + +
  • + /Defs/rjw.HediffDef_PartBase[@Name="RJW_PrivatePartBase"]/comps + + /Defs/rjw.HediffDef_PartBase[@Name="RJW_PrivatePartBase"] + + +
  • + + + + + /Defs/rjw.HediffDef_PartBase[@Name="RJW_PrivatePartBase"]/comps + +
  • + + +
  • + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    \ No newline at end of file diff --git a/1.4/Patches/ThingPatches/BodyPartThingPatch.xml b/1.4/Patches/ThingPatches/BodyPartThingPatch.xml new file mode 100644 index 0000000..19f5f23 --- /dev/null +++ b/1.4/Patches/ThingPatches/BodyPartThingPatch.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + +
  • + /Defs/ThingDef[@Name="rjw_BodyPartBase"]/comps + + /Defs/ThingDef[@Name="rjw_BodyPartBase"] + + +
  • + + + + + /Defs/ThingDef[@Name="rjw_BodyPartBase"]/comps + +
  • + + +
  • + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    \ No newline at end of file diff --git a/About/About.xml b/About/About.xml index 412f697..baa7d1d 100644 --- a/About/About.xml +++ b/About/About.xml @@ -5,11 +5,11 @@
  • 1.3
  • +
  • 1.4
  • OTYOTY.SizedApparel -[version 0.93.0] -[worked for RJW Version: 4.9.8] +[version 0.93.2] This mod changes apparel texture for matching pawn's breasts size. Also, it has include pawn's private body parts rendering system. diff --git a/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_east.png b/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_east.png new file mode 100644 index 0000000..4012944 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_north.png b/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_north.png new file mode 100644 index 0000000..5da79c9 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_south.png b/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_south.png new file mode 100644 index 0000000..4012944 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Anus/Anus_Female_5_Donut_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_east.png new file mode 100644 index 0000000..53a359d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_north.png new file mode 100644 index 0000000..a2203d6 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_south.png new file mode 100644 index 0000000..d91cace Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_5_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_east.png new file mode 100644 index 0000000..5d82098 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_north.png new file mode 100644 index 0000000..667ae05 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_south.png new file mode 100644 index 0000000..1526927 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_7_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_east.png new file mode 100644 index 0000000..683013a Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_north.png new file mode 100644 index 0000000..925ffde Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_south.png new file mode 100644 index 0000000..27c8e7e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_8_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_east.png new file mode 100644 index 0000000..a13e692 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_north.png new file mode 100644 index 0000000..f308203 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_south.png new file mode 100644 index 0000000..b84eda8 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/128/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_east.png new file mode 100644 index 0000000..6d50489 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_north.png new file mode 100644 index 0000000..9411416 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_south.png new file mode 100644 index 0000000..2ab4707 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_5_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_east.png new file mode 100644 index 0000000..61d1360 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_north.png new file mode 100644 index 0000000..1724f2e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_south.png new file mode 100644 index 0000000..749c659 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/256/Breasts_Female_7_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_east.png new file mode 100644 index 0000000..97c3325 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_north.png new file mode 100644 index 0000000..06aecf1 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_south.png new file mode 100644 index 0000000..05e6a4e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_10_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_east.png new file mode 100644 index 0000000..4e8fc95 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_north.png new file mode 100644 index 0000000..ce604aa Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_south.png new file mode 100644 index 0000000..cd601f2 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_8_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_east.png new file mode 100644 index 0000000..9a3c708 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_north.png new file mode 100644 index 0000000..2098247 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_south.png new file mode 100644 index 0000000..01ab259 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/7~10 not yet ready.txt b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/7~10 not yet ready.txt new file mode 100644 index 0000000..30897b6 --- /dev/null +++ b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/7~10 not yet ready.txt @@ -0,0 +1 @@ +For now, those are just copied, avoid error \ No newline at end of file diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_east.png new file mode 100644 index 0000000..de3a540 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_north.png new file mode 100644 index 0000000..ffa684c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_south.png new file mode 100644 index 0000000..7d320a9 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_0_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_east.png new file mode 100644 index 0000000..97c3325 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_north.png new file mode 100644 index 0000000..06aecf1 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_south.png new file mode 100644 index 0000000..05e6a4e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_10_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_east.png new file mode 100644 index 0000000..f7a7be4 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_north.png new file mode 100644 index 0000000..ffa684c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_south.png new file mode 100644 index 0000000..65c526d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_1_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_east.png new file mode 100644 index 0000000..7c64d0c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_north.png new file mode 100644 index 0000000..7344a01 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_south.png new file mode 100644 index 0000000..b4405ce Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_2_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_3_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_3_east.png new file mode 100644 index 0000000..711f5fb Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_3_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_3_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_3_north.png new file mode 100644 index 0000000..3a0fdaf Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_3_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_east.png new file mode 100644 index 0000000..408eaba Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_north.png new file mode 100644 index 0000000..cdcc59d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_south.png new file mode 100644 index 0000000..6a71272 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_4_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_east.png new file mode 100644 index 0000000..1a991b1 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_north.png new file mode 100644 index 0000000..99464b6 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_south.png new file mode 100644 index 0000000..feb710c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_5_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_east.png new file mode 100644 index 0000000..1c194ed Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_north.png new file mode 100644 index 0000000..896226b Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_south.png new file mode 100644 index 0000000..fde0308 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_6_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_east.png new file mode 100644 index 0000000..2e80d11 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_north.png new file mode 100644 index 0000000..2d0ae19 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_south.png new file mode 100644 index 0000000..cfdce29 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_7_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_east.png new file mode 100644 index 0000000..4e8fc95 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_north.png new file mode 100644 index 0000000..ce604aa Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_south.png new file mode 100644 index 0000000..cd601f2 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_8_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_east.png new file mode 100644 index 0000000..9a3c708 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_north.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_north.png new file mode 100644 index 0000000..2098247 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_south.png new file mode 100644 index 0000000..01ab259 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/CustomPose/JiggleUp/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_10_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_10_east.png new file mode 100644 index 0000000..1264d93 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_10_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_10_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_10_south.png new file mode 100644 index 0000000..5f8fe6a Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_10_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_9_east.png new file mode 100644 index 0000000..b1bd9e2 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_9_south.png new file mode 100644 index 0000000..532b851 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Breasts/temp/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Penis (2).zip b/Textures/SizedApparel/BodyParts/Human/Penis (2).zip deleted file mode 100644 index fc29daa..0000000 Binary files a/Textures/SizedApparel/BodyParts/Human/Penis (2).zip and /dev/null differ diff --git a/Textures/SizedApparel/BodyParts/Human/Penis.zip b/Textures/SizedApparel/BodyParts/Human/Penis.zip deleted file mode 100644 index 56ece50..0000000 Binary files a/Textures/SizedApparel/BodyParts/Human/Penis.zip and /dev/null differ diff --git a/Textures/SizedApparel/BodyParts/Human/Penis/Balls/Penis_Male_2_north.png b/Textures/SizedApparel/BodyParts/Human/Penis/Balls/Penis_Male_2_north.png index bcaed51..ebfcfcd 100644 Binary files a/Textures/SizedApparel/BodyParts/Human/Penis/Balls/Penis_Male_2_north.png and b/Textures/SizedApparel/BodyParts/Human/Penis/Balls/Penis_Male_2_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_east.png b/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_east.png new file mode 100644 index 0000000..d3da276 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_north.png b/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_north.png new file mode 100644 index 0000000..14c0f4b Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_south.png b/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_south.png new file mode 100644 index 0000000..05b128d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Human/Penis/HorsePenis_Male_2_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Human/wip.zip b/Textures/SizedApparel/BodyParts/Human/wip.zip deleted file mode 100644 index 90cb4fc..0000000 Binary files a/Textures/SizedApparel/BodyParts/Human/wip.zip and /dev/null differ diff --git a/Textures/SizedApparel/BodyParts/Human/wip.zip.old b/Textures/SizedApparel/BodyParts/Human/wip.zip.old deleted file mode 100644 index be8b3f0..0000000 Binary files a/Textures/SizedApparel/BodyParts/Human/wip.zip.old and /dev/null differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_east.png new file mode 100644 index 0000000..4012944 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_north.png new file mode 100644 index 0000000..5da79c9 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_south.png new file mode 100644 index 0000000..4012944 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Anus/Anus_Female_5_Donut_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_east.png new file mode 100644 index 0000000..53a359d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_north.png new file mode 100644 index 0000000..a2203d6 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_south.png new file mode 100644 index 0000000..d91cace Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_5_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_east.png new file mode 100644 index 0000000..5d82098 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_north.png new file mode 100644 index 0000000..667ae05 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_south.png new file mode 100644 index 0000000..1526927 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_7_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_east.png new file mode 100644 index 0000000..683013a Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_north.png new file mode 100644 index 0000000..925ffde Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_south.png new file mode 100644 index 0000000..27c8e7e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_8_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_east.png new file mode 100644 index 0000000..a13e692 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_north.png new file mode 100644 index 0000000..f308203 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_south.png new file mode 100644 index 0000000..b84eda8 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/128/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_east.png new file mode 100644 index 0000000..6d50489 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_north.png new file mode 100644 index 0000000..9411416 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_south.png new file mode 100644 index 0000000..2ab4707 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_5_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_east.png new file mode 100644 index 0000000..61d1360 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_north.png new file mode 100644 index 0000000..1724f2e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_south.png new file mode 100644 index 0000000..749c659 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/256/Breasts_Female_7_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_east.png new file mode 100644 index 0000000..97c3325 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_north.png new file mode 100644 index 0000000..06aecf1 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_south.png new file mode 100644 index 0000000..05e6a4e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_10_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_east.png new file mode 100644 index 0000000..4e8fc95 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_north.png new file mode 100644 index 0000000..ce604aa Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_south.png new file mode 100644 index 0000000..cd601f2 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_8_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_east.png new file mode 100644 index 0000000..9a3c708 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_north.png new file mode 100644 index 0000000..2098247 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_south.png new file mode 100644 index 0000000..01ab259 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/7~10 not yet ready.txt b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/7~10 not yet ready.txt new file mode 100644 index 0000000..30897b6 --- /dev/null +++ b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/7~10 not yet ready.txt @@ -0,0 +1 @@ +For now, those are just copied, avoid error \ No newline at end of file diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_east.png new file mode 100644 index 0000000..de3a540 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_north.png new file mode 100644 index 0000000..ffa684c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_south.png new file mode 100644 index 0000000..7d320a9 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_0_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_east.png new file mode 100644 index 0000000..97c3325 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_north.png new file mode 100644 index 0000000..06aecf1 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_south.png new file mode 100644 index 0000000..05e6a4e Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_10_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_east.png new file mode 100644 index 0000000..f7a7be4 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_north.png new file mode 100644 index 0000000..ffa684c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_south.png new file mode 100644 index 0000000..65c526d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_1_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_east.png new file mode 100644 index 0000000..7c64d0c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_north.png new file mode 100644 index 0000000..7344a01 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_south.png new file mode 100644 index 0000000..b4405ce Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_2_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_3_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_3_east.png new file mode 100644 index 0000000..711f5fb Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_3_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_3_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_3_north.png new file mode 100644 index 0000000..3a0fdaf Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_3_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_east.png new file mode 100644 index 0000000..408eaba Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_north.png new file mode 100644 index 0000000..cdcc59d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_south.png new file mode 100644 index 0000000..6a71272 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_4_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_east.png new file mode 100644 index 0000000..1a991b1 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_north.png new file mode 100644 index 0000000..99464b6 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_south.png new file mode 100644 index 0000000..feb710c Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_5_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_east.png new file mode 100644 index 0000000..1c194ed Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_north.png new file mode 100644 index 0000000..896226b Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_south.png new file mode 100644 index 0000000..fde0308 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_6_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_east.png new file mode 100644 index 0000000..2e80d11 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_north.png new file mode 100644 index 0000000..2d0ae19 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_south.png new file mode 100644 index 0000000..cfdce29 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_7_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_east.png new file mode 100644 index 0000000..4e8fc95 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_north.png new file mode 100644 index 0000000..ce604aa Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_south.png new file mode 100644 index 0000000..cd601f2 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_8_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_east.png new file mode 100644 index 0000000..9a3c708 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_north.png new file mode 100644 index 0000000..2098247 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_south.png new file mode 100644 index 0000000..01ab259 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/CustomPose/JiggleUp/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_10_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_10_east.png new file mode 100644 index 0000000..1264d93 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_10_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_10_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_10_south.png new file mode 100644 index 0000000..5f8fe6a Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_10_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_9_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_9_east.png new file mode 100644 index 0000000..b1bd9e2 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_9_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_9_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_9_south.png new file mode 100644 index 0000000..532b851 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Breasts/temp/Breasts_Female_9_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Penis/Balls/Penis_Male_2_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Penis/Balls/Penis_Male_2_north.png index bcaed51..ebfcfcd 100644 Binary files a/Textures/SizedApparel/BodyParts/Humanlike/Penis/Balls/Penis_Male_2_north.png and b/Textures/SizedApparel/BodyParts/Humanlike/Penis/Balls/Penis_Male_2_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Penis/Horny/Penis_Thin_2_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Penis/Horny/Penis_Thin_2_south.png index f2cb4c9..fc064b2 100644 Binary files a/Textures/SizedApparel/BodyParts/Humanlike/Penis/Horny/Penis_Thin_2_south.png and b/Textures/SizedApparel/BodyParts/Humanlike/Penis/Horny/Penis_Thin_2_south.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_east.png b/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_east.png new file mode 100644 index 0000000..d3da276 Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_east.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_north.png b/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_north.png new file mode 100644 index 0000000..14c0f4b Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_north.png differ diff --git a/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_south.png b/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_south.png new file mode 100644 index 0000000..05b128d Binary files /dev/null and b/Textures/SizedApparel/BodyParts/Humanlike/Penis/HorsePenis_Male_2_south.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron.png b/Textures/Things/Apparel/Apron/source/Apron.png new file mode 100644 index 0000000..f14cd70 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Fat_east.png b/Textures/Things/Apparel/Apron/source/Apron_Fat_east.png new file mode 100644 index 0000000..64ce7ed Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Fat_east.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Fat_north.png b/Textures/Things/Apparel/Apron/source/Apron_Fat_north.png new file mode 100644 index 0000000..8f864e5 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Fat_north.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Fat_south.png b/Textures/Things/Apparel/Apron/source/Apron_Fat_south.png new file mode 100644 index 0000000..d085270 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Fat_south.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Female_east.png b/Textures/Things/Apparel/Apron/source/Apron_Female_east.png new file mode 100644 index 0000000..1b3d635 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Female_east.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Female_north.png b/Textures/Things/Apparel/Apron/source/Apron_Female_north.png new file mode 100644 index 0000000..35dc25e Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Female_north.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Female_south.png b/Textures/Things/Apparel/Apron/source/Apron_Female_south.png new file mode 100644 index 0000000..f0ab058 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Female_south.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Hulk_east.png b/Textures/Things/Apparel/Apron/source/Apron_Hulk_east.png new file mode 100644 index 0000000..80f1db2 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Hulk_east.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Hulk_north.png b/Textures/Things/Apparel/Apron/source/Apron_Hulk_north.png new file mode 100644 index 0000000..998760c Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Hulk_north.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Hulk_south.png b/Textures/Things/Apparel/Apron/source/Apron_Hulk_south.png new file mode 100644 index 0000000..56bc7ff Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Hulk_south.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Male_east.png b/Textures/Things/Apparel/Apron/source/Apron_Male_east.png new file mode 100644 index 0000000..0388f48 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Male_east.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Male_north.png b/Textures/Things/Apparel/Apron/source/Apron_Male_north.png new file mode 100644 index 0000000..9a85476 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Male_north.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Male_south.png b/Textures/Things/Apparel/Apron/source/Apron_Male_south.png new file mode 100644 index 0000000..1875e42 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Male_south.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Thin_east.png b/Textures/Things/Apparel/Apron/source/Apron_Thin_east.png new file mode 100644 index 0000000..c75fc8e Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Thin_east.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Thin_north.png b/Textures/Things/Apparel/Apron/source/Apron_Thin_north.png new file mode 100644 index 0000000..624bf31 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Thin_north.png differ diff --git a/Textures/Things/Apparel/Apron/source/Apron_Thin_south.png b/Textures/Things/Apparel/Apron/source/Apron_Thin_south.png new file mode 100644 index 0000000..70dd315 Binary files /dev/null and b/Textures/Things/Apparel/Apron/source/Apron_Thin_south.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse.png b/Textures/Things/Apparel/Blouse/source/Blouse.png new file mode 100644 index 0000000..07da9ed Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Fat_east.png b/Textures/Things/Apparel/Blouse/source/Blouse_Fat_east.png new file mode 100644 index 0000000..168f616 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Fat_east.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Fat_north.png b/Textures/Things/Apparel/Blouse/source/Blouse_Fat_north.png new file mode 100644 index 0000000..20345d2 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Fat_north.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Fat_south.png b/Textures/Things/Apparel/Blouse/source/Blouse_Fat_south.png new file mode 100644 index 0000000..465bd18 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Fat_south.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Female_east.png b/Textures/Things/Apparel/Blouse/source/Blouse_Female_east.png new file mode 100644 index 0000000..2a1cc96 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Female_east.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Female_north.png b/Textures/Things/Apparel/Blouse/source/Blouse_Female_north.png new file mode 100644 index 0000000..1d52595 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Female_north.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Female_south.png b/Textures/Things/Apparel/Blouse/source/Blouse_Female_south.png new file mode 100644 index 0000000..6232a5c Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Female_south.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_east.png b/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_east.png new file mode 100644 index 0000000..977cc21 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_east.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_north.png b/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_north.png new file mode 100644 index 0000000..c1c2871 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_north.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_south.png b/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_south.png new file mode 100644 index 0000000..166b7f7 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Hulk_south.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Male_east.png b/Textures/Things/Apparel/Blouse/source/Blouse_Male_east.png new file mode 100644 index 0000000..8035898 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Male_east.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Male_north.png b/Textures/Things/Apparel/Blouse/source/Blouse_Male_north.png new file mode 100644 index 0000000..53a85eb Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Male_north.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Male_south.png b/Textures/Things/Apparel/Blouse/source/Blouse_Male_south.png new file mode 100644 index 0000000..a8bdcc4 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Male_south.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Thin_east.png b/Textures/Things/Apparel/Blouse/source/Blouse_Thin_east.png new file mode 100644 index 0000000..d7df226 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Thin_east.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Thin_north.png b/Textures/Things/Apparel/Blouse/source/Blouse_Thin_north.png new file mode 100644 index 0000000..1f60da8 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Thin_north.png differ diff --git a/Textures/Things/Apparel/Blouse/source/Blouse_Thin_south.png b/Textures/Things/Apparel/Blouse/source/Blouse_Thin_south.png new file mode 100644 index 0000000..5297b89 Binary files /dev/null and b/Textures/Things/Apparel/Blouse/source/Blouse_Thin_south.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket.png new file mode 100644 index 0000000..1f03472 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_east.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_east.png new file mode 100644 index 0000000..454755d Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_east.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_north.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_north.png new file mode 100644 index 0000000..bd6e7c2 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_north.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_south.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_south.png new file mode 100644 index 0000000..34abe08 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Fat_south.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_east.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_east.png new file mode 100644 index 0000000..e6a1982 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_east.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_north.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_north.png new file mode 100644 index 0000000..93447a5 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_north.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_south.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_south.png new file mode 100644 index 0000000..63ecb82 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Female_south.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_east.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_east.png new file mode 100644 index 0000000..df9bc6d Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_east.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_north.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_north.png new file mode 100644 index 0000000..b8346df Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_north.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_south.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_south.png new file mode 100644 index 0000000..8945e25 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Hulk_south.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_east.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_east.png new file mode 100644 index 0000000..6a87094 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_east.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_north.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_north.png new file mode 100644 index 0000000..3a63316 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_north.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_south.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_south.png new file mode 100644 index 0000000..c4f5100 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Male_south.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_east.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_east.png new file mode 100644 index 0000000..51737e5 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_east.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_north.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_north.png new file mode 100644 index 0000000..d8e05d8 Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_north.png differ diff --git a/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_south.png b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_south.png new file mode 100644 index 0000000..2bdf24f Binary files /dev/null and b/Textures/Things/Apparel/BuildersJacket/source/BuildersJacket_Thin_south.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt.png new file mode 100644 index 0000000..bf2e4de Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_east.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_east.png new file mode 100644 index 0000000..b59a5cc Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_east.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_north.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_north.png new file mode 100644 index 0000000..8d7fdbb Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_north.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_south.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_south.png new file mode 100644 index 0000000..0c43e43 Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Fat_south.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_east.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_east.png new file mode 100644 index 0000000..4f76dba Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_east.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_north.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_north.png new file mode 100644 index 0000000..bbaa19e Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_north.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_south.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_south.png new file mode 100644 index 0000000..f3a15b1 Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Female_south.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_east.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_east.png new file mode 100644 index 0000000..1b6c67b Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_east.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_north.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_north.png new file mode 100644 index 0000000..38b89c4 Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_north.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_south.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_south.png new file mode 100644 index 0000000..0781727 Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Hulk_south.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_east.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_east.png new file mode 100644 index 0000000..e5c18ff Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_east.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_north.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_north.png new file mode 100644 index 0000000..01e4982 Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_north.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_south.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_south.png new file mode 100644 index 0000000..4c5601b Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Male_south.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_east.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_east.png new file mode 100644 index 0000000..3ea3041 Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_east.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_north.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_north.png new file mode 100644 index 0000000..d14ccee Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_north.png differ diff --git a/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_south.png b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_south.png new file mode 100644 index 0000000..cff71c7 Binary files /dev/null and b/Textures/Things/Apparel/CasualTShirt/source/CasualTShirt_Thin_south.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform.png new file mode 100644 index 0000000..49fc930 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_east.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_east.png new file mode 100644 index 0000000..1f09202 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_east.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_north.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_north.png new file mode 100644 index 0000000..ce3231f Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_north.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_south.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_south.png new file mode 100644 index 0000000..f361b1f Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Fat_south.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_east.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_east.png new file mode 100644 index 0000000..a67493a Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_east.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_north.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_north.png new file mode 100644 index 0000000..850c8a3 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_north.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_south.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_south.png new file mode 100644 index 0000000..51f210e Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Female_south.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_east.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_east.png new file mode 100644 index 0000000..23ad9b3 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_east.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_north.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_north.png new file mode 100644 index 0000000..3f6641f Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_north.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_south.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_south.png new file mode 100644 index 0000000..6352cfb Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Hulk_south.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_east.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_east.png new file mode 100644 index 0000000..d873784 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_east.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_north.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_north.png new file mode 100644 index 0000000..1d17634 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_north.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_south.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_south.png new file mode 100644 index 0000000..f4849bd Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Male_south.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_east.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_east.png new file mode 100644 index 0000000..ec3f830 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_east.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_north.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_north.png new file mode 100644 index 0000000..92aca60 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_north.png differ diff --git a/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_south.png b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_south.png new file mode 100644 index 0000000..de0bd04 Binary files /dev/null and b/Textures/Things/Apparel/ChefsUniform/source/ChefsUniform_Thin_south.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie.png b/Textures/Things/Apparel/Hoodie/source/Hoodie.png new file mode 100644 index 0000000..96b5c98 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_east.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_east.png new file mode 100644 index 0000000..d7dbbca Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_east.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_north.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_north.png new file mode 100644 index 0000000..3970918 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_north.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_south.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_south.png new file mode 100644 index 0000000..0092e29 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Fat_south.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_east.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_east.png new file mode 100644 index 0000000..4d073a2 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_east.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_north.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_north.png new file mode 100644 index 0000000..a8ce70d Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_north.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_south.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_south.png new file mode 100644 index 0000000..173fecd Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Female_south.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_east.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_east.png new file mode 100644 index 0000000..b3fb284 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_east.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_north.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_north.png new file mode 100644 index 0000000..461389f Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_north.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_south.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_south.png new file mode 100644 index 0000000..7a6616d Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Hulk_south.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_east.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_east.png new file mode 100644 index 0000000..ed0c5d9 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_east.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_north.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_north.png new file mode 100644 index 0000000..b31c097 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_north.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_south.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_south.png new file mode 100644 index 0000000..bcbe9b5 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Male_south.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_east.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_east.png new file mode 100644 index 0000000..dae8ceb Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_east.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_north.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_north.png new file mode 100644 index 0000000..b0452d4 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_north.png differ diff --git a/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_south.png b/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_south.png new file mode 100644 index 0000000..3b21000 Binary files /dev/null and b/Textures/Things/Apparel/Hoodie/source/Hoodie_Thin_south.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit.png new file mode 100644 index 0000000..673b40d Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_east.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_east.png new file mode 100644 index 0000000..ef4ee2d Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_east.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_north.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_north.png new file mode 100644 index 0000000..66cf08b Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_north.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_south.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_south.png new file mode 100644 index 0000000..6bedcc8 Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Fat_south.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_east.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_east.png new file mode 100644 index 0000000..da7762b Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_east.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_north.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_north.png new file mode 100644 index 0000000..d975f0d Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_north.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_south.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_south.png new file mode 100644 index 0000000..5b5d5da Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Female_south.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_east.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_east.png new file mode 100644 index 0000000..0b6376f Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_east.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_north.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_north.png new file mode 100644 index 0000000..ead53d1 Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_north.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_south.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_south.png new file mode 100644 index 0000000..af0f957 Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Hulk_south.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_east.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_east.png new file mode 100644 index 0000000..9df4110 Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_east.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_north.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_north.png new file mode 100644 index 0000000..1e9a0e3 Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_north.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_south.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_south.png new file mode 100644 index 0000000..a55add5 Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Male_south.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_east.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_east.png new file mode 100644 index 0000000..33ab41e Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_east.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_north.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_north.png new file mode 100644 index 0000000..8a99d74 Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_north.png differ diff --git a/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_south.png b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_south.png new file mode 100644 index 0000000..087827a Binary files /dev/null and b/Textures/Things/Apparel/Jumpsuit/source/Jumpsuit_Thin_south.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat.png b/Textures/Things/Apparel/LabCoat/source/LabCoat.png new file mode 100644 index 0000000..48116eb Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_east.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_east.png new file mode 100644 index 0000000..c1e23be Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_east.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_north.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_north.png new file mode 100644 index 0000000..ca86c8c Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_north.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_south.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_south.png new file mode 100644 index 0000000..4479fd9 Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Fat_south.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_east.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_east.png new file mode 100644 index 0000000..09226df Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_east.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_north.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_north.png new file mode 100644 index 0000000..0da1114 Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_north.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_south.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_south.png new file mode 100644 index 0000000..359e84b Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Female_south.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_east.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_east.png new file mode 100644 index 0000000..548f9e5 Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_east.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_north.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_north.png new file mode 100644 index 0000000..08d461b Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_north.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_south.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_south.png new file mode 100644 index 0000000..1e9965a Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Hulk_south.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_east.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_east.png new file mode 100644 index 0000000..332a289 Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_east.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_north.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_north.png new file mode 100644 index 0000000..a465d24 Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_north.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_south.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_south.png new file mode 100644 index 0000000..e7600d3 Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Male_south.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_east.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_east.png new file mode 100644 index 0000000..e7adcae Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_east.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_north.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_north.png new file mode 100644 index 0000000..19f1339 Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_north.png differ diff --git a/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_south.png b/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_south.png new file mode 100644 index 0000000..96cb6ef Binary files /dev/null and b/Textures/Things/Apparel/LabCoat/source/LabCoat_Thin_south.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket.png new file mode 100644 index 0000000..fad7b51 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_east.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_east.png new file mode 100644 index 0000000..1352606 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_east.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_eastm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_eastm.png new file mode 100644 index 0000000..7b02bd8 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_eastm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_north.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_north.png new file mode 100644 index 0000000..8af346a Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_north.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_northm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_northm.png new file mode 100644 index 0000000..5928eee Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_northm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_south.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_south.png new file mode 100644 index 0000000..263a13b Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_south.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_southm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_southm.png new file mode 100644 index 0000000..f113a60 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Fat_southm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_east.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_east.png new file mode 100644 index 0000000..7c4e8a9 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_east.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_eastm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_eastm.png new file mode 100644 index 0000000..dcff5cb Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_eastm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_north.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_north.png new file mode 100644 index 0000000..5b5569c Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_north.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_northm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_northm.png new file mode 100644 index 0000000..f8c8b12 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_northm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_south.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_south.png new file mode 100644 index 0000000..1fcf64f Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_south.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_southm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_southm.png new file mode 100644 index 0000000..71d08df Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Female_southm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_east.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_east.png new file mode 100644 index 0000000..0045389 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_east.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_eastm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_eastm.png new file mode 100644 index 0000000..a634854 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_eastm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_north.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_north.png new file mode 100644 index 0000000..c64f620 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_north.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_northm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_northm.png new file mode 100644 index 0000000..669ec81 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_northm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_south.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_south.png new file mode 100644 index 0000000..a17dc04 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_south.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_southm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_southm.png new file mode 100644 index 0000000..7a04369 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Hulk_southm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_east.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_east.png new file mode 100644 index 0000000..14e37bd Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_east.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_eastm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_eastm.png new file mode 100644 index 0000000..26ce096 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_eastm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_north.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_north.png new file mode 100644 index 0000000..ecd486e Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_north.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_northm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_northm.png new file mode 100644 index 0000000..02e72dc Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_northm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_south.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_south.png new file mode 100644 index 0000000..fcc9c47 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_south.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_southm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_southm.png new file mode 100644 index 0000000..fa357ea Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Male_southm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_east.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_east.png new file mode 100644 index 0000000..ec070f8 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_east.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_eastm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_eastm.png new file mode 100644 index 0000000..c1487cc Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_eastm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_north.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_north.png new file mode 100644 index 0000000..e645ed1 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_north.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_northm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_northm.png new file mode 100644 index 0000000..35ea3eb Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_northm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_south.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_south.png new file mode 100644 index 0000000..38a6480 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_south.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_southm.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_southm.png new file mode 100644 index 0000000..05d79f6 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_Thin_southm.png differ diff --git a/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_m.png b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_m.png new file mode 100644 index 0000000..1454a74 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryJacket/source/MilitaryJacket_m.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform.png new file mode 100644 index 0000000..d32b5be Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_east.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_east.png new file mode 100644 index 0000000..0455492 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_east.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_north.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_north.png new file mode 100644 index 0000000..8031e8b Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_north.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_south.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_south.png new file mode 100644 index 0000000..3ee6fb9 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Fat_south.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_east.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_east.png new file mode 100644 index 0000000..7510fdf Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_east.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_north.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_north.png new file mode 100644 index 0000000..ef128b7 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_north.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_south.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_south.png new file mode 100644 index 0000000..88a37ba Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Female_south.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_east.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_east.png new file mode 100644 index 0000000..b8549d2 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_east.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_north.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_north.png new file mode 100644 index 0000000..e22a623 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_north.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_south.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_south.png new file mode 100644 index 0000000..794588c Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Hulk_south.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_east.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_east.png new file mode 100644 index 0000000..b9a9e5a Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_east.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_north.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_north.png new file mode 100644 index 0000000..56f4a30 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_north.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_south.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_south.png new file mode 100644 index 0000000..e71f373 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Male_south.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_east.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_east.png new file mode 100644 index 0000000..11ddc73 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_east.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_north.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_north.png new file mode 100644 index 0000000..02e20a4 Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_north.png differ diff --git a/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_south.png b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_south.png new file mode 100644 index 0000000..e66413f Binary files /dev/null and b/Textures/Things/Apparel/MilitaryUniform/source/MilitaryUniform_Thin_south.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls.png b/Textures/Things/Apparel/Overalls/source/Overalls.png new file mode 100644 index 0000000..06e7cf5 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Fat_east.png b/Textures/Things/Apparel/Overalls/source/Overalls_Fat_east.png new file mode 100644 index 0000000..a5270d9 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Fat_east.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Fat_north.png b/Textures/Things/Apparel/Overalls/source/Overalls_Fat_north.png new file mode 100644 index 0000000..ec55d09 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Fat_north.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Fat_south.png b/Textures/Things/Apparel/Overalls/source/Overalls_Fat_south.png new file mode 100644 index 0000000..d1b3a89 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Fat_south.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Female_east.png b/Textures/Things/Apparel/Overalls/source/Overalls_Female_east.png new file mode 100644 index 0000000..e71f039 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Female_east.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Female_north.png b/Textures/Things/Apparel/Overalls/source/Overalls_Female_north.png new file mode 100644 index 0000000..464563c Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Female_north.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Female_south.png b/Textures/Things/Apparel/Overalls/source/Overalls_Female_south.png new file mode 100644 index 0000000..e5159df Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Female_south.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_east.png b/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_east.png new file mode 100644 index 0000000..c23196e Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_east.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_north.png b/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_north.png new file mode 100644 index 0000000..83d3aab Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_north.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_south.png b/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_south.png new file mode 100644 index 0000000..c737fc8 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Hulk_south.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Male_east.png b/Textures/Things/Apparel/Overalls/source/Overalls_Male_east.png new file mode 100644 index 0000000..1c43cc9 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Male_east.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Male_north.png b/Textures/Things/Apparel/Overalls/source/Overalls_Male_north.png new file mode 100644 index 0000000..00b9a23 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Male_north.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Male_south.png b/Textures/Things/Apparel/Overalls/source/Overalls_Male_south.png new file mode 100644 index 0000000..e7dbf66 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Male_south.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Thin_east.png b/Textures/Things/Apparel/Overalls/source/Overalls_Thin_east.png new file mode 100644 index 0000000..201e6fa Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Thin_east.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Thin_north.png b/Textures/Things/Apparel/Overalls/source/Overalls_Thin_north.png new file mode 100644 index 0000000..6d6b99a Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Thin_north.png differ diff --git a/Textures/Things/Apparel/Overalls/source/Overalls_Thin_south.png b/Textures/Things/Apparel/Overalls/source/Overalls_Thin_south.png new file mode 100644 index 0000000..7284240 Binary files /dev/null and b/Textures/Things/Apparel/Overalls/source/Overalls_Thin_south.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat.png new file mode 100644 index 0000000..ef6eb27 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_east.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_east.png new file mode 100644 index 0000000..2aad8be Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_east.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_north.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_north.png new file mode 100644 index 0000000..21e75f4 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_north.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_south.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_south.png new file mode 100644 index 0000000..481cbc6 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Fat_south.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_east.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_east.png new file mode 100644 index 0000000..3b821cb Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_east.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_north.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_north.png new file mode 100644 index 0000000..1eaa7a3 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_north.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_south.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_south.png new file mode 100644 index 0000000..928effe Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Female_south.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_east.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_east.png new file mode 100644 index 0000000..21b26ce Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_east.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_north.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_north.png new file mode 100644 index 0000000..0c9be08 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_north.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_south.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_south.png new file mode 100644 index 0000000..0c6e20e Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Hulk_south.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_east.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_east.png new file mode 100644 index 0000000..5de3203 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_east.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_north.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_north.png new file mode 100644 index 0000000..7340ef3 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_north.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_south.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_south.png new file mode 100644 index 0000000..6b19dc6 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Male_south.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_east.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_east.png new file mode 100644 index 0000000..187bcd8 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_east.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_north.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_north.png new file mode 100644 index 0000000..6f83c06 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_north.png differ diff --git a/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_south.png b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_south.png new file mode 100644 index 0000000..6a863e1 Binary files /dev/null and b/Textures/Things/Apparel/PeltCoat/source/PeltCoat_Thin_south.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs.png b/Textures/Things/Apparel/Scrubs/source/Scrubs.png new file mode 100644 index 0000000..5f5e011 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_east.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_east.png new file mode 100644 index 0000000..5afccca Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_east.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_north.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_north.png new file mode 100644 index 0000000..be92eea Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_north.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_south.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_south.png new file mode 100644 index 0000000..aeacf6f Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Fat_south.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_east.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_east.png new file mode 100644 index 0000000..c19c0e2 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_east.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_north.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_north.png new file mode 100644 index 0000000..4c27928 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_north.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_south.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_south.png new file mode 100644 index 0000000..b2ddf57 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Female_south.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_east.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_east.png new file mode 100644 index 0000000..777d8ba Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_east.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_north.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_north.png new file mode 100644 index 0000000..fa0ca77 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_north.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_south.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_south.png new file mode 100644 index 0000000..0fd7b9d Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Hulk_south.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_east.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_east.png new file mode 100644 index 0000000..dfcefc1 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_east.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_north.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_north.png new file mode 100644 index 0000000..97e16e6 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_north.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_south.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_south.png new file mode 100644 index 0000000..04ecb43 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Male_south.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_east.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_east.png new file mode 100644 index 0000000..f96f043 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_east.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_north.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_north.png new file mode 100644 index 0000000..2aa0c73 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_north.png differ diff --git a/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_south.png b/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_south.png new file mode 100644 index 0000000..6f33bc6 Binary files /dev/null and b/Textures/Things/Apparel/Scrubs/source/Scrubs_Thin_south.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt.png new file mode 100644 index 0000000..a11b17c Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_east.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_east.png new file mode 100644 index 0000000..4bf71a8 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_east.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_north.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_north.png new file mode 100644 index 0000000..8d01258 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_north.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_south.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_south.png new file mode 100644 index 0000000..8d37a31 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Fat_south.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_east.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_east.png new file mode 100644 index 0000000..c9ed4c9 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_east.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_north.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_north.png new file mode 100644 index 0000000..2c76c91 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_north.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_south.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_south.png new file mode 100644 index 0000000..e3c8b12 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Female_south.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_east.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_east.png new file mode 100644 index 0000000..5601157 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_east.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_north.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_north.png new file mode 100644 index 0000000..3f6f759 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_north.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_south.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_south.png new file mode 100644 index 0000000..e303af8 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Hulk_south.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_east.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_east.png new file mode 100644 index 0000000..d6d4b15 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_east.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_north.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_north.png new file mode 100644 index 0000000..6b85099 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_north.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_south.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_south.png new file mode 100644 index 0000000..40e9a54 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Male_south.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_east.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_east.png new file mode 100644 index 0000000..d47face Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_east.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_north.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_north.png new file mode 100644 index 0000000..1355483 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_north.png differ diff --git a/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_south.png b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_south.png new file mode 100644 index 0000000..c93b526 Binary files /dev/null and b/Textures/Things/Apparel/SheriffShirt/source/SheriffShirt_Thin_south.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece.png new file mode 100644 index 0000000..83c677c Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_east.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_east.png new file mode 100644 index 0000000..14aefca Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_east.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_north.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_north.png new file mode 100644 index 0000000..b2ab1bb Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_north.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_south.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_south.png new file mode 100644 index 0000000..ddc8a31 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Fat_south.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_east.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_east.png new file mode 100644 index 0000000..7d6c76b Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_east.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_north.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_north.png new file mode 100644 index 0000000..eecf665 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_north.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_south.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_south.png new file mode 100644 index 0000000..e3b74cc Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Female_south.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_east.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_east.png new file mode 100644 index 0000000..cd714e2 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_east.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_north.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_north.png new file mode 100644 index 0000000..6934531 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_north.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_south.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_south.png new file mode 100644 index 0000000..881dd92 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Hulk_south.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_east.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_east.png new file mode 100644 index 0000000..38a2728 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_east.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_north.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_north.png new file mode 100644 index 0000000..b39b3ce Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_north.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_south.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_south.png new file mode 100644 index 0000000..65c9403 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Male_south.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_east.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_east.png new file mode 100644 index 0000000..31660a3 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_east.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_north.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_north.png new file mode 100644 index 0000000..5887991 Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_north.png differ diff --git a/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_south.png b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_south.png new file mode 100644 index 0000000..7c4f68e Binary files /dev/null and b/Textures/Things/Apparel/ShirtFleece/source/ShirtFleece_Thin_south.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie.png new file mode 100644 index 0000000..2eb23e8 Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_east.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_east.png new file mode 100644 index 0000000..f9d1527 Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_east.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_north.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_north.png new file mode 100644 index 0000000..25ae417 Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_north.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_south.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_south.png new file mode 100644 index 0000000..3b7d42d Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Fat_south.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_east.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_east.png new file mode 100644 index 0000000..431ec9b Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_east.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_north.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_north.png new file mode 100644 index 0000000..6fcef0b Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_north.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_south.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_south.png new file mode 100644 index 0000000..0d95ed1 Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Female_south.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_east.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_east.png new file mode 100644 index 0000000..80e613a Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_east.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_north.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_north.png new file mode 100644 index 0000000..94aa5ba Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_north.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_south.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_south.png new file mode 100644 index 0000000..737d89b Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Hulk_south.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_east.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_east.png new file mode 100644 index 0000000..5a1fd5a Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_east.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_north.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_north.png new file mode 100644 index 0000000..7584ae6 Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_north.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_south.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_south.png new file mode 100644 index 0000000..5302504 Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Male_south.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_east.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_east.png new file mode 100644 index 0000000..17e1d5c Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_east.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_north.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_north.png new file mode 100644 index 0000000..d38851b Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_north.png differ diff --git a/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_south.png b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_south.png new file mode 100644 index 0000000..69c3d08 Binary files /dev/null and b/Textures/Things/Apparel/ShirtandTie/source/ShirtandTie_Thin_south.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket.png new file mode 100644 index 0000000..f382460 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_east.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_east.png new file mode 100644 index 0000000..177fc76 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_east.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_north.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_north.png new file mode 100644 index 0000000..982d13a Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_north.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_south.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_south.png new file mode 100644 index 0000000..65797c1 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Fat_south.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_east.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_east.png new file mode 100644 index 0000000..834cb82 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_east.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_north.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_north.png new file mode 100644 index 0000000..808e671 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_north.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_south.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_south.png new file mode 100644 index 0000000..617afbb Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Female_south.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_east.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_east.png new file mode 100644 index 0000000..5a45cd0 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_east.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_north.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_north.png new file mode 100644 index 0000000..7b8757d Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_north.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_south.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_south.png new file mode 100644 index 0000000..aa9f1ca Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Hulk_south.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_east.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_east.png new file mode 100644 index 0000000..bf1163a Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_east.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_north.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_north.png new file mode 100644 index 0000000..a3ff363 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_north.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_south.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_south.png new file mode 100644 index 0000000..e2e0e44 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Male_south.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_east.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_east.png new file mode 100644 index 0000000..bea1645 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_east.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_north.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_north.png new file mode 100644 index 0000000..1346491 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_north.png differ diff --git a/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_south.png b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_south.png new file mode 100644 index 0000000..45935a0 Binary files /dev/null and b/Textures/Things/Apparel/SuitJacket/source/SuitJacket_Thin_south.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop.png b/Textures/Things/Apparel/TankTop/source/TankTop.png new file mode 100644 index 0000000..3ce4395 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Fat_east.png b/Textures/Things/Apparel/TankTop/source/TankTop_Fat_east.png new file mode 100644 index 0000000..a33b18d Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Fat_east.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Fat_north.png b/Textures/Things/Apparel/TankTop/source/TankTop_Fat_north.png new file mode 100644 index 0000000..4b11faa Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Fat_north.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Fat_south.png b/Textures/Things/Apparel/TankTop/source/TankTop_Fat_south.png new file mode 100644 index 0000000..2409088 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Fat_south.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Female_east.png b/Textures/Things/Apparel/TankTop/source/TankTop_Female_east.png new file mode 100644 index 0000000..e0377d5 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Female_east.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Female_north.png b/Textures/Things/Apparel/TankTop/source/TankTop_Female_north.png new file mode 100644 index 0000000..7e53e34 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Female_north.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Female_south.png b/Textures/Things/Apparel/TankTop/source/TankTop_Female_south.png new file mode 100644 index 0000000..cbfead6 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Female_south.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_east.png b/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_east.png new file mode 100644 index 0000000..3e35af9 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_east.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_north.png b/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_north.png new file mode 100644 index 0000000..440b252 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_north.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_south.png b/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_south.png new file mode 100644 index 0000000..203259b Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Hulk_south.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Male_east.png b/Textures/Things/Apparel/TankTop/source/TankTop_Male_east.png new file mode 100644 index 0000000..ab9f49b Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Male_east.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Male_north.png b/Textures/Things/Apparel/TankTop/source/TankTop_Male_north.png new file mode 100644 index 0000000..22d24f1 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Male_north.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Male_south.png b/Textures/Things/Apparel/TankTop/source/TankTop_Male_south.png new file mode 100644 index 0000000..d95deef Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Male_south.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Thin_east.png b/Textures/Things/Apparel/TankTop/source/TankTop_Thin_east.png new file mode 100644 index 0000000..f18042d Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Thin_east.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Thin_north.png b/Textures/Things/Apparel/TankTop/source/TankTop_Thin_north.png new file mode 100644 index 0000000..47dddb4 Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Thin_north.png differ diff --git a/Textures/Things/Apparel/TankTop/source/TankTop_Thin_south.png b/Textures/Things/Apparel/TankTop/source/TankTop_Thin_south.png new file mode 100644 index 0000000..bb45eee Binary files /dev/null and b/Textures/Things/Apparel/TankTop/source/TankTop_Thin_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Apparel.zip b/Textures/Things/Pawn/Humanlike/Apparel/Apparel.zip deleted file mode 100644 index 803d68a..0000000 Binary files a/Textures/Things/Pawn/Humanlike/Apparel/Apparel.zip and /dev/null differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_east.png new file mode 100644 index 0000000..8cdf8a1 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_north.png new file mode 100644 index 0000000..7daad1b Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_south.png new file mode 100644 index 0000000..9fd0ab7 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_3_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_east.png new file mode 100644 index 0000000..9757639 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_north.png new file mode 100644 index 0000000..dea0144 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_south.png new file mode 100644 index 0000000..e457935 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_5_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_east.png new file mode 100644 index 0000000..120b2da Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_north.png new file mode 100644 index 0000000..39dd3ad Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_south.png new file mode 100644 index 0000000..d736170 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Burka/Burka_Female_7_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor(old_named).zip b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor(old_named).zip deleted file mode 100644 index 68a6ce2..0000000 Binary files a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor(old_named).zip and /dev/null differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/source/CataphractArmor_Female_east-CAB-a4b7c1832c503b1d92583c6c45f5bec5-14263921838055924587.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_3_east.png similarity index 100% rename from Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/source/CataphractArmor_Female_east-CAB-a4b7c1832c503b1d92583c6c45f5bec5-14263921838055924587.png rename to Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_3_east.png diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/source/CataphractArmor_Female_north-CAB-a4b7c1832c503b1d92583c6c45f5bec5-16419057335381867331.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_3_north.png similarity index 100% rename from Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/source/CataphractArmor_Female_north-CAB-a4b7c1832c503b1d92583c6c45f5bec5-16419057335381867331.png rename to Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_3_north.png diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/source/CataphractArmor_Female_south-CAB-a4b7c1832c503b1d92583c6c45f5bec5-1814284374271471540.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_3_south.png similarity index 100% rename from Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/source/CataphractArmor_Female_south-CAB-a4b7c1832c503b1d92583c6c45f5bec5-1814284374271471540.png rename to Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_3_south.png diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_east.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_east.png new file mode 100644 index 0000000..def8fb2 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_north.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_north.png new file mode 100644 index 0000000..8378435 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_south.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_south.png new file mode 100644 index 0000000..83b9c06 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_5_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_east.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_east.png new file mode 100644 index 0000000..7eae088 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_north.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_north.png new file mode 100644 index 0000000..a9a2f4b Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_south.png b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_south.png new file mode 100644 index 0000000..663cecd Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/CataphractArmor/CataphractArmor_Female_7_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_east.png new file mode 100644 index 0000000..8d551d9 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_north.png new file mode 100644 index 0000000..5ddd1e7 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_south.png new file mode 100644 index 0000000..1bd3260 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_10_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_east.png new file mode 100644 index 0000000..3b0c015 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_north.png new file mode 100644 index 0000000..5ef98c6 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_south.png new file mode 100644 index 0000000..35a7d7e Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_7_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_east.png new file mode 100644 index 0000000..3b0c015 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_north.png new file mode 100644 index 0000000..5ddd1e7 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_south.png new file mode 100644 index 0000000..69f37ef Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_8_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_east.png new file mode 100644 index 0000000..c2c7b56 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_north.png new file mode 100644 index 0000000..5ddd1e7 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_south.png new file mode 100644 index 0000000..76e6310 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/Pants_Female_9_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_east.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_east.png new file mode 100644 index 0000000..3fa39fd Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_north.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_north.png new file mode 100644 index 0000000..dbf7559 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_south.png b/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_south.png new file mode 100644 index 0000000..71832db Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/Pants/todo/Pants_Thin_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_east.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_east.png new file mode 100644 index 0000000..f3eeb99 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_north.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_north.png new file mode 100644 index 0000000..7f6bde3 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_south.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_south.png new file mode 100644 index 0000000..af1f205 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_3_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_east.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_east.png new file mode 100644 index 0000000..fcbfa7c Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_north.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_north.png new file mode 100644 index 0000000..fa26627 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_south.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_south.png new file mode 100644 index 0000000..e0e8aa1 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_5_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_east.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_east.png new file mode 100644 index 0000000..72ea141 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_north.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_north.png new file mode 100644 index 0000000..4505bbc Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_south.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_south.png new file mode 100644 index 0000000..b078d7b Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Female_7_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_east.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_east.png new file mode 100644 index 0000000..ee90289 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_north.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_north.png new file mode 100644 index 0000000..98f0187 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_south.png b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_south.png new file mode 100644 index 0000000..bbf89c9 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Apparel/ReconArmor/ReconArmor_Thin_2_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/ShirtButton.zip b/Textures/Things/Pawn/Humanlike/Apparel/ShirtButton.zip deleted file mode 100644 index 182f0f4..0000000 Binary files a/Textures/Things/Pawn/Humanlike/Apparel/ShirtButton.zip and /dev/null differ diff --git a/Textures/Things/Pawn/Humanlike/Apparel/rename(don't run).py b/Textures/Things/Pawn/Humanlike/Apparel/rename(don't run).py deleted file mode 100644 index 3800d76..0000000 --- a/Textures/Things/Pawn/Humanlike/Apparel/rename(don't run).py +++ /dev/null @@ -1,94 +0,0 @@ -import os - -files = os.listdir('./') - -for file in files: - if file[-2:] != 'py': - name = file - - new_name = file.replace('_6', '_7') - #new_name = file.replace('_5', '_6') - #new_name = file.replace('_4', '_5') - #new_name = file.replace('_3', '_4') - #new_name = file.replace('_2', '_3') - #new_name = file.replace('_1', '_2') - - name = os.path.join('./', name) - new_name = os.path.join('./', new_name) - os.rename(name, new_name) - -for file in files: - if file[-2:] != 'py': - name = file - - #new_name = file.replace('_6', '_7') - new_name = file.replace('_5', '_6') - #new_name = file.replace('_4', '_5') - #new_name = file.replace('_3', '_4') - #new_name = file.replace('_2', '_3') - #new_name = file.replace('_1', '_2') - - name = os.path.join('./', name) - new_name = os.path.join('./', new_name) - os.rename(name, new_name) - -for file in files: - if file[-2:] != 'py': - name = file - - #new_name = file.replace('_6', '_7') - #new_name = file.replace('_5', '_6') - new_name = file.replace('_4', '_5') - #new_name = file.replace('_3', '_4') - #new_name = file.replace('_2', '_3') - #new_name = file.replace('_1', '_2') - - name = os.path.join('./', name) - new_name = os.path.join('./', new_name) - os.rename(name, new_name) - -for file in files: - if file[-2:] != 'py': - name = file - - #new_name = file.replace('_6', '_7') - #new_name = file.replace('_5', '_6') - #new_name = file.replace('_4', '_5') - new_name = file.replace('_3', '_4') - #new_name = file.replace('_2', '_3') - #new_name = file.replace('_1', '_2') - - name = os.path.join('./', name) - new_name = os.path.join('./', new_name) - os.rename(name, new_name) - -for file in files: - if file[-2:] != 'py': - name = file - - #new_name = file.replace('_6', '_7') - #new_name = file.replace('_5', '_6') - #new_name = file.replace('_4', '_5') - #new_name = file.replace('_3', '_4') - new_name = file.replace('_2', '_3') - #new_name = file.replace('_1', '_2') - - name = os.path.join('./', name) - new_name = os.path.join('./', new_name) - os.rename(name, new_name) - -for file in files: - if file[-2:] != 'py': - name = file - - #new_name = file.replace('_6', '_7') - #new_name = file.replace('_5', '_6') - #new_name = file.replace('_4', '_5') - #new_name = file.replace('_3', '_4') - #new_name = file.replace('_2', '_3') - new_name = file.replace('_1', '_2') - - name = os.path.join('./', name) - new_name = os.path.join('./', new_name) - os.rename(name, new_name) - diff --git a/Textures/Things/Pawn/Humanlike/Apparel/renameCapital.py b/Textures/Things/Pawn/Humanlike/Apparel/renameCapital.py deleted file mode 100644 index 6cb640b..0000000 --- a/Textures/Things/Pawn/Humanlike/Apparel/renameCapital.py +++ /dev/null @@ -1,9 +0,0 @@ -import os - -for filename in os.listdir("."): - new_filename = filename.replace("_female", "_Female") - new_filename = new_filename.replace("_thin", "_Thin") - new_filename = new_filename.replace("_male", "_Male") - new_filename = new_filename.replace("_fat", "_Fat") - new_filename = new_filename.replace("_hulk", "_Hulk") - os.rename(filename, new_filename) diff --git a/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_east.png b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_east.png new file mode 100644 index 0000000..f3f5e4c Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_north.png b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_north.png new file mode 100644 index 0000000..64589c1 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_south.png b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_south.png new file mode 100644 index 0000000..46ab0c4 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Female_BaseBody_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_east.png b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_east.png new file mode 100644 index 0000000..ea5b4c9 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_north.png b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_north.png new file mode 100644 index 0000000..c1399e8 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_south.png b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_south.png new file mode 100644 index 0000000..1281744 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/128/Naked_Thin_BaseBody_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_east.png b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_east.png new file mode 100644 index 0000000..42acdc0 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_north.png b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_north.png new file mode 100644 index 0000000..9a8dbb7 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_south.png b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_south.png new file mode 100644 index 0000000..1b3a040 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Female_BaseBody_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_east.png b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_east.png new file mode 100644 index 0000000..ad6da88 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_north.png b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_north.png new file mode 100644 index 0000000..83b15b6 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_south.png b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_south.png new file mode 100644 index 0000000..fc1293f Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/FurCovered_Thin_BaseBody_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_east.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_east.png new file mode 100644 index 0000000..530046d Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_north.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_north.png new file mode 100644 index 0000000..bcaa369 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_south.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_south.png new file mode 100644 index 0000000..8f250d9 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Child_BaseBody_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_east.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_east.png new file mode 100644 index 0000000..7af186a Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_north.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_north.png new file mode 100644 index 0000000..07f518d Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_south.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_south.png new file mode 100644 index 0000000..39d886e Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Hulk_BaseBodyF_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_east.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_east.png new file mode 100644 index 0000000..9e5ccd4 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_north.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_north.png new file mode 100644 index 0000000..b6b8711 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_south.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_south.png new file mode 100644 index 0000000..32e5913 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBodyM_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBody_south.png b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBody_south.png index 6c9b6c6..497cc7a 100644 Binary files a/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBody_south.png and b/Textures/Things/Pawn/Humanlike/Bodies/Naked_Thin_BaseBody_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_east.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_east.png new file mode 100644 index 0000000..efc219d Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_north.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_north.png new file mode 100644 index 0000000..7d47ecb Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_south.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_south.png new file mode 100644 index 0000000..d717696 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Fat_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_east.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_east.png new file mode 100644 index 0000000..9c1c1e8 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_north.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_north.png new file mode 100644 index 0000000..da931f4 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_south.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_south.png new file mode 100644 index 0000000..8fe3b73 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Female_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_east.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_east.png new file mode 100644 index 0000000..9be4e9d Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_north.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_north.png new file mode 100644 index 0000000..6ae491d Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_south.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_south.png new file mode 100644 index 0000000..9270f8c Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Hulk_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_east.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_east.png new file mode 100644 index 0000000..397823c Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_north.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_north.png new file mode 100644 index 0000000..f3da1d9 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_south.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_south.png new file mode 100644 index 0000000..7c19354 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Male_south.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_east.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_east.png new file mode 100644 index 0000000..667f18d Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_east.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_north.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_north.png new file mode 100644 index 0000000..867c188 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_north.png differ diff --git a/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_south.png b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_south.png new file mode 100644 index 0000000..68561d3 Binary files /dev/null and b/Textures/Things/Pawn/Humanlike/Bodies/source/FurCovered_Thin_south.png differ diff --git a/source/SizedApparel/HarmonyPatches.cs b/source/SizedApparel/HarmonyPatches.cs index b723dd3..0a4f424 100644 --- a/source/SizedApparel/HarmonyPatches.cs +++ b/source/SizedApparel/HarmonyPatches.cs @@ -8,6 +8,7 @@ using HarmonyLib; //using AlienRace; using UnityEngine; using rjw; +using Rimworld_Animations; using RevealingApparel; using System.Reflection; @@ -24,6 +25,7 @@ namespace SizedApparel public static bool rimNudeWorldActive = false; public static bool OTYNudeActive = false; public static bool LicentiaActive = false; + public static bool RimworldAnimationActive = false; //rjw animation static SizedApparelPatch() { @@ -86,6 +88,12 @@ namespace SizedApparel LicentiaActive = true; } + //check rjw animation + if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "c0ffee.rimworld.animations".ToLower())) + { + RimworldAnimationActive = true; + } + Log.Message("[SizedApparel] start"); var harmony = new Harmony("SizedApparelforRJW"); @@ -137,7 +145,7 @@ namespace SizedApparel } else { - Log.Message("[SizedApparel] RimJobWorld Paatch canceled"); + Log.Message("[SizedApparel] RimJobWorld Patch canceled"); } }))(); } @@ -170,6 +178,31 @@ namespace SizedApparel catch (TypeLoadException ex) { } */ + try + { + ((Action)(() => + { + if (RimworldAnimationActive) + { + Log.Message("[SizedApparel] RimworldAnimaion(rjw animation) Found"); + + harmony.Patch(AccessTools.Method(typeof(CompBodyAnimator), "tickClip"), + postfix: new HarmonyMethod(typeof(RimworldAnimationPatch), "TickClipPostfix")); + + harmony.Patch(AccessTools.Method(typeof(JobDriver_SexBaseInitiator), "End"), + postfix: new HarmonyMethod(typeof(RimworldAnimationPatch), "EndClipPostfix")); + + + Log.Message("[SizedApparel] RimworldAnimaion(rjw animation) Patched"); + } + else + { + Log.Message("[SizedApparel] RimworldAnimaion(rjw animation) Patch canceled"); + } + }))(); + } + catch (TypeLoadException ex) { } + //Rim Nude World Patch try { diff --git a/source/SizedApparel/Properties/AssemblyInfo.cs b/source/SizedApparel/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..950c1b8 --- /dev/null +++ b/source/SizedApparel/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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")] diff --git a/source/SizedApparel/SizedApparelBodyPart.cs b/source/SizedApparel/SizedApparelBodyPart.cs index 5ff3a77..580be69 100644 --- a/source/SizedApparel/SizedApparelBodyPart.cs +++ b/source/SizedApparel/SizedApparelBodyPart.cs @@ -1,14 +1,12 @@ -using System; +using HarmonyLib; +using RimWorld; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using RimWorld; -using Verse; -using HarmonyLib; +using System.Reflection; //using AlienRace; using UnityEngine; -using rjw; -using System.Reflection; +using Verse; namespace SizedApparel { @@ -214,6 +212,19 @@ namespace SizedApparel } + public enum ColorMode + { + Skin, Hair + } + + //Def for Hediff Graphic color options or else. + public class SizedApparelHeddifDef : Def + { + public HediffDef hediffDef; + //public string hediffDefName; + + } + //Def per graphic(texture) public class SizedApparelBodyPartGraphicDef : Def { @@ -222,7 +233,6 @@ namespace SizedApparel public Vector2 pivot = new Vector2(0.5f, 0.5f); // custom pivot of texture. UV. not pixel //public Dictionary points = new Dictionary(); //public Dictionary splines = new Dictionary(); - } //Def per BodyParts @@ -237,9 +247,14 @@ namespace SizedApparel { static MethodInfo overrideMatMethod = AccessTools.Method(typeof(PawnRenderer), "OverrideMaterialIfNeeded"); - public SizedApparelBodyPart(Pawn pawn, string bodyPartName, SizedApparelBodyPartOf bodyPartOf, string defaultHediffName, bool isBreast, bool isOverlay , string customPathName = null, SizedApparelBodyPartColorOf colorOf = SizedApparelBodyPartColorOf.Skin) + public bool AutoOffsetForFurCoveredBody = true; + + public SizedApparelBodyPart(Pawn pawn, ApparelRecorderComp apparelRecorderComp, string bodyPartName, SizedApparelBodyPartOf bodyPartOf, string defaultHediffName, bool isBreast, bool isOverlay , string customPathName = null, SizedApparelBodyPartColorOf colorOf = SizedApparelBodyPartColorOf.Skin) { this.pawn = pawn; //owner + + this.apparelRecorderCompCache = apparelRecorderComp; //for reduce GetComp Call; if it is null, it will try to get pawn's comp. + this.bodyPartName = bodyPartName; this.def = DefDatabase.AllDefs.FirstOrDefault(b => b.defName == bodyPartName); @@ -268,6 +283,8 @@ namespace SizedApparel public SizedApparelBodyPartDef def; public Pawn pawn; + public ApparelRecorderComp apparelRecorderCompCache; // for reduce getComp call; + public string bodyPartName; //breast, penis, belly, pubichair... etc. just name. not like architech something public string customPath = null; public SizedApparelBodyPartOf bodyPartOf = SizedApparelBodyPartOf.None; @@ -280,6 +297,8 @@ namespace SizedApparel public bool isVisible = true; + public int lastPoseTick = -1; + public SizedApparelBodyPartColorOf colorType = SizedApparelBodyPartColorOf.Skin; public Color? customColorOne; public Color? customColorTwo; @@ -306,9 +325,15 @@ namespace SizedApparel { if (customPose == newPose) return; + if(SizedApparelSettings.Debug) + Log.Message("[SizedApparel] Setting Custom Pose : " + newPose); customPose = newPose; if (autoUpdate) + { this.UpdateGraphic(); + this.lastPoseTick = Find.TickManager.TicksGame; + } + if(autoSetPawnGraphicDirty) { if (pawn == null) @@ -318,7 +343,7 @@ namespace SizedApparel } } - public bool CheckCanPose(string targetPose, bool checkApparels, bool mustMatchSize) + public bool CheckCanPose(string targetPose, bool checkApparels, bool checkBodyParts, bool mustMatchSize) { if (checkApparels) { @@ -331,6 +356,9 @@ namespace SizedApparel if (agr.sourceApparel.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_IgnorePose".ToLower())) continue; */ + //Only Check Torso Apparel Only + if (!agr.sourceApparel.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso)) + continue; string originalPath = SizedApparelsDatabase.GetSupportedApparelOriginalPath(agr.graphic.path); if (originalPath == null) @@ -338,17 +366,23 @@ namespace SizedApparel int outInt = -1; float outFloat = -1; - SizedApparelsDatabase.SizedApparelDatabaseKey key = new SizedApparelsDatabase.SizedApparelDatabaseKey(originalPath,pawn.def.defName,pawn.story?.bodyType?.defName, currentHediffName, Math.Min(currentSeverityInt, cappedSeverityInt), false, targetPose); + SizedApparelsDatabase.SizedApparelDatabaseKey key = new SizedApparelsDatabase.SizedApparelDatabaseKey(originalPath,pawn.def.defName,pawn.story?.bodyType?.defName, pawn.gender, currentHediffName, Math.Min(currentSeverityInt, cappedSeverityInt), false, targetPose); + if (SizedApparelSettings.useGenderSpecificTexture) + key.gender = Gender.None; var result = SizedApparelsDatabase.GetSupportedApparelSizedPath(key, out outInt, out outFloat); if (!result.isCustomPose) return false; } } - Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, targetPose); - Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, targetPose); - if (graphic != null || graphicH != null) - return true; - return false; + if (checkBodyParts) + { + Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, targetPose); + Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, targetPose); + if (graphic != null || graphicH != null) + return true; + return false; + } + return true; } @@ -378,6 +412,7 @@ namespace SizedApparel public float depthOffset = 0f; + //0.008f public float depthOffsetEast = 0.008f; public float depthOffsetWest = 0.008f; public float depthOffsetSouth = 0.008f; @@ -411,9 +446,9 @@ namespace SizedApparel outPoints = null; return null; } - - var comp = pawn.TryGetComp(); - + var comp = apparelRecorderCompCache; + if (comp == null) + comp = pawn.GetComp(); if (comp == null) { outPoints = null; @@ -421,7 +456,7 @@ namespace SizedApparel } - var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, currentHediffName, customPath==null?bodyPartName: customPath, Math.Min(currentSeverityInt, cappedSeverityInt), isHorny, poseOverride==null?customPose:poseOverride, variationOverride==null?variation: variationOverride); + var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, currentHediffName, customPath==null?bodyPartName: customPath, pawn.gender, Math.Min(currentSeverityInt, cappedSeverityInt), isHorny, poseOverride==null?customPose:poseOverride, variationOverride==null?variation: variationOverride); var result = SizedApparelsDatabase.GetSupportedBodyPartPath(key, isBreast, customPath == null ? bodyPartName : customPath, defaultHediffName); if (mustMatchSize) @@ -503,24 +538,52 @@ namespace SizedApparel if (pawn == null) return; + if (bodyMesh == null) + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] DrawBodyParts But Null Body Mesh! : " + pawn.Name); + return; + } + + PawnRenderer pawnRenderer = pawn.Drawer.renderer; Shader shader = ShaderDatabase.CutoutComplex; Color drawColor1 = Color.white; Color drawColor2 = Color.white; + bool forceWriteZ = true; - if(colorType == SizedApparelBodyPartColorOf.Skin) + bool HasFurSkin = false; + //Furskin Check + if (pawn.Drawer.renderer.graphics.furCoveredGraphic != null) + { + HasFurSkin = true; + } + + if (colorType == SizedApparelBodyPartColorOf.Skin) { forceWriteZ = true; 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 = ShaderDatabase.CutoutSkinOverlay; + drawColor1 = pawnRenderer.graphics.nakedGraphic.Color; + drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo; + } - shader = pawn.Drawer.renderer.graphics.nakedGraphic.Shader; - if (!ShaderUtility.SupportsMaskTex(shader)) - shader = ShaderDatabase.CutoutSkinOverlay; - drawColor1 = pawn.Drawer.renderer.graphics.nakedGraphic.Color; - drawColor2 = pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo; } else if (bodyDrawType == RotDrawMode.Rotting) { @@ -528,16 +591,18 @@ namespace SizedApparel shader = pawn.Drawer.renderer.graphics.rottingGraphic.Shader; if (!ShaderUtility.SupportsMaskTex(shader)) shader = ShaderDatabase.CutoutSkinOverlay; - drawColor1 = pawn.Drawer.renderer.graphics.rottingGraphic.Color; - drawColor2 = pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo; + drawColor1 = pawnRenderer.graphics.rottingGraphic.Color; + drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo; } + + } else if (colorType == SizedApparelBodyPartColorOf.Hair) { forceWriteZ = false; shader = ShaderDatabase.Transparent; if(pawn.story != null) - drawColor1 = pawn.story.hairColor; + drawColor1 = pawn.story.HairColor; } else if (colorType == SizedApparelBodyPartColorOf.Custom) { @@ -560,6 +625,11 @@ namespace SizedApparel Quaternion quaternion = Quaternion.AngleAxis(angle + rotation, Vector3.up); Vector3 vector = rootLoc; + if (this.pawn.ageTracker.CurLifeStage.bodyDrawOffset != null) + { + vector += this.pawn.ageTracker.CurLifeStage.bodyDrawOffset.Value; + } + Rot4 targetRot = facing; if (rotOverride != null) targetRot = rotOverride.Value; @@ -594,6 +664,8 @@ namespace SizedApparel } + + Graphic graphic = null; if (SizedApparelUtility.IsHorny(pawn)) graphic = bodyPartGraphicHorny; @@ -603,13 +675,28 @@ namespace SizedApparel if (graphic == null) return; + //ForFurskinOffset + if(bodyDrawType == RotDrawMode.Fresh && HasFurSkin && AutoOffsetForFurCoveredBody) + { + //vector.y += 0.009187258f; //in PawnRenderer, it adds 0.009187258f. + + //graphic.maskPath does error? need to check + // worn fur body and naked fur body has different offsets... wtf + //TODO Need to Fix + } + + + + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)&&!isOverlay&& forceWriteZ) { - graphic = graphic.GetColoredVersion(ShaderDatabase.Cutout, drawColor1, drawColor2); + 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(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue } + graphic = graphic.GetColoredVersion(shader, drawColor1, drawColor2); vector.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) }); diff --git a/source/SizedApparel/SizedApparelBodyPartDetail.cs b/source/SizedApparel/SizedApparelBodyPartDetail.cs index 19da2a8..31d6f8c 100644 --- a/source/SizedApparel/SizedApparelBodyPartDetail.cs +++ b/source/SizedApparel/SizedApparelBodyPartDetail.cs @@ -52,13 +52,13 @@ namespace SizedApparel if (SizedApparelUtility.isBreast(parent.def.defName)) bodyPartName = "Breasts"; - else if (SizedApparelUtility.isVagina(parent.def.defName)) + else if (Genital_Helper.is_vagina(parent)) // SizedApparelUtility.isVagina(parent.def.defName) bodyPartName = "Vagina"; else if (SizedApparelUtility.isAnus(parent.def.defName)) bodyPartName = "Anus"; else if (SizedApparelUtility.isUdder(parent.def.defName)) bodyPartName = "Udder"; - else if (SizedApparelUtility.isPenis(parent.def.defName)) + else if (Genital_Helper.is_penis(parent)) //SizedApparelUtility.isPenis(parent.def.defName) bodyPartName = "Penis"; else diff --git a/source/SizedApparel/SizedApparelComp.cs b/source/SizedApparel/SizedApparelComp.cs index 12dce2f..305c6c1 100644 --- a/source/SizedApparel/SizedApparelComp.cs +++ b/source/SizedApparel/SizedApparelComp.cs @@ -13,6 +13,9 @@ namespace SizedApparel [StaticConstructorOnStartup] public class ApparelRecorderComp : ThingComp { + Pawn pawn;// Parent Cache + + public bool recentClothFlag = true; public bool isDrawAge = true; @@ -49,9 +52,15 @@ namespace SizedApparel //for breasts animation or something. + public bool ForceUpdateTickAnimation = false; + public bool PrePositionCache; public Vector3? prePositionCache; public float? preAngleCache; public int? preTickCache; + public Vector3 preVelocity = Vector3.zero; + public float preRotation = 0; + public Dictionary tickCache = new Dictionary(); + public SizedApparelBodyPart bodyPartBreasts;//TODO: Make this as List @@ -69,11 +78,15 @@ namespace SizedApparel public List bodyPartHands = new List(); public List bodyPartFeet = new List(); - public Graphic graphicNaked = null; //original Graphic - public Graphic graphicRotten = null; //original Graphic + public Graphic graphicSourceNaked = null; //original Graphic + public Graphic graphicSourceRotten = null; //original Graphic + public Graphic graphicSourceFurCovered = null; //original Graphic + public Graphic graphicbaseBodyNaked = null; + public Graphic graphicbaseBodyCorpse = null; public Graphic graphicbaseBodyRotten = null; + public Graphic graphicbaseBodyFurCovered = null; [Obsolete] public Graphic graphicBreasts = null; @@ -127,26 +140,26 @@ namespace SizedApparel public override void Initialize(CompProperties props) { base.Initialize(props); - Pawn p = parent as Pawn; + this.pawn = this.parent as Pawn; - bodyPartBreasts = new SizedApparelBodyPart(p, "Breasts", SizedApparelBodyPartOf.Breasts, "Breasts", true, false); + bodyPartBreasts = new SizedApparelBodyPart(pawn, this, "Breasts", SizedApparelBodyPartOf.Breasts, "Breasts", true, false); bodyPartBreasts.SetDepthOffsets(0.0113f, 0.001f, 0.0113f, 0.0113f); - bodyPartNipple = new SizedApparelBodyPart(p, "Nippple", SizedApparelBodyPartOf.Breasts, "Breasts", true, false); + bodyPartNipple = new SizedApparelBodyPart(pawn, this, "Nippple", SizedApparelBodyPartOf.Breasts, "Breasts", true, false); bodyPartBreasts.SetDepthOffsets(0.0114f, 0.000f, 0.0114f, 0.0114f); - bodyPartUdder = new SizedApparelBodyPart(p, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false); + bodyPartUdder = new SizedApparelBodyPart(pawn, this, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false); bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f); //UdderNipple...? //bodyPartUdder = new SizedApparelBodyPart(p, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false); //bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f); - bodyPartVagina = new SizedApparelBodyPart(p, "Vagina", SizedApparelBodyPartOf.Vagina, "Vagina", false, false); + bodyPartVagina = new SizedApparelBodyPart(pawn, this, "Vagina", SizedApparelBodyPartOf.Vagina, "Vagina", false, false); bodyPartVagina.SetDepthOffsets(0.0088f, 0.0100f, 0.0088f, 0.0088f); - bodyPartAnus = new SizedApparelBodyPart(p, "Anus", SizedApparelBodyPartOf.Anus, "Anus", false, false); + bodyPartAnus = new SizedApparelBodyPart(pawn, this, "Anus", SizedApparelBodyPartOf.Anus, "Anus", false, false); bodyPartAnus.SetDepthOffsets(0.0093f, 0.0105f, 0.0093f, 0.0093f); - bodyPartBelly = new SizedApparelBodyPart(p, "Belly", SizedApparelBodyPartOf.Belly, "BellyBulge", false, false); + bodyPartBelly = new SizedApparelBodyPart(pawn, this, "Belly", SizedApparelBodyPartOf.Belly, "BellyBulge", false, false); bodyPartBelly.SetDepthOffsets(0.0098f, 0.0002f, 0.0098f, 0.0098f); } @@ -159,62 +172,146 @@ namespace SizedApparel + /* public override void CompTick() { + if (PrePositionCache) + { + + } base.CompTick(); - - - } - + }*/ + /* public override void CompTickRare() { base.CompTickRare(); }*/ + + + float penisAngle = 0; + public void SetPenisAngle(float angle) + { + penisAngle = angle; + bool penisDown = false; + if (angle >= 120 && angle <= 250) + penisDown = true; + foreach (var p in bodyPartPenises) + { + if (penisDown) + { + p.SetCustomPose("PenisDown"); + } + else + { + p.SetCustomPose(null); + } + } + } + public void SetBreastJiggle(bool jiggle, int cooltime = 5) + { + //SetJiggle has cooltime + if (Find.TickManager.TicksGame < bodyPartBreasts.lastPoseTick + cooltime) + return; + + if (jiggle) + { + //may need to check apparels for aply pose + //bodyPartBreasts.CheckCanPose("JiggleUp",) + bodyPartBreasts.SetCustomPose("JiggleUp"); + } + else + { + //SetPoseFromPoseSet(null); + bodyPartBreasts.SetCustomPose(null); + } + } + string[] testPose = { null, "JiggleUp", "JiggleCenter" }; string[] testPose2 = { null, "PenisDown" }; - public void DrawUpdate(Vector3 rootLoc, float angle) // call this in DrawPawnBody + public void UpdateTickAnim(Vector3 rootLoc, float angle) // call this in DrawPawnBody <- only called when it rendered { + //do not calculate physics camera is far + if (Find.CameraDriver.CurrentZoom >= CameraZoomRange.Furthest) + return; //int IdTick = parent.thingIDNumber * 20; //hint from yayo animation mod - if (SizedApparelSettings.autoJiggleBreasts) + + if (!SizedApparelUtility.CanApplySizedApparel(pawn)) + return; + + + if (SizedApparelSettings.breastsPhysics || ForceUpdateTickAnimation)//SizedApparelSettings.autoJiggleBreasts { - Vector3 velocity; - if (this.prePositionCache != null) - velocity = this.prePositionCache.Value - rootLoc; - else - velocity = Vector3.zero; - - - - float rotation; - if (this.preAngleCache != null) - rotation = this.preAngleCache.Value - angle; - else - rotation = 0; int tick; if (this.preTickCache != null) tick = Find.TickManager.TicksGame - this.preTickCache.Value; else - tick = 1; + tick = Find.TickManager.TicksGame; + if (tick == 0) + return; + + Vector3 velocity; + if (this.prePositionCache != null) + velocity = (rootLoc - this.prePositionCache.Value);// /tick + else + velocity = Vector3.zero; + + float rotation; + + if (this.preAngleCache != null) + rotation = angle - this.preAngleCache.Value; + else + rotation = 0; + + float rotAcc = rotation - preRotation; + + + //Log.Message(velocity.ToString() + " , " + preVelocity.ToString()); + //UnityEngine's vector.normalize is safe for zero vector + //(Vector3.Dot(velocity.normalized, preVelocity.normalized)) < 0.2f + + float dotV = Vector3.Dot(velocity.normalized, preVelocity.normalized); + + /* + Log.Message(pawn.ToString()); + Log.Message("rotAcc : " + rotAcc.ToString()); + Log.Message("Velocity.x : " + velocity.x.ToString()); + Log.Message("Velocity.z : " + velocity.z.ToString()); + Log.Message("dotV : " + dotV.ToString()); + */ + if (dotV < 0.2f || Mathf.Abs(rotAcc) > 0.5) //(dotV == 0 ? 0:1), Mathf.Abs(dotV) // || Mathf.Abs(rotation) > 20 + { + //tickCache.Add("BreastsJiggleUp", Find.TickManager.TicksGame); + SetBreastJiggle(true,10); + + } + else + { + SetBreastJiggle(false,10); + } this.prePositionCache = rootLoc; this.preAngleCache = angle; + this.preRotation = rotation; this.preTickCache = Find.TickManager.TicksGame; + this.preVelocity = velocity; + + + } - SetPoseFromPoseSet(testPose2.RandomElement()); + //SetPoseFromPoseSet(testPose2.RandomElement()); } public bool isApparelGraphicRecordChanged() { - Pawn pawn = parent as Pawn; if (pawn == null) return false; @@ -234,6 +331,294 @@ namespace SizedApparel return false; } + public void DrawAllBodyParts(Vector3 rootLoc, float angle, Rot4 facing, RotDrawMode bodyDrawType, PawnRenderFlags flags, Pawn ___pawn, Mesh bodyMesh) + { + if (this.isDrawAge && (!flags.FlagSet(PawnRenderFlags.Clothes) || !this.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(___pawn))) //TODO : Move it to CanDraw + { + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawVagina && SizedApparelUtility.CanDrawVagina(___pawn, flags)) + { + if (this.bodyPartVagina != null) + this.bodyPartVagina.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + /* + //Draw Vagina. AllwaysDraw + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0100f;//not sure what to do + else + vector.y += 0.0088f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = this.graphicVagina_horny; + if (graphic == null) + graphic = this.graphicVagina; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawAnus && SizedApparelUtility.CanDrawAnus(___pawn, flags)) + { + if (this.bodyPartAnus != null) + this.bodyPartAnus.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + /* + //Draw Anus. //Allways draw + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0105f;//not sure what to do + else + vector.y += 0.0093f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = this.graphicAnus_horny; + if (graphic == null) + graphic = this.graphicAnus; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBelly && SizedApparelUtility.CanDrawBelly(___pawn, flags)) + { + if (this.bodyPartBelly != null) + this.bodyPartBelly.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + /* + //Draw Belly. Need Complex Hiding Calculation + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0002f;//not sure what to do + else + vector.y += 0.0098f; + Graphic graphic = this.graphicBelly; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawUdder && SizedApparelUtility.CanDrawUdder(___pawn, flags)) + { + if (this.bodyPartUdder != null) + this.bodyPartUdder.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + //Draw Udder. Need Complex Hiding Calculation -> + /* + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0015f;//not sure what to do + else + vector.y += 0.0088f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = this.graphicUdder_horny; + if (graphic == null) + graphic = this.graphicUdder; + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + }*/ + } + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBreasts && SizedApparelUtility.CanDrawBreasts(___pawn, flags) && (SizedApparelSettings.drawSizedApparelBreastsOnlyWorn ? !SizedApparelUtility.isPawnNaked(___pawn, flags) : true)) + { + if (this.bodyPartBreasts != null) + this.bodyPartBreasts.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + + //Log.Message("DrawBreasts for " + ___pawn.Name); + //if (SizedApparelSettings.Debug) + // Log.Message("trying to draw breasts"); + //Draw Breasts. Allways draw + + /* + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.001f;//not sure what to do + else + vector.y += 0.0113f; + Graphic graphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + graphic = this.graphicBreasts_horny; + if (graphic == null) + graphic = this.graphicBreasts; + + + + if (graphic != null) + { + Material mat; + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); + vector.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + } + else + { + //Log.Warning("[SizedApparel] Missing Breasts Graphic for: " + ___pawn.Name); + + } + */ + + } + + if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawPenis && SizedApparelUtility.CanDrawPenis(___pawn, flags, true)) + { + + if (SizedApparelSettings.hideBallOfFuta ? !Genital_Helper.is_futa(___pawn) : true) + { + foreach (SizedApparelBodyPart b in this.bodyPartBalls) + { + b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + } + } + foreach (SizedApparelBodyPart p in this.bodyPartPenises) + { + p.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); + } + /* + //Render Penis And Balls + Vector3 vector = rootLoc; + if (facing == Rot4.North) + vector.y += 0.0025f; + else + vector.y += 0.0108f; + + float offsetX = 0; // right and left + float offsetZ = 0; // up and down + + if(this.graphicPenises != null && this.graphicBallsOfPenises != null) + { + for (int i = 0; i < this.graphicPenises.Count; i++) + { + float t = (i + 1f) / (this.graphicPenises.Count + 1); + offsetX = Mathf.Lerp(-0.1f, 0.1f, t); + offsetZ = Mathf.Lerp(-0.05f, 0.05f, t); + + Graphic penisGraphic = null; + Graphic ballGraphic = null; + if (SizedApparelUtility.IsHorny(___pawn)) + { + penisGraphic = this.graphicPenises_horny[i]; + } + if (penisGraphic == null) + penisGraphic = this.graphicPenises[i]; + ballGraphic = this.graphicBallsOfPenises[i];//Balls Doesn't support HornyVariation + if (ballGraphic != null && (SizedApparelSettings.hideBallOfFuta ? Genital_Helper.is_futa(___pawn) : true)) + { + Material mat; + //TODO: vector2.y + Vector3 vector2 = vector; + if (facing == Rot4.North) + vector2.y += 0.0060f; + else + vector2.y -= 0.0012f; + if (facing == Rot4.North || facing == Rot4.South) + vector2.x += offsetX; + else + vector2.x += offsetX * 0.5f; + + if (facing == Rot4.East) + vector2.z += offsetZ; + if (facing == Rot4.West) + vector2.z -= offsetZ; + + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + ballGraphic = ballGraphic.GetColoredVersion(ballGraphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + ballGraphic = ballGraphic.GetColoredVersion(shader, skinColor, skinColor2); + vector2.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + } + if (penisGraphic != null) + { + Material mat; + Vector3 vector2 = vector; + if (facing == Rot4.North || facing == Rot4.South) + vector2.x += offsetX; + else + vector2.x += offsetX * 0.5f; + + if (facing == Rot4.East) + vector2.z += offsetZ; + if (facing == Rot4.West) + vector2.z -= offsetZ; + + if (!flags.FlagSet(PawnRenderFlags.Cache)) + { + penisGraphic = penisGraphic.GetColoredVersion(penisGraphic.Shader, skinColor, skinColor2); + mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue + } + penisGraphic = penisGraphic.GetColoredVersion(shader, skinColor, skinColor2); + //TODO: vector2.y + vector2.y += 0.00001f; + mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); + GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); + } + } + }*/ + + }//Draw BodyParts + + //Draw Modular Apparel Parts + if (flags.FlagSet(PawnRenderFlags.Clothes)) + { + + } + + + + } + + } + //not working public override void PostPostMake() @@ -288,9 +673,15 @@ namespace SizedApparel } public void ClearGraphics(bool clearBreasts = true) { + //Since Injection of base body is now in Matarial. no need to keep + graphicSourceNaked = null; + graphicSourceFurCovered = null; + graphicSourceRotten = null; + hasGraphicUpdatedBefore = false; graphicbaseBodyNaked = null; graphicbaseBodyRotten = null; + graphicbaseBodyFurCovered = null; //Clear BodyParts if(clearBreasts) @@ -345,7 +736,6 @@ namespace SizedApparel this.isDirty = true; if (clearPawnGraphicSet) { - Pawn pawn = parent as Pawn; if (pawn == null) return; if (pawn.Drawer == null) @@ -369,7 +759,6 @@ namespace SizedApparel } public void UpdateSettingData() { - Pawn pawn = parent as Pawn; if (pawn == null) return; @@ -381,7 +770,6 @@ namespace SizedApparel public void CheckAgeChanged() { - Pawn pawn = parent as Pawn; if (pawn == null) return; if (pawn.ageTracker == null) @@ -398,16 +786,130 @@ namespace SizedApparel isDrawAge = false; } + public void FindAndApplyBodyGraphic(Pawn pawn, Graphic sourceGraphic, ref Graphic targetGraphicBaseBody, ref Graphic cachedSourceGraphic, string debugName) + { + const string baseBodyString = "_BaseBody"; + string baseBodyStringWithSex; + + if (SizedApparelSettings.useGenderSpecificTexture) + { + if (pawn.gender == Gender.Female) + { + baseBodyStringWithSex = baseBodyString + "F"; + } + else if (pawn.gender == Gender.Male) + { + baseBodyStringWithSex = baseBodyString + "M"; + } + else + { + baseBodyStringWithSex = baseBodyString; // + "N" //Does it need to add N? + } + } + else + baseBodyStringWithSex = baseBodyString; + string targetGraphicPath = null; + if (sourceGraphic != null) + { + //path = path.Insert(Math.Max(path.LastIndexOf('/'), 0), "/CustomPose/"+ customPose); + if (cachedSourceGraphic == null) + cachedSourceGraphic = sourceGraphic; + targetGraphicPath = cachedSourceGraphic.path; + + if (customPose != null) + targetGraphicPath = targetGraphicPath.Insert(Math.Max(targetGraphicPath.LastIndexOf('/'), 0), "/CustomPose/" + customPose); + + if (!targetGraphicPath.Contains(baseBodyString)) + { + if (SizedApparelSettings.useGenderSpecificTexture && pawn.gender != Gender.None) + { + if (targetGraphicBaseBody == null) + { + if (ContentFinder.Get((targetGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + //cachedSourceGraphic = sourceGraphic; + Shader shader = sourceGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyStringWithSex, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //sourceGraphic = targetGraphicBaseBody; + } + else if (customPose != null) + { + targetGraphicPath = sourceGraphic.path; + if (ContentFinder.Get((targetGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + //cachedSourceGraphic = sourceGraphic; + Shader shader = sourceGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyStringWithSex, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //sourceGraphic = targetGraphicBaseBody; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for "+ debugName + " Graphic: " + targetGraphicPath + baseBodyStringWithSex + "_south"); + } + } + } + } + if (targetGraphicBaseBody == null) + { + if (ContentFinder.Get((targetGraphicPath + baseBodyString + "_south"), false) != null) + { + // cachedSourceGraphic = sourceGraphic; + Shader shader = sourceGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyString, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //sourceGraphic = targetGraphicBaseBody; + } + else if (customPose != null) + { + targetGraphicPath = sourceGraphic.path; + if (ContentFinder.Get((targetGraphicPath + baseBodyString + "_south"), false) != null) + { + //cachedSourceGraphic = sourceGraphic; + Shader shader = sourceGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyString, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); + //sourceGraphic = targetGraphicBaseBody; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for " + debugName + " Graphic: " + targetGraphicPath + baseBodyString + "_south"); + } + + } + } + + } + else + targetGraphicBaseBody = sourceGraphic; + + } + + } + public void Update(bool cache = true, bool fromGraphicRecord = true, bool updateGraphics = true, bool CheckApparel = true) { + if (cache) + recentClothFlag = CheckApparel; + isDirty = false; bool flag = fromGraphicRecord; needToCheckApparelGraphicRecords = false; //flag = false; //TODO:fromGraphicRecord is forced not to do for a while. it will update later hasUpdateBefore = true; - Pawn pawn = parent as Pawn; - if (pawn == null) + + + if (!SizedApparelUtility.CanApplySizedApparel(pawn)) return; + + if (SizedApparelSettings.Debug) Log.Message("[SizedApparel] Updating Component of " + pawn.Name); if (updateGraphics) @@ -420,6 +922,11 @@ namespace SizedApparel SizedApparelUtility.GetBreastSeverity(pawn, out breastSeverity, out breastHediff); if (breastHediff != null) { + if (pawn.gender == Gender.Male && !SizedApparelSettings.ApplyApparelPatchForMale) + { + CheckApparel = false; + } + BreastSeverityCache = 1000; if (CheckApparel) hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(pawn, breastSeverity, breastHediff, true, flag); @@ -433,14 +940,10 @@ namespace SizedApparel //breast cache forApparel brests Check. This ignore variation! //SizedApparelMod.CheckAndLoadAlienRaces(); - var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, breastHediff.def.defName, "Breasts", SizedApparelUtility.BreastSeverityInt(breastHediff.Severity)); + var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, breastHediff.def.defName, "Breasts", pawn.gender ,SizedApparelUtility.BreastSeverityInt(breastHediff.Severity)); var raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == key.raceName); - string customRaceName = null; - if (raceSetting != null && raceSetting.asHumanlike) - { - customRaceName = "Humanlike"; - } - float validBreastTextureSeverity = SizedApparelUtility.BreastSizeIndexToSeverity(SizedApparelsDatabase.GetSupportedBodyPartPath(key,true,"Breasts","Breasts", customRaceName).size); + + float validBreastTextureSeverity = SizedApparelUtility.BreastSizeIndexToSeverity(SizedApparelsDatabase.GetSupportedBodyPartPath(key,true,"Breasts","Breasts").size); //if (validBreastTextureSeverity < -5 && SizedApparelSettings.alienRaceSettings.settings[key.raceName].asHumanlike)//old: SizedApparelSettings.UnsupportedRaceToUseHumanlike // validBreastTextureSeverity = SizedApparelUtility.GetBreastSeverityValidTextures(pawn, breastHediff, "Humanlike"); BreastSeverityCache = Math.Min(BreastSeverityCache, validBreastTextureSeverity); @@ -457,8 +960,19 @@ namespace SizedApparel var genitalList = Genital_Helper.get_PartsHediffList(pawn, genitalPart); if (!genitalList.NullOrEmpty()) { - penisHediffs = genitalList.FindAll((Hediff h) => SizedApparelUtility.isPenis(h.def.defName)); - vaginaHediff = genitalList.FirstOrDefault((Hediff h) => SizedApparelUtility.isVagina(h.def.defName)); + if (SizedApparelSettings.Debug) + { + foreach (var g in genitalList) + { + Log.Message(" [SizedApparel] "+ pawn.Name + "has hediff in genital (" + g.def.defName + ")"); + } + } + + //penisHediffs = genitalList.FindAll((Hediff h) => SizedApparelUtility.isPenis(h.def.defName)); + penisHediffs = genitalList.FindAll((Hediff h) => Genital_Helper.is_penis(h)); + //vaginaHediff = genitalList.FirstOrDefault((Hediff h) => SizedApparelUtility.isVagina(h.def.defName)); + vaginaHediff = genitalList.FirstOrDefault((Hediff h) => Genital_Helper.is_vagina(h)); + } } @@ -474,51 +988,116 @@ namespace SizedApparel if (updateGraphics) { - if (pawnRenderer != null) { //pawnRenderer.ResolveAllGraphics(); - //TODO. Move BodyTextureSearch to utility + + + //TODO Use Function To Make Clear Code + /* + FindAndApplyBodyGraphic(pawn, pawnRenderer.nakedGraphic, ref graphicbaseBodyNaked, ref graphicSourceNaked,"Naked"); + FindAndApplyBodyGraphic(pawn, pawnRenderer.rottingGraphic, ref graphicbaseBodyRotten, ref graphicSourceRotten, "Rotting"); + FindAndApplyBodyGraphic(pawn, pawnRenderer.nakedGraphic, ref graphicbaseBodyFurCovered, ref graphicSourceFurCovered, "FurCuvered"); + */ + const string baseBodyString = "_BaseBody"; + string baseBodyStringWithSex; + + if (SizedApparelSettings.useGenderSpecificTexture) + { + if (pawn.gender == Gender.Female) + { + baseBodyStringWithSex = baseBodyString + "F"; + } + else if (pawn.gender == Gender.Male) + { + baseBodyStringWithSex = baseBodyString + "M"; + } + else + { + baseBodyStringWithSex = baseBodyString; // + "N" //Does it need to add N? + } + } + else + baseBodyStringWithSex = baseBodyString; + string nakedGraphicPath = null; if (pawnRenderer.nakedGraphic != null) { //path = path.Insert(Math.Max(path.LastIndexOf('/'), 0), "/CustomPose/"+ customPose); + if(graphicSourceNaked == null) + graphicSourceNaked = pawnRenderer.nakedGraphic; + nakedGraphicPath = graphicSourceNaked.path; if (customPose != null) nakedGraphicPath = nakedGraphicPath.Insert(Math.Max(nakedGraphicPath.LastIndexOf('/'), 0), "/CustomPose/" + customPose); - else - nakedGraphicPath = pawnRenderer.nakedGraphic.path; - if (!nakedGraphicPath.Contains("_BaseBody")) + if (!nakedGraphicPath.Contains(baseBodyString)) { - if (ContentFinder.Get((nakedGraphicPath + "_BaseBody" + "_south"), false) != null) + if (SizedApparelSettings.useGenderSpecificTexture & pawn.gender != Gender.None) { - graphicNaked = pawnRenderer.nakedGraphic; - Shader shader = pawnRenderer.nakedGraphic.Shader; - //if (!ShaderUtility.SupportsMaskTex(shader)) - // shader = ShaderDatabase.CutoutSkinOverlay; - graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + "_BaseBody", shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); - //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; - } - else if(customPose != null) - { - nakedGraphicPath = pawnRenderer.nakedGraphic.path; - if (ContentFinder.Get((nakedGraphicPath + "_BaseBody" + "_south"), false) != null) + if (graphicbaseBodyNaked == null) { - graphicNaked = pawnRenderer.nakedGraphic; + if (ContentFinder.Get((nakedGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + //graphicSourceNaked = pawnRenderer.nakedGraphic; + Shader shader = pawnRenderer.nakedGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; + } + else if (customPose != null) + { + nakedGraphicPath = pawnRenderer.nakedGraphic.path; + if (ContentFinder.Get((nakedGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + //graphicSourceNaked = pawnRenderer.nakedGraphic; + Shader shader = pawnRenderer.nakedGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + nakedGraphicPath + baseBodyStringWithSex + "_south"); + } + } + } + } + if (graphicbaseBodyNaked == null) + { + if (ContentFinder.Get((nakedGraphicPath + baseBodyString + "_south"), false) != null) + { + // graphicSourceNaked = pawnRenderer.nakedGraphic; Shader shader = pawnRenderer.nakedGraphic.Shader; //if (!ShaderUtility.SupportsMaskTex(shader)) // shader = ShaderDatabase.CutoutSkinOverlay; - graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + "_BaseBody", shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyString, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; } - else + else if (customPose != null) { - if (SizedApparelSettings.Debug) - Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + nakedGraphicPath + "_BaseBody" + "_south"); - } + nakedGraphicPath = pawnRenderer.nakedGraphic.path; + if (ContentFinder.Get((nakedGraphicPath + baseBodyString + "_south"), false) != null) + { + //graphicSourceNaked = pawnRenderer.nakedGraphic; + Shader shader = pawnRenderer.nakedGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyString, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); + //pawnRenderer.nakedGraphic = graphicbaseBodyNaked; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + nakedGraphicPath + baseBodyString + "_south"); + } + } } + } else graphicbaseBodyNaked = pawnRenderer.nakedGraphic; @@ -528,40 +1107,74 @@ namespace SizedApparel string rottingGraphicPath = null; if (pawnRenderer.rottingGraphic != null) { + if (graphicSourceRotten == null) + graphicSourceRotten = pawnRenderer.rottingGraphic; + rottingGraphicPath = graphicSourceRotten.path; + if (customPose != null) rottingGraphicPath = rottingGraphicPath.Insert(Math.Max(rottingGraphicPath.LastIndexOf('/'), 0), "/CustomPose/" + customPose); - else - rottingGraphicPath = pawnRenderer.rottingGraphic.path; - if (!rottingGraphicPath.Contains("_BaseBody")) + if (!rottingGraphicPath.Contains(baseBodyString)) { - if (ContentFinder.Get((rottingGraphicPath + "_BaseBody" + "_south"), false) != null) + if (graphicbaseBodyRotten == null) { - graphicRotten = pawnRenderer.rottingGraphic; - Shader shader = pawnRenderer.rottingGraphic.Shader; - //if (!ShaderUtility.SupportsMaskTex(shader)) - // shader = ShaderDatabase.CutoutSkinOverlay; - graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + "_BaseBody", shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); - //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; - } - else if (customPose != null) - { - rottingGraphicPath = pawnRenderer.rottingGraphic.path; - if (ContentFinder.Get((rottingGraphicPath + "_BaseBody" + "_south"), false) != null) + if (ContentFinder.Get((rottingGraphicPath + baseBodyStringWithSex + "_south"), false) != null) { - graphicRotten = pawnRenderer.rottingGraphic; + //graphicSourceRotten = pawnRenderer.rottingGraphic; Shader shader = pawnRenderer.rottingGraphic.Shader; //if (!ShaderUtility.SupportsMaskTex(shader)) // shader = ShaderDatabase.CutoutSkinOverlay; - graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + "_BaseBody", shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; } - else + else if (customPose != null) { - if (SizedApparelSettings.Debug) - Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + rottingGraphicPath + "_BaseBody" + "_south"); + rottingGraphicPath = pawnRenderer.rottingGraphic.path; + if (ContentFinder.Get((rottingGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + graphicSourceRotten = pawnRenderer.rottingGraphic; + Shader shader = pawnRenderer.rottingGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for rotting Graphic: " + rottingGraphicPath + baseBodyStringWithSex + "_south"); + } + } + if (graphicbaseBodyRotten == null) + { + if (ContentFinder.Get((rottingGraphicPath + baseBodyString + "_south"), false) != null) + { + //graphicSourceRotten = pawnRenderer.rottingGraphic; + Shader shader = pawnRenderer.rottingGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyString, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; + } + else if (customPose != null) + { + rottingGraphicPath = pawnRenderer.rottingGraphic.path; + if (ContentFinder.Get((rottingGraphicPath + baseBodyString + "_south"), false) != null) + { + graphicSourceRotten = pawnRenderer.rottingGraphic; + Shader shader = pawnRenderer.rottingGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyRotten = GraphicDatabase.Get(rottingGraphicPath + baseBodyString, shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); + //pawnRenderer.rottingGraphic = graphicbaseBodyRotten; + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for rotting Graphic: " + rottingGraphicPath + baseBodyString + "_south"); + } + } } - } } else @@ -569,6 +1182,78 @@ namespace SizedApparel } + string furCoveredGraphicPath = null; + if (pawnRenderer.furCoveredGraphic != null) + { + if (graphicSourceFurCovered == null) + graphicSourceFurCovered = pawnRenderer.furCoveredGraphic; + furCoveredGraphicPath = graphicSourceFurCovered.path; + + if (customPose != null) + furCoveredGraphicPath = furCoveredGraphicPath.Insert(Math.Max(furCoveredGraphicPath.LastIndexOf('/'), 0), "/CustomPose/" + customPose); + + if (!furCoveredGraphicPath.Contains(baseBodyString)) + { + if (graphicbaseBodyFurCovered == null) + { + if (ContentFinder.Get((furCoveredGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + Shader shader = pawnRenderer.furCoveredGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyFurCovered = GraphicDatabase.Get(furCoveredGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.furCoveredGraphic.drawSize, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo, pawnRenderer.furCoveredGraphic.data); + } + else if (customPose != null) + { + furCoveredGraphicPath = pawnRenderer.furCoveredGraphic.path; + if (ContentFinder.Get((furCoveredGraphicPath + baseBodyStringWithSex + "_south"), false) != null) + { + graphicSourceFurCovered = pawnRenderer.furCoveredGraphic; + Shader shader = pawnRenderer.furCoveredGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyFurCovered = GraphicDatabase.Get(furCoveredGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.furCoveredGraphic.drawSize, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo, pawnRenderer.furCoveredGraphic.data); + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for furCovered Graphic: " + furCoveredGraphicPath + baseBodyStringWithSex + "_south"); + } + } + if (graphicbaseBodyFurCovered == null) + { + if (ContentFinder.Get((furCoveredGraphicPath + baseBodyString + "_south"), false) != null) + { + Shader shader = pawnRenderer.furCoveredGraphic.Shader; + //if (!ShaderUtility.SupportsMaskTex(shader)) + // shader = ShaderDatabase.CutoutSkinOverlay; + graphicbaseBodyFurCovered = GraphicDatabase.Get(furCoveredGraphicPath + baseBodyString, shader, pawnRenderer.furCoveredGraphic.drawSize, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo, pawnRenderer.furCoveredGraphic.data); + } + else if (customPose != null) + { + furCoveredGraphicPath = pawnRenderer.furCoveredGraphic.path; + if (ContentFinder.Get((furCoveredGraphicPath + baseBodyString + "_south"), false) != null) + { + graphicSourceFurCovered = pawnRenderer.furCoveredGraphic; + Shader shader = pawnRenderer.furCoveredGraphic.Shader; + graphicbaseBodyFurCovered = GraphicDatabase.Get(furCoveredGraphicPath + baseBodyString, shader, pawnRenderer.furCoveredGraphic.drawSize, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo, pawnRenderer.furCoveredGraphic.data); + + } + else + { + if (SizedApparelSettings.Debug) + Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + furCoveredGraphicPath + baseBodyString + "_south"); + } + } + } + } + } + else + graphicbaseBodyFurCovered = pawnRenderer.furCoveredGraphic; + + } + + /* //Try to find sized Body if it's valid int offset = 9999; @@ -664,361 +1349,390 @@ namespace SizedApparel //graphicBreasts = SizedApparelUtility.GetBodyPartGraphic(pawn, breastHediff, true, "Breasts", "Breasts"); //if(graphicBreasts == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) // graphicBreasts = SizedApparelUtility.GetBodyPartGraphic(pawn, breastHediff, true, "Breasts", "Breasts", false, true, "Humanlike"); - string bodyPartPath = null; - SizedApparelsDatabase.PathAndSize cachedPathAndSize; - float breastSeverityCapped = breastSeverity; - if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip - breastSeverityCapped = Math.Min(BreastSeverityCache, breastSeverityCapped); - - string bodyTypeDefName = null; - if (pawn.story != null) - bodyTypeDefName = pawn.story.bodyType?.defName; - - if(breastHediff != null) + if (SizedApparelSettings.drawBodyParts)//body parts update { - var breastvar = breastHediff.TryGetComp(); + string bodyPartPath = null; - bodyPartBreasts.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(breastSeverityCapped), breastvar?.variation); - bodyPartBreasts.UpdateGraphic(); + SizedApparelsDatabase.PathAndSize cachedPathAndSize; - } - - - - - - if (udderHediff != null) - { - var udderVar = udderHediff.TryGetComp(); - - bodyPartUdder.SetHediffData(udderHediff.def.defName, SizedApparelUtility.BreastSeverityInt(udderHediff.Severity), 1000, udderVar?.variation); - bodyPartUdder.UpdateGraphic(); - - } - else - bodyPartUdder.SetHediffData(null, -1); - - - - float bellySeverity = 0; - List pregnancies = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("pregnancy")); - if (!pregnancies.NullOrEmpty()) - { - foreach (Hediff h in pregnancies) + if (SizedApparelSettings.drawBreasts) { - bellySeverity = Math.Max(bellySeverity, h.Severity); - } - } - /* - List eggs = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("egg")); - if (!eggs.NullOrEmpty()) - { - foreach (Hediff h in eggs) - { - bellySeverity = Math.Max(bellySeverity, h.Severity); - } - } - List mech = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("mech")); - if (!mech.NullOrEmpty()) - { - foreach (Hediff h in mech) - { - bellySeverity = Math.Max(bellySeverity, h.Severity); - } - } - List parasite = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("parasite")); - if (!parasite.NullOrEmpty()) - { - foreach (Hediff h in parasite) - { - bellySeverity = Math.Max(bellySeverity, h.Severity); - } - }*/ + float breastSeverityCapped = breastSeverity; + if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip + breastSeverityCapped = Math.Min(BreastSeverityCache, breastSeverityCapped); - //Licentia Lab Hediff - if (SizedApparelPatch.LicentiaActive) - { - Hediff cumflation = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumflation")); - Hediff cumstuffed = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumstuffed")); - bellySeverity += cumflation != null ? cumflation.Severity : 0; - bellySeverity += cumstuffed != null ? cumstuffed.Severity : 0; - } + string bodyTypeDefName = null; + if (pawn.story != null) + bodyTypeDefName = pawn.story.bodyType?.defName; - if (bellySeverity >= 0) - { - //var bellyVar = breastHediff.TryGetComp(); - string BellyVar = null; + if (breastHediff != null) + { + var breastvar = breastHediff.TryGetComp(); - bodyPartBelly.SetHediffData("BellyBulge", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity),1000, BellyVar); - bodyPartBelly.UpdateGraphic(); + bodyPartBreasts.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(breastSeverityCapped), breastvar?.variation); + bodyPartBreasts.UpdateGraphic(); + } + } + + + + + if (SizedApparelSettings.drawUdder) + { + if (udderHediff != null) + { + var udderVar = udderHediff.TryGetComp(); + + bodyPartUdder.SetHediffData(udderHediff.def.defName, SizedApparelUtility.BreastSeverityInt(udderHediff.Severity), 1000, udderVar?.variation); + bodyPartUdder.UpdateGraphic(); + + } + else + bodyPartUdder.SetHediffData(null, -1); + + } + + + if (SizedApparelSettings.drawBelly) + { + + float bellySeverity = 0; + List pregnancies = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("pregnan"));//pregnancy and pregnant + if (!pregnancies.NullOrEmpty()) + { + foreach (Hediff h in pregnancies) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + } + /* + List eggs = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("egg")); + if (!eggs.NullOrEmpty()) + { + foreach (Hediff h in eggs) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + } + List mech = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("mech")); + if (!mech.NullOrEmpty()) + { + foreach (Hediff h in mech) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + } + List parasite = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("parasite")); + if (!parasite.NullOrEmpty()) + { + foreach (Hediff h in parasite) + { + bellySeverity = Math.Max(bellySeverity, h.Severity); + } + }*/ + + //Licentia Lab Hediff + if (SizedApparelPatch.LicentiaActive) + { + Hediff cumflation = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumflation")); + Hediff cumstuffed = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumstuffed")); + bellySeverity += cumflation != null ? cumflation.Severity : 0; + bellySeverity += cumstuffed != null ? cumstuffed.Severity : 0; + } + + if (bellySeverity >= 0) + { + //var bellyVar = breastHediff.GetComp(); + string BellyVar = null; + + bodyPartBelly.SetHediffData("BellyBulge", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity), 1000, BellyVar); + bodyPartBelly.UpdateGraphic(); + /* + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "BellyBulge", "Belly", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity), false), false, "Belly", "BellyBulge"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicBelly = GraphicDatabase.Get(bodyPartPath); + } + else + graphicBelly = GraphicDatabase.Get(bodyPartPath); + }*/ + //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + //} + } + + } + + + if (SizedApparelSettings.drawVagina) + { + //graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina"); + //if(graphicVagina == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + // graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", false, true,"Humanlike"); + if (vaginaHediff != null) + { + var vaginaVar = vaginaHediff.TryGetComp(); + bodyPartVagina.SetHediffData(vaginaHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), 1000, vaginaVar?.variation); + bodyPartVagina.UpdateGraphic(); + /* + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), false), false, "Vagina", "Vagina"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicVagina = GraphicDatabase.Get(bodyPartPath); + } + else + graphicVagina = GraphicDatabase.Get(bodyPartPath); + } + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + } + else + graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + }*/ + //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); + //} + } + else + bodyPartVagina.SetHediffData(null, -1); + } + + + + //graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true); + //if(graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + // graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true, true, "Humanlike"); /* - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "BellyBulge", "Belly", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity), false), false, "Belly", "BellyBulge"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) + graphicPenises.Clear(); + graphicPenises_horny.Clear(); + graphicBallsOfPenises.Clear(); + */ + + if (SizedApparelSettings.drawPenis) { - if (cachedPathAndSize.isUnsupportedHumanlikePath) + //TODO: Optimize + bodyPartPenises.Clear(); + bodyPartBalls.Clear(); + if (penisHediffs != null) { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - graphicBelly = GraphicDatabase.Get(bodyPartPath); + + + for (int i = 0; i < penisHediffs.Count; i++) + { + Hediff penisHediff = penisHediffs[i]; + float offsetX = 0; // right and left + float offsetZ = 0; // up and down + float t = (i + 1f) / (penisHediffs.Count + 1); + offsetX = Mathf.Lerp(-0.05f, 0.05f, t); + offsetZ = Mathf.Lerp(-0.02f, 0.02f, t); + + if (penisHediff == null) + continue; + + var penisVar = penisHediff.TryGetComp(); + + SizedApparelBodyPart penis = new SizedApparelBodyPart(pawn, this, "Penis", SizedApparelBodyPartOf.Penis, "Penis", false, false); + penis.SetDepthOffsets(0.0108f, 0.0025f, 0.0108f, 0.0108f); + penis.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ)); + penis.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation); + penis.UpdateGraphic(); + bodyPartPenises.Add(penis); + + + SizedApparelBodyPart balls = new SizedApparelBodyPart(pawn, this, "Balls", SizedApparelBodyPartOf.Penis, "Penis", false, false, "Penis/Balls"); + balls.SetDepthOffsets(0.0096f, 0.0085f, 0.0096f, 0.0096f); + balls.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ)); + balls.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation); + balls.UpdateGraphic(); + bodyPartBalls.Add(balls); + + + /* + Graphic penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis"); + if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", false, true, "Humanlike"); + + Graphic penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true); + if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true, true, "Humanlike"); + */ + /* + Graphic penisGraphic = null; + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + penisGraphic = GraphicDatabase.Get(bodyPartPath); + } + else + penisGraphic = GraphicDatabase.Get(bodyPartPath); + } + //if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // penisGraphic = GraphicDatabase.Get(bodyPartPath); + //} + Graphic penisGraphicHorny = null; + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); + } + else + penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); + } + //if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); + //} + + //balls are no need horny graphic. it wiil share sametime + + //Graphic ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false); + //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + // ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false, true, "Humanlike"); + + + Graphic ballGraphic = null; + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) + { + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + ballGraphic = GraphicDatabase.Get(bodyPartPath); + } + else + ballGraphic = GraphicDatabase.Get(bodyPartPath); + } + //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // ballGraphic = GraphicDatabase.Get(bodyPartPath); + //} + + + if (true)//penisGraphic != null + { + graphicPenises.Add(penisGraphic); + graphicPenises_horny.Add(penisGraphicHorny); + graphicBallsOfPenises.Add(ballGraphic); + } + */ + } } - else - graphicBelly = GraphicDatabase.Get(bodyPartPath); - }*/ - //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - //{ - // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex; - // if (bodyPartPath != null) - // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); - //} - } - - - - //graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina"); - //if(graphicVagina == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - // graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", false, true,"Humanlike"); - if (vaginaHediff != null) - { - var vaginaVar = vaginaHediff.TryGetComp(); - bodyPartVagina.SetHediffData(vaginaHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity),1000, vaginaVar?.variation); - bodyPartVagina.UpdateGraphic(); - /* - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), false), false, "Vagina", "Vagina"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) - { - if (cachedPathAndSize.isUnsupportedHumanlikePath) - { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - graphicVagina = GraphicDatabase.Get(bodyPartPath); - } - else - graphicVagina = GraphicDatabase.Get(bodyPartPath); } - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) + else { - if (cachedPathAndSize.isUnsupportedHumanlikePath) - { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); - } - else - graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); - }*/ - //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - //{ - // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex; - // if (bodyPartPath != null) - // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath); - //} - } - else - bodyPartVagina.SetHediffData(null, -1); + bodyPartPenises.Clear(); + bodyPartBalls.Clear(); + } - //graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true); - //if(graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - // graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true, true, "Humanlike"); - /* - graphicPenises.Clear(); - graphicPenises_horny.Clear(); - graphicBallsOfPenises.Clear(); - */ - - //TODO: Optimize - bodyPartPenises.Clear(); - bodyPartBalls.Clear(); - if (penisHediffs != null) - { - - - for (int i = 0; i < penisHediffs.Count; i++) + if (SizedApparelSettings.drawAnus) { - Hediff penisHediff = penisHediffs[i]; - float offsetX = 0; // right and left - float offsetZ = 0; // up and down - float t = (i + 1f) / (penisHediffs.Count + 1); - offsetX = Mathf.Lerp(-0.05f, 0.05f, t); - offsetZ = Mathf.Lerp(-0.02f, 0.02f, t); - - if (penisHediff == null) - continue; - - var penisVar = penisHediff.TryGetComp(); - - SizedApparelBodyPart penis = new SizedApparelBodyPart(pawn, "Penis", SizedApparelBodyPartOf.Penis, "Penis", false, false); - penis.SetDepthOffsets(0.0108f, 0.0025f, 0.0108f, 0.0108f); - penis.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ)); - penis.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity),1000,penisVar?.variation); - penis.UpdateGraphic(); - bodyPartPenises.Add(penis); - - - SizedApparelBodyPart balls = new SizedApparelBodyPart(pawn, "Balls", SizedApparelBodyPartOf.Penis, "Penis", false, false, "Penis/Balls"); - balls.SetDepthOffsets(0.0096f, 0.0085f, 0.0096f, 0.0096f); - balls.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ)); - balls.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation); - balls.UpdateGraphic(); - bodyPartBalls.Add(balls); - /* - Graphic penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis"); - if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", false, true, "Humanlike"); + graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus"); + if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", false, true, "Humanlike"); - Graphic penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true); - if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true, true, "Humanlike"); + graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true); + if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true, true, "Humanlike"); */ - /* - Graphic penisGraphic = null; - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) + if (anusHediff != null) { - if (cachedPathAndSize.isUnsupportedHumanlikePath) + var anusVar = anusHediff.TryGetComp(); + + bodyPartAnus.SetHediffData(anusHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), 1000, anusVar?.variation); + bodyPartAnus.UpdateGraphic(); + + /* + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - penisGraphic = GraphicDatabase.Get(bodyPartPath); + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicAnus = GraphicDatabase.Get(bodyPartPath); + } + else + graphicAnus = GraphicDatabase.Get(bodyPartPath); } - else - penisGraphic = GraphicDatabase.Get(bodyPartPath); - } - //if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - //{ - // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex; - // if (bodyPartPath != null) - // penisGraphic = GraphicDatabase.Get(bodyPartPath); - //} - Graphic penisGraphicHorny = null; - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) - { - if (cachedPathAndSize.isUnsupportedHumanlikePath) + //if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicAnus = GraphicDatabase.Get(bodyPartPath); + //} + bodyPartPath = null; + cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus"); + bodyPartPath = cachedPathAndSize.pathWithSizeIndex; + if (bodyPartPath != null) { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); + if (cachedPathAndSize.isUnsupportedHumanlikePath) + { + if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) + graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); + } + else + graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); } - else - penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); - } - //if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - //{ - // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex; - // if (bodyPartPath != null) - // penisGraphicHorny = GraphicDatabase.Get(bodyPartPath); - //} - - //balls are no need horny graphic. it wiil share sametime - - //Graphic ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false); - //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - // ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false, true, "Humanlike"); - - - Graphic ballGraphic = null; - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) - { - if (cachedPathAndSize.isUnsupportedHumanlikePath) - { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - ballGraphic = GraphicDatabase.Get(bodyPartPath); - } - else - ballGraphic = GraphicDatabase.Get(bodyPartPath); - } - //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - //{ - // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis", "Humanlike").pathWithSizeIndex; - // if (bodyPartPath != null) - // ballGraphic = GraphicDatabase.Get(bodyPartPath); - //} - - - if (true)//penisGraphic != null - { - graphicPenises.Add(penisGraphic); - graphicPenises_horny.Add(penisGraphicHorny); - graphicBallsOfPenises.Add(ballGraphic); - } - */ - } - } - /* - graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus"); - if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", false, true, "Humanlike"); - - graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true); - if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true, true, "Humanlike"); - */ - if(anusHediff != null) - { - var anusVar = anusHediff.TryGetComp(); - - bodyPartAnus.SetHediffData(anusHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity),1000, anusVar?.variation); - bodyPartAnus.UpdateGraphic(); - - /* - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) - { - if (cachedPathAndSize.isUnsupportedHumanlikePath) - { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - graphicAnus = GraphicDatabase.Get(bodyPartPath); + //if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) + //{ + // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex; + // if (bodyPartPath != null) + // graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); + //}*/ } else - graphicAnus = GraphicDatabase.Get(bodyPartPath); + bodyPartAnus.SetHediffData(null, -1); } - //if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - //{ - // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex; - // if (bodyPartPath != null) - // graphicAnus = GraphicDatabase.Get(bodyPartPath); - //} - bodyPartPath = null; - cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus"); - bodyPartPath = cachedPathAndSize.pathWithSizeIndex; - if (bodyPartPath != null) - { - if (cachedPathAndSize.isUnsupportedHumanlikePath) - { - if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike) - graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); - } - else - graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); - } - //if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike) - //{ - // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex; - // if (bodyPartPath != null) - // graphicAnus_horny = GraphicDatabase.Get(bodyPartPath); - //}*/ + } - else - bodyPartAnus.SetHediffData(null, -1); - - - hasGraphicUpdatedBefore = true; } @@ -1110,7 +1824,7 @@ namespace SizedApparel public void SetPoseFromPoseSet(string poseSetName, bool autoUpdate = true, bool autoSetPawnGraphicDirty = false) { - if (poseSetName == null) + if (poseSetName.NullOrEmpty()) { ClearAllPose(autoUpdate, autoSetPawnGraphicDirty); return; diff --git a/source/SizedApparel/SizedApparelDef.cs b/source/SizedApparel/SizedApparelDef.cs new file mode 100644 index 0000000..524457a --- /dev/null +++ b/source/SizedApparel/SizedApparelDef.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RimWorld; +using Verse; +using HarmonyLib; +//using AlienRace; +using UnityEngine; +using rjw; + +namespace SizedApparel +{ + + //for avoid first hitch. some day it might need make pre def for fast cache... + + public class ApparelTexture + { + public BodyTypeDef bodytype; + public List textures; + + public string GetTexturePath(int level, out int result) + { + result = -1; + if (level < 0) + return null; + if (textures.Count > level) + { + result = level; + return textures[level]; + } + if (!textures.NullOrEmpty()) + { + result = textures.Count - 1; + return textures[result]; //return biggest as supported + } + return null; + } + } + + public class SizedApparelDef : Def + { + //def name must be match with apparels DefName + public bool hidingGenitals = false; // pants must be true + public List SizedTextures; + + public ApparelTexture GetApparelTexture(BodyTypeDef bodytype) + { + if(SizedTextures != null) + { + return SizedTextures.FirstOrDefault(a => a.bodytype == bodytype); + } + return null; + } + } + +} diff --git a/source/SizedApparel/SizedApparelDubsApparelPatch.cs b/source/SizedApparel/SizedApparelDubsApparelPatch.cs index 8cc6e14..5addbe4 100644 --- a/source/SizedApparel/SizedApparelDubsApparelPatch.cs +++ b/source/SizedApparel/SizedApparelDubsApparelPatch.cs @@ -17,7 +17,7 @@ namespace SizedApparel if (graphicSet == null) return; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return; comp.needToCheckApparelGraphicRecords = true; diff --git a/source/SizedApparel/SizedApparelMain.cs b/source/SizedApparel/SizedApparelMain.cs index aff6273..6c66053 100644 --- a/source/SizedApparel/SizedApparelMain.cs +++ b/source/SizedApparel/SizedApparelMain.cs @@ -7,6 +7,7 @@ using Verse; using HarmonyLib; using UnityEngine; using rjw; +using Rimworld_Animations; using System.Reflection; @@ -21,6 +22,84 @@ namespace SizedApparel } + public class RimworldAnimationPatch + { + public static void TickClipPostfix(CompBodyAnimator __instance, AnimationDef ___anim, int ___curStage, int ___actor, int ___clipTicks, float ___clipPercent) + { + + + if (!__instance.controlGenitalAngle) + return; + var comp = __instance.parent.GetComp(); + if (comp == null) + return; + comp.SetPenisAngle(__instance.genitalAngle); + + + if (!SizedApparelSettings.AnimationPatch)//Rotating Penis Setting(avobe) is set from RimworldAnimation Setting, not in SizedApparel. + return; + + foreach (var actor in __instance.actorsInCurrentAnimation) + { + //comp.ForceUpdateTickAnimation = true; + var actorcomp = actor.GetComp(); + //actorcomp.SetBreastJiggle(true); + actorcomp.ForceUpdateTickAnimation = true; + + } + return; + bool isFuckTick = false; + /* + var soundEffects = ((PawnAnimationClip)___anim.animationStages[___curStage].animationClips[___actor]).SoundEffects; + if (soundEffects.ContainsKey(___clipTicks) && (soundEffects[___clipTicks].Contains("Fuck") || soundEffects[___clipTicks].Contains("Suck"))) + { + isFuckTick = true; + } + else + { + const int jiggleTime = 3; + for(int i = 0; i < jiggleTime; i++) + { + if (soundEffects.ContainsKey(___clipTicks - i) && soundEffects[___clipTicks - i].Contains("Fuck")) + { + isFuckTick = true; + break; + } + } + }*/ + //need to find partner's breasts. + if (isFuckTick) + { + foreach(var actor in __instance.actorsInCurrentAnimation) + { + actor.GetComp().SetBreastJiggle(true); + } + } + else + { + foreach (var actor in __instance.actorsInCurrentAnimation) + { + actor.GetComp().SetBreastJiggle(false); + } + } + //may have some tick issue? too fast jiggle? + } + + //rjw's JobDriver_SexBaseInitiator end patch + public static void EndClipPostfix(CompBodyAnimator __instance) + { + if (!__instance.controlGenitalAngle) + return; + var comp = __instance.parent.GetComp(); + if (comp == null) + return; + comp.ForceUpdateTickAnimation = false; + comp.SetPenisAngle(0); + comp.SetBreastJiggle(false); + } + } + + [StaticConstructorOnStartup] [HarmonyPatch(typeof(Pawn_HealthTracker), "Notify_HediffChanged")] @@ -30,12 +109,13 @@ namespace SizedApparel { if (___pawn == null) return; - var comp = ___pawn.TryGetComp(); + var comp = ___pawn.GetComp(); if (comp == null) return; if (hediff == null) return; - if (SizedApparelUtility.isRJWParts(hediff.def.defName))/// + + if (SizedApparelUtility.isRJWParts(hediff))/// { //comp.ClearAll(); //comp.Update(); @@ -103,21 +183,45 @@ namespace SizedApparel [StaticConstructorOnStartup] public class BodyPatch { - public static void SetBodyGraphic(Pawn pawn,bool drawClothFlag = true, bool fromGraphicRecord = true) + public static void SetBodyGraphic(Pawn pawn, bool drawClothFlag = true, bool fromGraphicRecord = true, bool revert = false) { //Pawn_ApparelTracker __instance; //GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); //bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff); - ApparelRecorderComp comp = pawn.TryGetComp(); + ApparelRecorderComp comp = pawn.GetComp(); if (comp == null) return; + if (revert) + { + var pawnRenderer = pawn.Drawer?.renderer?.graphics; + //Log.Message("useBodyTexture"); + + /* + if (!pawnRenderer.AllResolved) + { + pawnRenderer.ResolveAllGraphics(); + }*/ + + if (pawnRenderer == null) + return; + if (comp.graphicSourceNaked != null) + pawnRenderer.nakedGraphic = comp.graphicSourceNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); + if (comp.graphicSourceRotten != null) + pawnRenderer.rottingGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + if (comp.graphicSourceFurCovered != null) + pawnRenderer.furCoveredGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.furCoveredGraphic.Shader, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo); + + } + + if (!comp.hasUpdateBefore) { //comp.Update(true, fromGraphicRecord); } + float breastSeverity = comp.breastSeverity; Hediff breastHediff = comp.breastHediff; @@ -135,250 +239,120 @@ namespace SizedApparel { pawnRenderer.ResolveAllGraphics(); }*/ - if (pawnRenderer == null) return; - string nakedGraphicPath = pawnRenderer.nakedGraphic?.path; - //Log.Message("nakedGraphicPath"); - string rottingGraphicPath = pawnRenderer.rottingGraphic?.path; - //Log.Message("rottingGraphicPath"); - int currentBreastSizeIndex = 0; - float currentBreastSeverity = 0; - Graphic nakedGraphic; - Graphic rottingGraphic; - bool validNakedTexture = false; - bool validRottingTexture = false; - int offset = 0; - - - /* - * Obsolete - if (SizedApparelSettings.DontReplaceBodyTextureOnNude == true && SizedApparelUtility.isPawnNaked(pawn)) - { - if (SizedApparelSettings.Debug) - Log.Message("[Sized Apparel] " + pawn.Name + "is Naked. And DontReplaceBodyTextureOnNude Option is active. Changing Body Texture is cancled."); - return; - }*/ if (!comp.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(pawn) || !drawClothFlag) { + if (comp.graphicbaseBodyNaked != null) + { pawnRenderer.nakedGraphic = comp.graphicbaseBodyNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); + + } if (comp.graphicbaseBodyRotten != null) + { pawnRenderer.rottingGraphic = comp.graphicbaseBodyRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + + } + if (comp.graphicbaseBodyFurCovered != null) + { + pawnRenderer.furCoveredGraphic = comp.graphicbaseBodyFurCovered.GetColoredVersion(pawnRenderer.furCoveredGraphic.Shader, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo); + + } } else { - if (comp.graphicNaked != null) - pawnRenderer.nakedGraphic = comp.graphicNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); - if (comp.graphicRotten != null) - pawnRenderer.rottingGraphic = comp.graphicRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + if (comp.graphicSourceNaked != null) + pawnRenderer.nakedGraphic = comp.graphicSourceNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); + if (comp.graphicSourceRotten != null) + pawnRenderer.rottingGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); + if (comp.graphicSourceFurCovered != null) + pawnRenderer.furCoveredGraphic = comp.graphicSourceFurCovered.GetColoredVersion(pawnRenderer.furCoveredGraphic.Shader, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo); + } return;//no need to replace full body texture anymore. - if (false && comp.hasUnsupportedApparel && SizedApparelSettings.useUnsupportedBodyTexture)//old method. no need to do. - { - //Log.Message("hasUnsupportedApparel"); - // SetBodyGraphic(__instance, true); - if (true) - { - if ((ContentFinder.Get((nakedGraphicPath + "_UnsupportedApparel" + "_south"), false) != null)) - { - nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + "_Unsupported", pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); - //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); - //validTexture = true; - //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); - pawnRenderer.nakedGraphic = nakedGraphic; - } - if ((ContentFinder.Get((rottingGraphicPath + "_UnsupportedApparel" + "_south"), false) != null)) - { - rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + "_UnsupportedApparel", pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); - //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); - //validTexture = true; - //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); - pawnRenderer.rottingGraphic = rottingGraphic; - } + /* + if (SizedApparelSettings.useBodyTexture == false) + return; - } + //Log.Message("Hello"); + if (pawnGraphicSet == null) + return; + + if (pawnGraphicSet.pawn.RaceProps.Humanlike == false) + return; + + return; + + + //Log.Message("SetBodyGraphic"); + //pawnGraphicSet.ClearCache(); + string path = pawnGraphicSet.pawn.story.bodyType.bodyNakedGraphicPath; + string path_bodyDessicated = pawnGraphicSet.pawn.story.bodyType.bodyDessicatedGraphicPath; + string filename; + string pathname; + string filename_bodyDessicated; + string pathname_bodyDessicated; + pathname = System.IO.Path.GetDirectoryName(path); + filename = System.IO.Path.GetFileName(path); + filename_bodyDessicated = System.IO.Path.GetFileName(path_bodyDessicated); + pathname_bodyDessicated = System.IO.Path.GetDirectoryName(path_bodyDessicated); + + //Log.Message("SetPath"); + bool validBody = false; + bool validDessicatedBody = false; + + //pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic + //pawnGraphicSet.pawn.Drawer.renderer.graphics.dessicatedGraphic + + if (hasUnsupportApparel) + { + //Log.Message("IfhasUnsupportApparel"); + //Graphic newBodyGraphic = null; + //Graphic newRottingGraphic = null; + //string path; + + //Log.Message("tryUnsupportedApparelBodyTexture"); + //OLD::pawnGraphicSet.pawn.Drawer.renderer.graphics + if (pawnGraphicSet.nakedGraphic != null) + if (ContentFinder.Get((pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null) + { + pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic = GraphicDatabase.Get(pawnGraphicSet.nakedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); + validBody = true; + } + if (pawnGraphicSet.dessicatedGraphic != null) + if (ContentFinder.Get((pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null) + { + pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get(pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.rottingGraphic.Shader, pawnGraphicSet.rottingGraphic.drawSize, pawnGraphicSet.rottingGraphic.color, pawnGraphicSet.rottingGraphic.colorTwo); + validDessicatedBody = true; + } } else { - if(!comp.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(pawn)) - { - - } - if (comp.graphicbaseBodyNaked!=null) - pawnRenderer.nakedGraphic = comp.graphicbaseBodyNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo); - if (comp.graphicbaseBodyRotten != null) - pawnRenderer.rottingGraphic = comp.graphicbaseBodyRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo); - - return;//no need to replace full body texture anymore. - while (offset < SizedApparelUtility.size.Length) - { - string breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, true, ref currentBreastSizeIndex, ref currentBreastSeverity); - //search bigger - //SizedApparelSettings.matchBodyTextureToMinimumApparelSize? currentBreastSizeIndex <= minSupportedBreasSizeIndex:true - if (validNakedTexture == false) + //Log.Message("undo"); + string currentPath = pawnGraphicSet.nakedGraphic.path; + string currentDessicatedPath = pawnGraphicSet.dessicatedGraphic.path; + //Log.Message(currentPath.Substring(0,currentPath.Length - "_UnsupportedApparel".Length)); + if (pawnGraphicSet.nakedGraphic != null) + if (ContentFinder.Get(currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null) { - if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) - { - if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) - { - nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); - //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); - //validTexture = true; - //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); - pawnRenderer.nakedGraphic = nakedGraphic; - validNakedTexture = true; - } - } + pawnGraphicSet.nakedGraphic = GraphicDatabase.Get((currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); + } - if (validRottingTexture == false) + if (pawnGraphicSet.dessicatedGraphic != null) + if (ContentFinder.Get(currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null) { - if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) - { - if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) - { - rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); - //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); - //validTexture = true; - //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); - pawnRenderer.rottingGraphic = rottingGraphic; - validRottingTexture = true; - } - } + pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get((currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); + } - //search smaller - - breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, false, ref currentBreastSizeIndex, ref currentBreastSeverity); - - if (validNakedTexture == false) - { - if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null)) - { - if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) - { - nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data); - //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); - //validTexture = true; - //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); - pawnRenderer.nakedGraphic = nakedGraphic; - validNakedTexture = true; - } - } - } - if (validRottingTexture == false) - { - if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null)) - { - if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true) - { - rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data); - //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); - //validTexture = true; - //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); - pawnRenderer.rottingGraphic = rottingGraphic; - validRottingTexture = true; - } - } - } - - if (validNakedTexture == true && validRottingTexture == true) - { - if (SizedApparelSettings.Debug) - Log.Message("[Sized Apparel] " + pawn.Name + "'s body texture has changed."); - break; - } - - offset++; - } - - } + }*/ + //pawnGraphicSet.ClearCache(); } - - - - return; - /* - if (SizedApparelSettings.useBodyTexture == false) - return; - - //Log.Message("Hello"); - if (pawnGraphicSet == null) - return; - - if (pawnGraphicSet.pawn.RaceProps.Humanlike == false) - return; - - return; - - - //Log.Message("SetBodyGraphic"); - //pawnGraphicSet.ClearCache(); - string path = pawnGraphicSet.pawn.story.bodyType.bodyNakedGraphicPath; - string path_bodyDessicated = pawnGraphicSet.pawn.story.bodyType.bodyDessicatedGraphicPath; - string filename; - string pathname; - string filename_bodyDessicated; - string pathname_bodyDessicated; - pathname = System.IO.Path.GetDirectoryName(path); - filename = System.IO.Path.GetFileName(path); - filename_bodyDessicated = System.IO.Path.GetFileName(path_bodyDessicated); - pathname_bodyDessicated = System.IO.Path.GetDirectoryName(path_bodyDessicated); - - //Log.Message("SetPath"); - bool validBody = false; - bool validDessicatedBody = false; - - //pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic - //pawnGraphicSet.pawn.Drawer.renderer.graphics.dessicatedGraphic - - if (hasUnsupportApparel) - { - //Log.Message("IfhasUnsupportApparel"); - //Graphic newBodyGraphic = null; - //Graphic newRottingGraphic = null; - //string path; - - //Log.Message("tryUnsupportedApparelBodyTexture"); - //OLD::pawnGraphicSet.pawn.Drawer.renderer.graphics - if (pawnGraphicSet.nakedGraphic != null) - if (ContentFinder.Get((pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null) - { - pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic = GraphicDatabase.Get(pawnGraphicSet.nakedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); - validBody = true; - } - if (pawnGraphicSet.dessicatedGraphic != null) - if (ContentFinder.Get((pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null) - { - pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get(pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.rottingGraphic.Shader, pawnGraphicSet.rottingGraphic.drawSize, pawnGraphicSet.rottingGraphic.color, pawnGraphicSet.rottingGraphic.colorTwo); - validDessicatedBody = true; - } - } - else - { - //Log.Message("undo"); - string currentPath = pawnGraphicSet.nakedGraphic.path; - string currentDessicatedPath = pawnGraphicSet.dessicatedGraphic.path; - //Log.Message(currentPath.Substring(0,currentPath.Length - "_UnsupportedApparel".Length)); - if (pawnGraphicSet.nakedGraphic != null) - if (ContentFinder.Get(currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null) - { - pawnGraphicSet.nakedGraphic = GraphicDatabase.Get((currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); - - } - if (pawnGraphicSet.dessicatedGraphic != null) - if (ContentFinder.Get(currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null) - { - pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get((currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo); - - } - - }*/ - //pawnGraphicSet.ClearCache(); } @@ -423,7 +397,7 @@ namespace SizedApparel return; if (__instance.pawn == null) return; - var comp = __instance.pawn.TryGetComp(); + var comp = __instance.pawn.GetComp(); if (comp == null) return; comp.ClearAll(); @@ -463,7 +437,7 @@ class GeneratePawnPatch return; if (Scribe.mode == LoadSaveMode.PostLoadInit) { - ApparelRecorderComp comp = __instance.pawn.TryGetComp(); + ApparelRecorderComp comp = __instance.pawn.GetComp(); if (comp == null) return; if (!comp.hasUpdateBefore) @@ -498,7 +472,7 @@ class GeneratePawnPatch //GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); //bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff); - ApparelRecorderComp comp = __instance.pawn.TryGetComp(); + ApparelRecorderComp comp = __instance.pawn.GetComp(); if (comp != null) { //comp.ClearBreastCacheValue(); @@ -632,7 +606,7 @@ class GeneratePawnPatch if (apparel.Wearer != null) { //rec = new ApparelGraphicRecord(null, null); - var comp = apparel.Wearer.TryGetComp(); + var comp = apparel.Wearer.GetComp(); //if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize) // BreastSeverity = comp.BreastSeverityCache; @@ -690,7 +664,7 @@ class GeneratePawnPatch { Graphic sizedGraphic = null; - string resultPath = SizedApparelsDatabase.GetSupportedApparelSizedPath(new SizedApparelsDatabase.SizedApparelDatabaseKey(rec.graphic.path, apparel?.Wearer?.def.defName, breastHediff.def.defName, 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); @@ -727,7 +701,7 @@ class GeneratePawnPatch { return; } - var comp = __instance.pawn.TryGetComp(); + var comp = __instance.pawn.GetComp(); if (comp == null) return; //comp.ClearAll(false); @@ -744,7 +718,7 @@ class GeneratePawnPatch //[HarmonyPatch(typeof(PawnGraphicSet))] //[HarmonyPatch("ResolveApparelGraphics")] //[HarmonyBefore(new string[] { "rimworld.erdelf.alien_race.main" })] - [StaticConstructorOnStartup] + [StaticConstructorOnStartup] //[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")] class ApparelFix { @@ -801,7 +775,7 @@ class GeneratePawnPatch //__instance.pawn.health.hediffSet.HasHediff(Hediff ,BodyPartRecord ,false); //__instance.pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null, null).Any((BodyPartRecord bpr) => bpr.untranslatedCustomLabel == label || bpr.def.defName == label); - var comp = __instance.pawn.TryGetComp(); + var comp = __instance.pawn.GetComp(); if (comp != null) { bool flag = false; @@ -1126,7 +1100,7 @@ class GeneratePawnPatch return; if (__instance.pawn == null) return; - var comp = __instance.pawn.TryGetComp(); + var comp = __instance.pawn.GetComp(); if (comp == null) return; comp.ClearAll(); @@ -1169,7 +1143,7 @@ class GeneratePawnPatch { public static void Prefix(CompRottable __instance) { - var comp = __instance.parent.TryGetComp(); + var comp = __instance.parent.GetComp(); if (comp == null) return; comp.SetDirty(); @@ -1182,7 +1156,7 @@ class GeneratePawnPatch { public static void Postfix(Pawn_AgeTracker __instance, Pawn ___pawn) { - var comp = ___pawn.TryGetComp(); + var comp = ___pawn.GetComp(); if (comp == null) return; comp.CheckAgeChanged(); @@ -1243,7 +1217,7 @@ class GeneratePawnPatch { public static void Postfix(ref PawnRenderer __instance, Pawn ___pawn, Rot4 rotation, ref Vector3 __result) { - ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + ApparelRecorderComp apparelRecorder = ___pawn.GetComp(); if (apparelRecorder == null) return; if (apparelRecorder.customPose != null) @@ -1254,8 +1228,37 @@ class GeneratePawnPatch } } - //RimWorld 1.3 - [HarmonyPatch(typeof(PawnRenderer), "DrawPawnBody")] + [HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")] + public class GeneChangePatch + { + public static void Postfix(Pawn_GeneTracker __instance, GeneDef addedOrRemovedGene) + { + ApparelRecorderComp apparelRecorder = __instance.pawn.GetComp(); + if (apparelRecorder == null) + return; + if (addedOrRemovedGene.bodyType!= null) + { + /* + apparelRecorder.Update(); + if (SizedApparelSettings.drawBodyParts) + BodyPatch.SetBodyGraphic(__instance.pawn); + */ + apparelRecorder.SetDirty(); + return; + } + if(addedOrRemovedGene.graphicData != null) + { + if(addedOrRemovedGene.graphicData.fur != null) + { + apparelRecorder.SetDirty(); + return; + } + } + } + } + + //RimWorld 1.3 + [HarmonyPatch(typeof(PawnRenderer), "DrawPawnBody")] public class DrawPawnBodyPatch { static MethodInfo overrideMatMethod = AccessTools.Method(typeof(PawnRenderer), "OverrideMaterialIfNeeded"); @@ -1267,7 +1270,7 @@ class GeneratePawnPatch return; if (___pawn == null) return; - ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + ApparelRecorderComp apparelRecorder = ___pawn.GetComp(); if (apparelRecorder == null) return; //!flags.FlagSet(PawnRenderFlags.StylingStation)&& @@ -1284,10 +1287,10 @@ class GeneratePawnPatch { //apparelRecorder.isDirty is allways true - if (false)//StylingStation Doesn't work with cache! patch in postfix + if (true)//StylingStation Doesn't work with cache! patch in postfix { - apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes)); - //Log.Message(" [Sized Apparel]StylingStation:: isDirty? : " + apparelRecorder.isDirty); + if(apparelRecorder.recentClothFlag != flags.FlagSet(PawnRenderFlags.Clothes)) + apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes)); if(flags.FlagSet(PawnRenderFlags.Clothes)) SizedApparelUtility.UpdateAllApparel(___pawn, true); } @@ -1301,6 +1304,7 @@ class GeneratePawnPatch if (SizedApparelSettings.Debug) Log.Message("[SizedApparel] trying to draw " + ___pawn.Name + " with unupdated component or SetDirty! Updating it."); //apparelRecorder.ClearAll(); + //Todo. Async Update? apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes)); SizedApparelUtility.UpdateAllApparel(___pawn,true); } @@ -1311,15 +1315,19 @@ class GeneratePawnPatch //SizedApparelUtility.UpdateAllApparel(___pawn, true); } } + return; + //don't change body graphic file. it will inject material in PawnGraphicSet.MatsBodyBaseAt if (SizedApparelSettings.drawBodyParts) BodyPatch.SetBodyGraphic(___pawn, flags.FlagSet(PawnRenderFlags.Clothes), false); + else + BodyPatch.SetBodyGraphic(___pawn, flags.FlagSet(PawnRenderFlags.Clothes), false, false); } public static void Postfix(ref PawnRenderer __instance, Vector3 rootLoc, float angle, Rot4 facing, RotDrawMode bodyDrawType, PawnRenderFlags flags, Pawn ___pawn, Mesh bodyMesh) { if (___pawn == null) return; - ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + ApparelRecorderComp apparelRecorder = ___pawn.GetComp(); if (apparelRecorder == null) return; Quaternion quaternion = Quaternion.AngleAxis(angle, Vector3.up); @@ -1332,6 +1340,7 @@ class GeneratePawnPatch string defName = __instance.graphics.pawn.def.defName; + /* Shader shader = ___pawn.Drawer.renderer.graphics.nakedGraphic.Shader; Color skinColor = Color.white; Color skinColor2 = Color.white; @@ -1349,8 +1358,19 @@ class GeneratePawnPatch if (!ShaderUtility.SupportsMaskTex(shader)) shader = ShaderDatabase.CutoutSkinOverlay; skinColor = ___pawn.Drawer.renderer.graphics.rottingGraphic.Color; - skinColor2 = ___pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo; - } + skinColor2 = ___pawn.Drawer.renderer.graphics.rottingGraphic.ColorTwo; + }*/ + + /* + //FurCoveredColor + if(bodyDrawType == RotDrawMode.Fresh && __instance.graphics.furCoveredGraphic != null) + { + shader = ___pawn.Drawer.renderer.graphics.furCoveredGraphic.Shader; + if (!ShaderUtility.SupportsMaskTex(shader)) + shader = ShaderDatabase.CutoutSkinOverlay; + skinColor = ___pawn.Drawer.renderer.graphics.furCoveredGraphic.Color; + skinColor2 = ___pawn.Drawer.renderer.graphics.furCoveredGraphic.ColorTwo; + }*/ @@ -1361,289 +1381,138 @@ class GeneratePawnPatch } //breasts are only rendered when all of worn apparels are supported or nude. - if (apparelRecorder.isDrawAge && (!flags.FlagSet(PawnRenderFlags.Clothes) || !apparelRecorder.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(___pawn))) //TODO : Move it to CanDraw + if (__instance.graphics.furCoveredGraphic == null) { - if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawVagina && SizedApparelUtility.CanDrawVagina(___pawn, flags)) - { - if(apparelRecorder.bodyPartVagina != null) - apparelRecorder.bodyPartVagina.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); - /* - //Draw Vagina. AllwaysDraw - Vector3 vector = rootLoc; - if (facing == Rot4.North) - vector.y += 0.0100f;//not sure what to do - else - vector.y += 0.0088f; - Graphic graphic = null; - if (SizedApparelUtility.IsHorny(___pawn)) - graphic = apparelRecorder.graphicVagina_horny; - if (graphic == null) - graphic = apparelRecorder.graphicVagina; - if (graphic != null) - { - Material mat; - if (!flags.FlagSet(PawnRenderFlags.Cache)) - { - graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue - } - graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); - vector.y += 0.00001f; - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); - }*/ - } - if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawAnus && SizedApparelUtility.CanDrawAnus(___pawn, flags)) - { - if (apparelRecorder.bodyPartAnus != null) - apparelRecorder.bodyPartAnus.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); - /* - //Draw Anus. //Allways draw - Vector3 vector = rootLoc; - if (facing == Rot4.North) - vector.y += 0.0105f;//not sure what to do - else - vector.y += 0.0093f; - Graphic graphic = null; - if (SizedApparelUtility.IsHorny(___pawn)) - graphic = apparelRecorder.graphicAnus_horny; - if (graphic == null) - graphic = apparelRecorder.graphicAnus; - if (graphic != null) - { - Material mat; - if (!flags.FlagSet(PawnRenderFlags.Cache)) - { - graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue - } - graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); - vector.y += 0.00001f; - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); - }*/ - } - - if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBelly && SizedApparelUtility.CanDrawBelly(___pawn, flags)) - { - if (apparelRecorder.bodyPartBelly != null) - apparelRecorder.bodyPartBelly.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); - /* - //Draw Belly. Need Complex Hiding Calculation - Vector3 vector = rootLoc; - if (facing == Rot4.North) - vector.y += 0.0002f;//not sure what to do - else - vector.y += 0.0098f; - Graphic graphic = apparelRecorder.graphicBelly; - if (graphic != null) - { - Material mat; - if (!flags.FlagSet(PawnRenderFlags.Cache)) - { - graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue - } - graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); - vector.y += 0.00001f; - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); - }*/ - } - - if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawUdder && SizedApparelUtility.CanDrawUdder(___pawn, flags)) - { - if (apparelRecorder.bodyPartUdder != null) - apparelRecorder.bodyPartUdder.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); - //Draw Udder. Need Complex Hiding Calculation -> - /* - Vector3 vector = rootLoc; - if (facing == Rot4.North) - vector.y += 0.0015f;//not sure what to do - else - vector.y += 0.0088f; - Graphic graphic = null; - if (SizedApparelUtility.IsHorny(___pawn)) - graphic = apparelRecorder.graphicUdder_horny; - if (graphic == null) - graphic = apparelRecorder.graphicUdder; - if (graphic != null) - { - Material mat; - if (!flags.FlagSet(PawnRenderFlags.Cache)) - { - graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue - } - graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); - vector.y += 0.00001f; - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); - }*/ - } - if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBreasts && SizedApparelUtility.CanDrawBreasts(___pawn, flags) && (SizedApparelSettings.drawSizedApparelBreastsOnlyWorn ? !SizedApparelUtility.isPawnNaked(___pawn, flags) : true)) - { - if (apparelRecorder.bodyPartBreasts != null) - apparelRecorder.bodyPartBreasts.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); - - //Log.Message("DrawBreasts for " + ___pawn.Name); - //if (SizedApparelSettings.Debug) - // Log.Message("trying to draw breasts"); - //Draw Breasts. Allways draw - - /* - Vector3 vector = rootLoc; - if (facing == Rot4.North) - vector.y += 0.001f;//not sure what to do - else - vector.y += 0.0113f; - Graphic graphic = null; - if (SizedApparelUtility.IsHorny(___pawn)) - graphic = apparelRecorder.graphicBreasts_horny; - if (graphic == null) - graphic = apparelRecorder.graphicBreasts; - - - - if (graphic != null) - { - Material mat; - if (!flags.FlagSet(PawnRenderFlags.Cache)) - { - graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2); - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue - } - graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2); - vector.y += 0.00001f; - mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); - } - else - { - //Log.Warning("[SizedApparel] Missing Breasts Graphic for: " + ___pawn.Name); - - } - */ - - } - - if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawPenis && SizedApparelUtility.CanDrawPenis(___pawn, flags, true)) - { - foreach(SizedApparelBodyPart b in apparelRecorder.bodyPartBalls) - { - b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); - } - foreach (SizedApparelBodyPart b in apparelRecorder.bodyPartPenises) - { - b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh); - } - /* - //Render Penis And Balls - Vector3 vector = rootLoc; - if (facing == Rot4.North) - vector.y += 0.0025f; - else - vector.y += 0.0108f; - - float offsetX = 0; // right and left - float offsetZ = 0; // up and down - - if(apparelRecorder.graphicPenises != null && apparelRecorder.graphicBallsOfPenises != null) - { - for (int i = 0; i < apparelRecorder.graphicPenises.Count; i++) - { - float t = (i + 1f) / (apparelRecorder.graphicPenises.Count + 1); - offsetX = Mathf.Lerp(-0.1f, 0.1f, t); - offsetZ = Mathf.Lerp(-0.05f, 0.05f, t); - - Graphic penisGraphic = null; - Graphic ballGraphic = null; - if (SizedApparelUtility.IsHorny(___pawn)) - { - penisGraphic = apparelRecorder.graphicPenises_horny[i]; - } - if (penisGraphic == null) - penisGraphic = apparelRecorder.graphicPenises[i]; - ballGraphic = apparelRecorder.graphicBallsOfPenises[i];//Balls Doesn't support HornyVariation - if (ballGraphic != null && (SizedApparelSettings.hideBallOfFuta ? Genital_Helper.is_futa(___pawn) : true)) - { - Material mat; - //TODO: vector2.y - Vector3 vector2 = vector; - if (facing == Rot4.North) - vector2.y += 0.0060f; - else - vector2.y -= 0.0012f; - if (facing == Rot4.North || facing == Rot4.South) - vector2.x += offsetX; - else - vector2.x += offsetX * 0.5f; - - if (facing == Rot4.East) - vector2.z += offsetZ; - if (facing == Rot4.West) - vector2.z -= offsetZ; - - if (!flags.FlagSet(PawnRenderFlags.Cache)) - { - ballGraphic = ballGraphic.GetColoredVersion(ballGraphic.Shader, skinColor, skinColor2); - mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue - } - ballGraphic = ballGraphic.GetColoredVersion(shader, skinColor, skinColor2); - vector2.y += 0.00001f; - mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); - } - if (penisGraphic != null) - { - Material mat; - Vector3 vector2 = vector; - if (facing == Rot4.North || facing == Rot4.South) - vector2.x += offsetX; - else - vector2.x += offsetX * 0.5f; - - if (facing == Rot4.East) - vector2.z += offsetZ; - if (facing == Rot4.West) - vector2.z -= offsetZ; - - if (!flags.FlagSet(PawnRenderFlags.Cache)) - { - penisGraphic = penisGraphic.GetColoredVersion(penisGraphic.Shader, skinColor, skinColor2); - mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue - } - penisGraphic = penisGraphic.GetColoredVersion(shader, skinColor, skinColor2); - //TODO: vector2.y - vector2.y += 0.00001f; - mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) }); - GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); - } - } - }*/ - - }//Draw BodyParts - - //Draw Modular Apparel Parts - if (flags.FlagSet(PawnRenderFlags.Clothes)) - { - - } - - - + apparelRecorder.UpdateTickAnim(rootLoc,angle); + apparelRecorder.DrawAllBodyParts(rootLoc,angle,facing,bodyDrawType,flags,___pawn, bodyMesh); } + //else. the DrawPawnFur will draw bodyparts becaust it should be upper } } + + + //Base Body Graphic Injection + [HarmonyPatch(typeof(PawnGraphicSet), "MatsBodyBaseAt")] + public class MatsBodyBastAtPatch + { + public static void Postfix(ref List __result, PawnGraphicSet __instance, Rot4 facing, bool dead, RotDrawMode bodyCondition, bool drawClothes) + { + if (!SizedApparelSettings.useBodyTexture) + return; + + if (__result.NullOrEmpty()) + return; + var comp = __instance.pawn.GetComp(); + Material bodyMat = null; + Material sizedApparelBaseBodyMat = null; + switch (bodyCondition) + { + case RotDrawMode.Fresh: + if (dead && __instance.corpseGraphic != null) + { + return; //don't inject for corpse graphic since the mod doesn't support yet. + bodyMat = __instance.corpseGraphic.MatAt(facing, null); + if(comp.graphicbaseBodyCorpse != null) + sizedApparelBaseBodyMat = comp.graphicbaseBodyCorpse.MatAt(facing, null); + } + else + { + bodyMat = __instance.nakedGraphic.MatAt(facing, null); + if (comp.graphicbaseBodyNaked != null) + sizedApparelBaseBodyMat = comp.graphicbaseBodyNaked.MatAt(facing, null); + } + break; + case RotDrawMode.Rotting: + bodyMat = __instance.rottingGraphic.MatAt(facing, null); + if (comp.graphicbaseBodyRotten != null) + sizedApparelBaseBodyMat = comp.graphicbaseBodyRotten.MatAt(facing, null); + break; + case RotDrawMode.Dessicated: + return;// //don't inject for Dessicated graphic. it doesn't need to patch for this + break; + default: + bodyMat = null; + sizedApparelBaseBodyMat = null; + break; + } + + if (sizedApparelBaseBodyMat == null) + return; + + //the body mat would be in first index but not sure. so search from start + for (int i = 0; i < __result.Count; i++) + { + if(__result[i] == bodyMat) + { + __result[i] = sizedApparelBaseBodyMat; + //should inject body part graphics here? + break; + } + } + //should do something more? such as add body parts or somthing? + } + } + + [HarmonyPatch(typeof(PawnRenderer), "DrawPawnFur")] + public class DrawPawnFurPatch + { + public static void Prefix() + { + + } + //when this function called, the drawpawnbody did not draw sizedapparel body parts. draw pawn fur will draw those. + //this is for sort graphics in some renderer case, some render are sorted by call order + public static void Postfix(PawnRenderer __instance, Pawn ___pawn, Vector3 shellLoc, Rot4 facing, Quaternion quat, PawnRenderFlags flags) + { + var comp = ___pawn.GetComp(); + float angle; + Vector3 v; + quat.ToAngleAxis(out angle, out v); + Mesh mesh = HumanlikeMeshPoolUtility.GetHumanlikeBodySetForPawn(___pawn).MeshAt(facing); + Vector3 loc = shellLoc; + loc.y -= 0.009187258f; //rimworld 1.4 add 0.009187258f; + + comp.UpdateTickAnim(loc, angle); + + comp.DrawAllBodyParts(loc, angle, facing, RotDrawMode.Fresh, flags, ___pawn, mesh); + } + } + //Base Body Graphic Injection for FurCovered + [HarmonyPatch(typeof(PawnGraphicSet), "FurMatAt")] + public class MatsFurMatAtPatch + { + //TODO should do in Postfix...? or Prefix? + public static void Postfix(ref Material __result, PawnGraphicSet __instance, Rot4 facing, bool portrait = false, bool cached = false) + { + if (!SizedApparelSettings.useBodyTexture) + return; + + if (__result == null) + return; + var comp = __instance.pawn.GetComp(); + Material sizedApparelBaseBodyMat = null; + + if (comp.graphicbaseBodyFurCovered != null) + sizedApparelBaseBodyMat = comp.graphicbaseBodyFurCovered.MatAt(facing, null); + + if (sizedApparelBaseBodyMat == null) + return; + + if (!portrait && __instance.pawn.IsInvisible()) + { + sizedApparelBaseBodyMat = InvisibilityMatPool.GetInvisibleMat(sizedApparelBaseBodyMat); + } + if (!cached) + { + sizedApparelBaseBodyMat = __instance.flasher.GetDamagedMat(sizedApparelBaseBodyMat); + } + + __result = sizedApparelBaseBodyMat; + } + } + //TODO [HarmonyPatch(typeof(PawnRenderer), "BaseHeadOffsetAt")] public class HeadOffsetPatch @@ -1651,7 +1520,7 @@ class GeneratePawnPatch public static void Postfix(PawnRenderer __instance, Pawn ___pawn, Rot4 rotation, ref Vector3 __result) { - var comp = ___pawn.TryGetComp(); + var comp = ___pawn.GetComp(); if (comp == null) return; } @@ -1681,7 +1550,7 @@ class GeneratePawnPatch return; if (___pawn == null) return; - ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + ApparelRecorderComp apparelRecorder = ___pawn.GetComp(); if (apparelRecorder == null) return; if (!apparelRecorder.hasUpdateBefore || apparelRecorder.isDirty) @@ -1713,7 +1582,7 @@ class GeneratePawnPatch if (___pawn == null) return; - ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp(); + ApparelRecorderComp apparelRecorder = ___pawn.GetComp(); if (apparelRecorder == null) return; Quaternion quaternion = Quaternion.AngleAxis(angle, Vector3.up); diff --git a/source/SizedApparel/SizedApparelPoseSet.cs b/source/SizedApparel/SizedApparelPoseSet.cs index ff7eb81..eca912c 100644 --- a/source/SizedApparel/SizedApparelPoseSet.cs +++ b/source/SizedApparel/SizedApparelPoseSet.cs @@ -26,7 +26,7 @@ namespace SizedApparel return; /* - var comp = ___pawn.TryGetComp(); + var comp = ___pawn.GetComp(); if (comp == null) return; diff --git a/source/SizedApparel/SizedApparelRJWPatch.cs b/source/SizedApparel/SizedApparelRJWPatch.cs index bc1aecf..7501d1d 100644 --- a/source/SizedApparel/SizedApparelRJWPatch.cs +++ b/source/SizedApparel/SizedApparelRJWPatch.cs @@ -18,7 +18,7 @@ namespace SizedApparel { if (!UnityData.IsInMainThread) return; - ApparelRecorderComp comp = pawn?.TryGetComp(); + ApparelRecorderComp comp = pawn?.GetComp(); if (comp == null) return; comp.SetDirty(); @@ -69,7 +69,7 @@ namespace SizedApparel return; //GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff); //bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff); - ApparelRecorderComp comp = pawn.TryGetComp(); + ApparelRecorderComp comp = pawn.GetComp(); if (comp != null) { /* @@ -128,7 +128,7 @@ namespace SizedApparel { if (pawn == null) return; - ApparelRecorderComp comp = pawn.TryGetComp(); + ApparelRecorderComp comp = pawn.GetComp(); if (comp == null) return; comp.SetDirty(); @@ -146,7 +146,7 @@ namespace SizedApparel - ApparelRecorderComp pawnARC = __instance.pawn.TryGetComp(); + ApparelRecorderComp pawnARC = __instance.pawn.GetComp(); if (pawnARC != null) { if (__instance.pawn.RaceProps.Humanlike) @@ -161,7 +161,7 @@ namespace SizedApparel var partner = __instance.Partner as Pawn; if (partner == null) return; - ApparelRecorderComp partnerARC = partner.TryGetComp(); + ApparelRecorderComp partnerARC = partner.GetComp(); if (partnerARC != null) { if (partner.RaceProps.Humanlike) @@ -182,7 +182,7 @@ namespace SizedApparel { - ApparelRecorderComp pawnARC = __instance.pawn.TryGetComp(); + ApparelRecorderComp pawnARC = __instance.pawn.GetComp(); if (pawnARC != null) { @@ -209,7 +209,7 @@ namespace SizedApparel var partner = __instance.Partner as Pawn; if (partner == null) return; - ApparelRecorderComp partnerARC = partner.TryGetComp(); + ApparelRecorderComp partnerARC = partner.GetComp(); if (partnerARC != null) { partnerARC.havingSex = false; diff --git a/source/SizedApparel/SizedApparelRNWPatch.cs b/source/SizedApparel/SizedApparelRNWPatch.cs index 3971a36..cdc4e93 100644 --- a/source/SizedApparel/SizedApparelRNWPatch.cs +++ b/source/SizedApparel/SizedApparelRNWPatch.cs @@ -36,7 +36,7 @@ namespace SizedApparel { if (__result == false) return; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return; if (comp.hasUnsupportedApparel) diff --git a/source/SizedApparel/SizedApparelSettingcs.cs b/source/SizedApparel/SizedApparelSettingcs.cs index f50de46..e10c8a0 100644 --- a/source/SizedApparel/SizedApparelSettingcs.cs +++ b/source/SizedApparel/SizedApparelSettingcs.cs @@ -16,7 +16,7 @@ namespace SizedApparel { public string raceName = null; public bool overrideDef = false; - public bool asHumanlike = false; + public bool asHumanlike = true; 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 asHumanlike, "asHumanlike", false); + Scribe_Values.Look(ref asHumanlike, "asHumanlike", true); Scribe_Values.Look(ref drawMinAge, "drawMinAge", -1); } @@ -47,8 +47,12 @@ namespace SizedApparel public static bool DetailLog = false; public static bool autoClearCacheOnWriteSetting = true; + public static bool PreCacheOnLoad = true; + public static float PreCacheRandomFactor = 0.5f; + public static bool useBodyTexture = true;//for user who not use rimnudeworld + public static bool useGenderSpecificTexture = true; public static bool matchBodyTextureToMinimumApparelSize = true;//for avoiding breasts cliping @@ -59,6 +63,23 @@ namespace SizedApparel + //Apply Target Pawn Category + public static bool ApplyHumanlikes = true; //Always true. + public static bool ApplyAnimals = false; + public static bool ApplyAnimalsPlayerFactionOnly = true; //TODO + public static bool ApplyMechanoid = false; + + public static bool ApplyApparelPatchForMale = false; //only ApparelServerityWork. + + public static bool ApplyColonists = true; + public static bool ApplySlaves = true; + public static bool ApplyPrisoner = true; + public static bool ApplyNeutralAndAlly = true; + public static bool ApplyHostile = false; + + + public static bool AnimationPatch = true; + //TODO: Standalone render bodyparts. public static bool drawBodyParts = true;//for user who not use rimnudeworld public static bool drawBreasts = true; @@ -76,7 +97,7 @@ namespace SizedApparel public static bool useBodyPartsVariation = true; public static bool showBodyPartsVariation = true; - public static bool autoJiggleBreasts = true; + public static bool breastsPhysics = false; //RimNudeWorld public static bool drawSizedApparelBreastsOnlyWorn = false; @@ -170,7 +191,16 @@ namespace SizedApparel //force to use it. this is important thing. //Scribe_Values.Look(ref useBreastSizeCapForApparels, "useBreastSizeCapForApparels", true); + //Apply Categories. + Scribe_Values.Look(ref ApplyAnimals, "ApplyAnimals", false); + Scribe_Values.Look(ref ApplyHumanlikes, "ApplyHumanlikes", true); + Scribe_Values.Look(ref ApplyMechanoid, "ApplyMechanoid", false); + + Scribe_Values.Look(ref AnimationPatch, "AnimationPatch", true); + Scribe_Values.Look(ref useBodyTexture, "useBodyTexture", true); + Scribe_Values.Look(ref useGenderSpecificTexture, "useGenderSpecificTexture", true); + Scribe_Values.Look(ref matchBodyTextureToMinimumApparelSize, "matchBodyTextureToMinimumApparelSize", true); Scribe_Values.Look(ref matchBreastToSupportedApparelSize, "matchBreastToSupportedApparelSize", true); @@ -238,6 +268,10 @@ namespace SizedApparel //TODO: Humanlike Setting Per Race //Scribe_Values.Look(ref alienRacesAllowHumanlikTextures, "alienRacesAllowHumanlikTextures"); + //BreastsPhysics + //Scribe_Values.Look(ref breastsPhysics, "breastsPhysics", false); + + base.ExposeData(); } @@ -283,7 +317,7 @@ namespace SizedApparel { if (pawn == null) continue; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp != null) comp.SetDirty(clearPawnGraphicSet); } @@ -311,7 +345,7 @@ namespace SizedApparel 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)); + leftRect = new Rect(leftRect.x, leftRect.x, leftRect.width - 30f, leftRect.height + Math.Max((float)alienDefList.Count * alienRaceSettingHeight, 1f) + 250f); listingStandard.Begin(leftRect); listingStandard.maxOneColumn = true; @@ -330,13 +364,21 @@ namespace SizedApparel { ClearCache(); } + if (listingStandard.ButtonTextLabeled("RandomPreCache", "15 sec ~ 2 min")) + { + SizedApparelsDatabase.RandomPreCacheForApparels(); + SizedApparelsDatabase.RandomPreCacheForBodyParts(); + } } - listingStandard.Gap(); - - listingStandard.Gap(8); - listingStandard.GapLine(5f); + listingStandard.Gap(); + listingStandard.GapLine(); + + + + + /* listingStandard.Label("Optimization",-1,""); //listingStandard.CheckboxLabeled("Debug Log", ref SizedApparelSettings.Debug, "Debug logs.\nDefault: false"); @@ -358,10 +400,8 @@ namespace SizedApparel //} listingStandard.Gap(8); listingStandard.Label("Other Mod Compatibility"); - listingStandard.Gap(8); - listingStandard.GapLine(5f); - listingStandard.CheckboxLabeled(" Forced compatibility of unsupported apparel", ref SizedApparelSettings.ForcedSupportApparel, "It may have clipping issue.\nDefault: false"); + listingStandard.CheckboxLabeled(" Force ignore unsupported apparel", ref SizedApparelSettings.ForcedSupportApparel, "It may have clipping issue from unsupported parts.\nDefault: false"); /* @@ -402,7 +442,7 @@ namespace SizedApparel { listingStandard.Label(" RimJobWorld is Actived ", -1, ""); } - + listingStandard.GapLine(1); listingStandard.Gap(12); listingStandard.Label("AlienRace Compatibility (wip)", -1, ""); @@ -443,26 +483,6 @@ namespace SizedApparel listingStandard.Label(" AlienRace is not Actived ", -1, ""); } - //Rect outRect = new Rect(0f, 35f, rect.width, rect.height - 35f); - /* - const float alienSettingHeight = 80; - Rect outRect = listingStandard.GetRect(listingStandard.CurHeight); - outRect = new Rect(outRect.x, outRect.y, outRect.width, alienSettingHeight); - Rect viewRect = new Rect(0, 0, outRect.width - 16f, 100 );//alienDefList.Count * 30f - Widgets.BeginScrollView(outRect, ref ScrollPos, viewRect, true); - Widgets.Label(new Rect(0f, 0f, 30f, 10f), "hello"); - Widgets.Label(new Rect(0f, 0f, 30f, 10f), "world"); - */ - //Log.Message(alienDefList.Count.ToString()); - //float h = alienDefList.Count <= 1 ? alienRaceSettingHeight : alienRaceSettingHeight * 1.8f; - - - //Rect rect = Race_ListingStandard.GetRect(h); - //rect.x = 0; - //rect.y = 0; - //Rect ScrollViewRect = new Rect(0, 0, rect.width - 16f, alienDefList.Count * alienRaceSettingHeight); - //Widgets.BeginScrollView(rect, ref ScrollPos, ScrollViewRect, true); - float h = alienDefList.Count * alienRaceSettingHeight; Listing_Standard Race_ListingStandard = listingStandard.BeginSection(h); foreach (var raceName in alienDefList) @@ -488,17 +508,17 @@ namespace SizedApparel } Race_ListingStandard.CheckboxLabeled("If Unsupported, Use Humanlike", ref raceSetting.asHumanlike, "This Race will use Humanlike 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 = Race_ListingStandard.Slider(raceSetting.drawMinAge, raceSetting.drawMinAge <= 100 ? -1: 100, raceSetting.drawMinAge >= 100 ? 1000 : 100); + raceSetting.drawMinAge = Mathf.Round(Race_ListingStandard.Slider(raceSetting.drawMinAge, raceSetting.drawMinAge <= 100 ? -1: 100, raceSetting.drawMinAge >= 100 ? 1000 : 100)); Race_ListingStandard.Gap(); } listingStandard.EndSection(Race_ListingStandard); Widgets.EndScrollView(); //listingStandard.Gap(alienSettingHeight); - + listingStandard.Gap(8); listingStandard.GapLine(4f); - listingStandard.Gap(16); + listingStandard.Gap(8); listingStandard.Label("RimNudeWorld Compatibility (WIP)", -1, ""); //listingStandard.CheckboxLabeled(" Don't Replace Body Texture On Nude", ref SizedApparelSettings.DontReplaceBodyTextureOnNude, "Only Replace BodyTexture On Not Nude. Trigers are Torso And Chests.\nDefault: False"); @@ -547,18 +567,51 @@ namespace SizedApparel SizedApparelSettings.drawBelly = true; } } + listingStandard.Gap(8); + listingStandard.GapLine(5f); + if (SizedApparelPatch.RimworldAnimationActive) + { + listingStandard.Label("RimworldAnimation (rjwAnimation) is Actived ", -1, ""); + listingStandard.CheckboxLabeled(" Animated SizedApparel BodyParts (wip)", ref SizedApparelSettings.AnimationPatch, "this option may animated breasts jiggle during animation.\n but not copatable with rimnudeworld.\ndefault: true"); + } + else + { + listingStandard.Label("RimworldAnimation (rjwAnimation) is not Actived ", -1, ""); + } + listingStandard.End(); listingStandard.Begin(rightRect); + + listingStandard.Label("SizedApparel System Apply (apparel and body parts)"); + listingStandard.CheckboxLabeled(" Apply Humanlikes", ref SizedApparelSettings.ApplyHumanlikes, "Try to Apply SizedApparel to Humanlikes if The textures are valid.\nDefault: true"); + listingStandard.CheckboxLabeled(" Apply Animals", ref SizedApparelSettings.ApplyAnimals, "Try to Apply SizedApparel to Animals if The textures are valid.\nDefault: false"); + //TODO + /* + if (SizedApparelSettings.ApplyAnimals) + listingStandard.CheckboxLabeled(" Apply Player Faction Animals Only", ref SizedApparelSettings.ApplyAnimalsPlayerFactionOnly, "Default: true"); + */ + listingStandard.CheckboxLabeled(" Apply Mechanoid", ref SizedApparelSettings.ApplyMechanoid, "Try to Apply SizedApparel to Mech if The textures are valid.\nDefault: true"); + listingStandard.GapLine(5f); + + listingStandard.Label("Apparel Patch (Breasts Sized Apparel)"); + listingStandard.CheckboxLabeled(" Apply Apparel Patch for Male", ref SizedApparelSettings.ApplyApparelPatchForMale, "It Skips breasts size test for male. Do you need man with breasts...? may be not.\nDefault: false"); + listingStandard.GapLine(5f); + listingStandard.Label("If you changed the option, try change apparels or reload save", -1); listingStandard.Label("Body Part Render Option (wip)",-1,"standalone BodyPart Render System from this mod. It's for user who don't use RimNudeWorld\nIf you use RimNudeWorld, you should turn off this."); + + listingStandard.CheckboxLabeled("Use Gender Specific Textures.", ref SizedApparelSettings.useGenderSpecificTexture,"Use Gender Specific texture for body and apparel if it's valid. \nDefault: true"); + listingStandard.GapLine(1); listingStandard.CheckboxLabeled("Draw Body Parts", ref SizedApparelSettings.drawBodyParts, "Draw Breasts..etc. when the pawn is wearing supported apparels. \nDefault: true"); if (SizedApparelSettings.drawBodyParts) { listingStandard.CheckboxLabeled(" Use (Sized Apparel) Body Texture", ref SizedApparelSettings.useBodyTexture, "change pawn's body texture when the pawn is wearing supported apparels. Recommanded\nDefault: true"); + + listingStandard.CheckboxLabeled(" Draw Muscle Overlay (wip)", ref SizedApparelSettings.drawMuscleOverlay, "\nDisable this option when you use RimNudeWorld"); listingStandard.CheckboxLabeled(" Draw Breasts", ref SizedApparelSettings.drawBreasts, "this option is why this mod exist.\nDefault: true"); @@ -566,6 +619,7 @@ namespace SizedApparel { listingStandard.CheckboxLabeled(" Match Breasts size to supported apparels",ref SizedApparelSettings.matchBreastToSupportedApparelSize, "to avoid breasts clipping(when breasts are bigger), you need this option.\nDefault: true"); listingStandard.CheckboxLabeled(" draw Breasts on worn pawn only (RimNudeWorld)", ref SizedApparelSettings.drawSizedApparelBreastsOnlyWorn, "when the pawn is nude, the breasts graphic for sized apparel will be hidden. \nDefault: false" ); + //listingStandard.CheckboxLabeled(" (Wip) Breasts Physics", ref SizedApparelSettings.breastsPhysics, "Breasts can be jiggled from animations. It may be heavy for performance. \ndefault = false"); } listingStandard.CheckboxLabeled(" Draw Penis", ref SizedApparelSettings.drawPenis,"Disable this option when you use RimNudeWorld"); listingStandard.CheckboxLabeled(" Draw Vagina", ref SizedApparelSettings.drawVagina, "Disable this option when you use RimNudeWorld"); diff --git a/source/SizedApparel/SizedApparelUtility.cs b/source/SizedApparel/SizedApparelUtility.cs index 37c1a94..d5375bc 100644 --- a/source/SizedApparel/SizedApparelUtility.cs +++ b/source/SizedApparel/SizedApparelUtility.cs @@ -128,16 +128,16 @@ namespace SizedApparel return result; } - public static Graphic GetSizedApparelGraphic(Graphic sourceGraphic, float breastSeverity, string wearerDefName = null, string breastHediff = null, string customPose = null) + public static Graphic GetSizedApparelGraphic(Graphic sourceGraphic, float breastSeverity, string wearerDefName = null, string breastHediff = null, string customPose = null, Gender gender = Gender.None) { int currentBreastSizeIndex = -1; float currentBreastSeverity = -1; string s; bool flag = false; - return GetSizedApparelGraphic(sourceGraphic, breastSeverity, out currentBreastSizeIndex, out currentBreastSeverity, out flag, out s, wearerDefName, breastHediff); + return GetSizedApparelGraphic(sourceGraphic, breastSeverity, out currentBreastSizeIndex, out currentBreastSeverity, out flag, out s, wearerDefName, breastHediff, customPose, gender); } - public static Graphic GetSizedApparelGraphic(Graphic sourceGraphic, float breastSeverity , out int indexOut, out float severityOut, out bool result, out string hediffResult, string wearerDefName = null, string breastHediffName = null, string customPose = null) + public static Graphic GetSizedApparelGraphic(Graphic sourceGraphic, float breastSeverity , out int indexOut, out float severityOut, out bool result, out string hediffResult, string wearerDefName = null, string breastHediffName = null, string customPose = null, Gender gender = Gender.None) { indexOut = -1; severityOut = -1; @@ -155,7 +155,9 @@ namespace SizedApparel string raceExtraPath = null; string racePath = null; - + + + //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; path = sourceGraphic.path; @@ -164,8 +166,21 @@ namespace SizedApparel path = path.Insert(Math.Max(path.LastIndexOf('/'), 0), "/CustomPose/"+ customPose); } + string genderSting; + if (gender == Gender.Female) + { + genderSting = "F"; + } + if (gender == Gender.Male) + { + genderSting = "M"; + } + else + genderSting = string.Empty; - if(wearerDefName != null) + path = path + genderSting; + + if (wearerDefName != null) racePath = path + "_" + wearerDefName; if (breastHediffName != null) { @@ -178,6 +193,7 @@ namespace SizedApparel + int offset = 0; @@ -195,7 +211,7 @@ namespace SizedApparel pathString = raceExtraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); validTexture = true; @@ -210,7 +226,7 @@ namespace SizedApparel pathString = extraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); validTexture = true; @@ -221,7 +237,7 @@ namespace SizedApparel } } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); if(racePath != null) @@ -229,7 +245,7 @@ namespace SizedApparel pathString = racePath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); validTexture = true; @@ -244,7 +260,7 @@ namespace SizedApparel pathString = path + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut); if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); @@ -254,7 +270,7 @@ namespace SizedApparel //Log.Message(path + BreastSeverityString(breastSeverity, offset, findBigger) + ":Texture Found"); break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); //Log.Warning(path + BreastSeverityString(breastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture."); @@ -274,7 +290,7 @@ namespace SizedApparel pathString = raceExtraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); @@ -290,7 +306,7 @@ namespace SizedApparel pathString = extraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); @@ -300,7 +316,7 @@ namespace SizedApparel //Log.Message(extraPath + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Extra Texture Found"); break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); //Log.Warning(extraPath + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); @@ -311,7 +327,7 @@ namespace SizedApparel pathString = racePath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); @@ -326,7 +342,7 @@ namespace SizedApparel pathString = path + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut); if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is found"); graphic = GraphicDatabase.Get(pathString, sourceGraphic.Shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data); //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel)); @@ -336,7 +352,7 @@ namespace SizedApparel //Log.Message(path + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Texture Found"); break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing"); //Log.Warning(path + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture."); @@ -403,9 +419,10 @@ namespace SizedApparel return false; } - public static bool isRJWParts(string defname) + public static bool isRJWParts(Hediff h) { - return (isBreast(defname)|| isPenis(defname)|| isVagina(defname)|| isAnus(defname)); + return (isBreast(h.def.defName) || Genital_Helper.is_penis(h) || Genital_Helper.is_vagina(h) || isAnus(h.def.defName)); + //return (isBreast(defname)|| isPenis(defname)|| isVagina(defname)|| isAnus(defname)); } public static bool isBreast(string defname) { @@ -422,7 +439,7 @@ namespace SizedApparel return false; } - //To Race Support, you should Patch this! + [Obsolete] public static bool isPenis(string defname) { string lower = defname.ToLower(); @@ -430,6 +447,7 @@ namespace SizedApparel return true; return false; } + [Obsolete] public static bool isVagina(string defname) { string lower = defname.ToLower(); @@ -448,7 +466,7 @@ namespace SizedApparel //find valid breasts texture to choose apparel. public static float GetBreastSeverityValidTextures(Pawn pawn, Hediff hediff, string customDefName = null) { - ApparelRecorderComp comp = pawn.TryGetComp(); + ApparelRecorderComp comp = pawn.GetComp(); if (comp == null) return -1; @@ -508,7 +526,7 @@ namespace SizedApparel pathString = extraPath + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, findBigger, ref currentSizeIndex, ref currentSeverity); if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); @@ -517,19 +535,19 @@ namespace SizedApparel } } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); pathString = path + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, findBigger, ref currentSizeIndex, ref currentSeverity); if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); validTexture = true; break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); offset++; @@ -546,13 +564,13 @@ namespace SizedApparel pathString = extraPath + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); validTexture = true; break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); } @@ -560,13 +578,13 @@ namespace SizedApparel pathString = path + SizedApparelUtility.BreastSeverityString(targetBreastSeverity, offset, !findBigger, ref currentSizeIndex, ref currentSeverity); if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is found"); validTexture = true; break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")Breasts texture is missing"); offset++; @@ -589,13 +607,15 @@ namespace SizedApparel } //It's heavy search. Do Not Call this function rapidly - public static Graphic GetBodyPartGraphic(string raceDefName, string bodyTypeName, string hediffDefName, bool isBreast, int sizeIndex, string folderName, string defaultHediffName, out int indexOut, out string hediffResult, bool hornyGraphic = false, string customRaceDefName = null, string variation = null) + public static Graphic GetBodyPartGraphic(string raceDefName, string bodyTypeName, string hediffDefName, bool isBreast, int sizeIndex, string folderName, string defaultHediffName, out int indexOut, out string hediffResult, bool hornyGraphic = false, string customRaceDefName = null, string variation = null, Gender gender = Gender.None) { Graphic graphic = null; //for return //rec = new ApparelGraphicRecord(null, null); string defName = raceDefName; + if (customRaceDefName != null) defName = customRaceDefName; + string bodyType = bodyTypeName; string bodyPartsFolderPath = "SizedApparel/BodyParts/"; string graphicFolderPath; @@ -628,8 +648,21 @@ namespace SizedApparel //SizedApparelUtility.GetBreastSeverity(apparel.Wearer, out BreastSeverity, out breastHediff); - string path = graphicFolderPath + fileName; - string extraPath = graphicFolderPath + extraFileName; + string genderString; + if(gender == Gender.Female) + { + genderString = "F"; + } + if (gender == Gender.Male) + { + genderString = "M"; + } + else + genderString = string.Empty; + + + string path = graphicFolderPath + fileName + genderString; + string extraPath = graphicFolderPath + extraFileName + genderString; //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName; @@ -661,7 +694,7 @@ namespace SizedApparel pathStringWithVariatione = pathString + "_" + variation; if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); graphic = GraphicDatabase.Get(pathStringWithVariatione); @@ -669,7 +702,7 @@ namespace SizedApparel hediffResult = hediffDefName; break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); } @@ -677,7 +710,7 @@ namespace SizedApparel if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); @@ -694,7 +727,7 @@ namespace SizedApparel //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Not Found."); } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); if (isBreast) @@ -707,7 +740,7 @@ namespace SizedApparel pathStringWithVariatione = pathString + "_" + variation; if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); graphic = GraphicDatabase.Get(pathStringWithVariatione); @@ -715,13 +748,13 @@ namespace SizedApparel hediffResult = hediffDefName; break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); } if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); @@ -733,7 +766,7 @@ namespace SizedApparel //Log.Message(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Found"); break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture."); @@ -758,7 +791,7 @@ namespace SizedApparel pathStringWithVariatione = pathString + "_" + variation; if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); graphic = GraphicDatabase.Get(pathStringWithVariatione); @@ -766,13 +799,13 @@ namespace SizedApparel hediffResult = hediffDefName; break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); } if (ContentFinder.Get((pathString + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); @@ -785,7 +818,7 @@ namespace SizedApparel //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Found"); break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); @@ -800,7 +833,7 @@ namespace SizedApparel pathStringWithVariatione = pathString + "_" + variation; if (ContentFinder.Get((pathStringWithVariatione + "_south"), false) != null) // checking special texture like udder { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is found"); graphic = GraphicDatabase.Get(pathStringWithVariatione); @@ -808,13 +841,13 @@ namespace SizedApparel hediffResult = hediffDefName; break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathStringWithVariatione + ")BodyPart texture is missing"); } if ((ContentFinder.Get((pathString + "_south"), false) != null)) { - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is found"); //minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex); @@ -826,7 +859,7 @@ namespace SizedApparel //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found"); break; } - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] (" + pathString + ")BodyPart texture is missing"); //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture."); @@ -854,11 +887,17 @@ namespace SizedApparel } indexOut = currentSizeIndex; + + if(graphic == null & gender != Gender.None) + { + //try search genderless graphic + graphic = GetBodyPartGraphic(raceDefName, bodyTypeName, hediffDefName, isBreast, sizeIndex, folderName, defaultHediffName, out indexOut, out hediffResult, hornyGraphic, customRaceDefName, variation, Gender.None); + } - if(graphic == null & hornyGraphic == true) + if (graphic == null & hornyGraphic == true) { //try search normal Graphic instead of HornyGraphic - graphic = GetBodyPartGraphic(raceDefName, bodyTypeName, hediffDefName, isBreast, sizeIndex, folderName, defaultHediffName, out indexOut, out hediffResult, false, customRaceDefName, variation); + graphic = GetBodyPartGraphic(raceDefName, bodyTypeName, hediffDefName, isBreast, sizeIndex, folderName, defaultHediffName, out indexOut, out hediffResult, false, customRaceDefName, variation, gender); } return graphic; @@ -885,14 +924,14 @@ namespace SizedApparel Graphic nakedGraphic = pawn.Drawer?.renderer?.graphics?.nakedGraphic; if (nakedGraphic == null) return null; - var rotComp = pawn.TryGetComp(); + var rotComp = pawn.GetComp(); if (rotComp!=null) { if (rotComp.Stage == RotStage.Rotting) nakedGraphic = pawn.Drawer.renderer.graphics.rottingGraphic; } - ApparelRecorderComp comp = pawn.TryGetComp(); + ApparelRecorderComp comp = pawn.GetComp(); string defName = pawn.def.defName; if (customRaceDefName != null) defName = customRaceDefName; @@ -995,7 +1034,7 @@ namespace SizedApparel public static bool IsHorny(Pawn pawn) { - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if(comp != null) { if (comp.forceHorny == true) @@ -1293,108 +1332,6 @@ namespace SizedApparel public static string BreastSeverityString(float BreastSeverity, int offset, bool findBigger, ref int outTargetIndex, ref float outTargetSeverity) { - - { - /* old method - if (offset == 0) - { - if (BreastSeverity <= 0.1f) - return micro; //micro, flat - if (BreastSeverity <= 0.05f) - return small; // small , tight - if (BreastSeverity <= 0.25f) - return average; // average - if (BreastSeverity <= 0.70f) - return large; // large , loose - if (BreastSeverity <= 0.90f) - return huge; // huge , gaping - if (BreastSeverity <= 1.01f) - return oversized; // oversized - return String.Empty; // none - } - if (offset == 1) - { - if (BreastSeverity <= 0.1f) - return micro; //micro, flat - if (BreastSeverity <= 0.05f) - return small; // small , tight - if (BreastSeverity <= 0.25f) - return average; // average - if (BreastSeverity <= 0.70f) - return large; // large , loose - if (BreastSeverity <= 0.90f) - return huge; // huge , gaping - if (BreastSeverity <= 1.01f) - return oversized; // oversized - return String.Empty; // none - } - if (offset == 2) - { - if (BreastSeverity <= 0.1f) - return micro; //micro, flat - if (BreastSeverity <= 0.05f) - return small; // small , tight - if (BreastSeverity <= 0.25f) - return average; // average - if (BreastSeverity <= 0.70f) - return large; // large , loose - if (BreastSeverity <= 0.90f) - return huge; // huge , gaping - if (BreastSeverity <= 1.01f) - return oversized; // oversized - return String.Empty; // none - } - if (offset == 3) - { - if (BreastSeverity <= 0.1f) - return micro; //micro, flat - if (BreastSeverity <= 0.05f) - return small; // small , tight - if (BreastSeverity <= 0.25f) - return average; // average - if (BreastSeverity <= 0.70f) - return large; // large , loose - if (BreastSeverity <= 0.90f) - return huge; // huge , gaping - if (BreastSeverity <= 1.01f) - return oversized; // oversized - return String.Empty; // none - } - if (offset == 4) - { - if (BreastSeverity <= 0.1f) - return micro; //micro, flat - if (BreastSeverity <= 0.05f) - return small; // small , tight - if (BreastSeverity <= 0.25f) - return average; // average - if (BreastSeverity <= 0.70f) - return large; // large , loose - if (BreastSeverity <= 0.90f) - return huge; // huge , gaping - if (BreastSeverity <= 1.01f) - return oversized; // oversized - return String.Empty; // none - } - if (offset == 5) - { - if (BreastSeverity <= 0.1f) - return micro; //micro, flat - if (BreastSeverity <= 0.05f) - return small; // small , tight - if (BreastSeverity <= 0.25f) - return average; // average - if (BreastSeverity <= 0.70f) - return large; // large , loose - if (BreastSeverity <= 0.90f) - return huge; // huge , gaping - if (BreastSeverity <= 1.01f) - return oversized; // oversized - return String.Empty; // none - } - return String.Empty; // none } - */ - }//Old Method int targetIndex = -1; float targetSeverity = 0; int result = -1; @@ -1552,7 +1489,7 @@ namespace SizedApparel { /* - ApparelRecorderComp apparelRecorder = pawn.TryGetComp(); + ApparelRecorderComp apparelRecorder = pawn.GetComp(); if(apparelRecorder == null) { Log.Message("No ApparelRecorder Found"); @@ -1608,7 +1545,7 @@ namespace SizedApparel if (breastHediff != null) { searchingPath = extraPath + BreastSeverityString(BreastSeverity, offset, findBigger,ref currentIndex,ref currentSeverity) + "_south"; - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); if (ContentFinder.Get((searchingPath), false) != null) // checking special texture like udder @@ -1620,7 +1557,7 @@ namespace SizedApparel //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Not Found."); } searchingPath = path + BreastSeverityString(BreastSeverity, offset, findBigger, ref currentIndex,ref currentSeverity) + "_south"; - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); if ((ContentFinder.Get((searchingPath), false) != null)) { @@ -1647,7 +1584,7 @@ namespace SizedApparel if (breastHediff != null) { searchingPath = extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentIndex,ref currentSeverity) + "_south"; - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); if (ContentFinder.Get((searchingPath), false) != null) // checking special texture like udder { @@ -1658,7 +1595,7 @@ namespace SizedApparel //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Not Found."); } searchingPath = path + BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentIndex, ref currentSeverity) + "_south"; - if (SizedApparelSettings.Debug) + if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog) Log.Message("[Sized Apparel] " + pawn.Name + ": ApparelSearching: " + searchingPath); if ((ContentFinder.Get((searchingPath), false) != null)) { @@ -1698,7 +1635,7 @@ namespace SizedApparel if (SizedApparelSettings.Debug) Log.Message("[Sized Apparel] " + pawn.Name + ": hasUnSupportedApparel Testing..."); /* - ApparelRecorderComp apparelRecorder = pawn.TryGetComp(); + ApparelRecorderComp apparelRecorder = pawn.GetComp(); if(apparelRecorder == null) { Log.Message("No ApparelRecorder Found"); @@ -1712,9 +1649,15 @@ namespace SizedApparel */ //Log.Message("Check hasUnSupportedApparel"); bool hasUnsupportedApparel = false; - var comp = pawn.TryGetComp(); - if (!pawn.RaceProps.Humanlike) + + /* + if (!pawn.RaceProps.Humanlike) //Animals or Mechanoids would have apparels? return true; + */ + + var comp = pawn.GetComp(); + if (comp == null) + return false; List apparels = new List(); if (!fromGraphicRecord) { @@ -1797,7 +1740,10 @@ namespace SizedApparel extraPath = path; string resultPath = null; bool resultOut = false; - var result = SizedApparelsDatabase.GetSupportedApparelSizedPath(new SizedApparelsDatabase.SizedApparelDatabaseKey(path, pawn.def.defName, pawn.story?.bodyType?.defName, breastHediff?.def.defName, SizedApparelUtility.BreastSeverityInt(BreastSeverity)),out currentIndex, out currentSeverity).pathWithSizeIndex; + var key = new SizedApparelsDatabase.SizedApparelDatabaseKey(path, pawn.def.defName, pawn.story?.bodyType?.defName, pawn.gender, breastHediff?.def.defName, SizedApparelUtility.BreastSeverityInt(BreastSeverity)); + if (SizedApparelSettings.useGenderSpecificTexture) + key.gender = Gender.None; + var result = SizedApparelsDatabase.GetSupportedApparelSizedPath(key,out currentIndex, out currentSeverity).pathWithSizeIndex; if (comp != null) { if (cacheToComp) @@ -1959,9 +1905,10 @@ namespace SizedApparel public static void UpdateAllApparel(Pawn pawn, bool onlyGraphicRecords = false)//need to be update before call it { + if (pawn == null) return; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return; PawnGraphicSet pawnGraphicSet = pawn.Drawer?.renderer?.graphics; @@ -2009,7 +1956,7 @@ namespace SizedApparel { if (pawn == null) return false; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return false; if (!flags.FlagSet(PawnRenderFlags.Clothes)) @@ -2023,7 +1970,7 @@ namespace SizedApparel { if (pawn == null) return false; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return false; if (!flags.FlagSet(PawnRenderFlags.Clothes)) @@ -2078,7 +2025,7 @@ namespace SizedApparel { if (pawn == null) return false; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return false; @@ -2091,7 +2038,7 @@ namespace SizedApparel { if (pawn == null) return false; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return false; if (!flags.FlagSet(PawnRenderFlags.Clothes)) @@ -2113,7 +2060,7 @@ namespace SizedApparel { if (pawn == null) return false; - var comp = pawn.TryGetComp(); + var comp = pawn.GetComp(); if (comp == null) return false; @@ -2159,6 +2106,48 @@ namespace SizedApparel } + + public static bool CanApplySizedApparel(Pawn pawn) + { + if (pawn == null) + return false; + + //RaceProps Check + if (!pawn.RaceProps.Humanlike) //apply humanlikes always + { + if (pawn.RaceProps.Animal) + { + if (!SizedApparelSettings.ApplyAnimals) + return false; + } + else if (pawn.RaceProps.IsMechanoid) + { + if (!SizedApparelSettings.ApplyMechanoid) + return false; + } + } + else + { + if (!SizedApparelSettings.ApplyHumanlikes) + return false; + } + //Faction Check TODO + if (pawn.Faction != null && pawn.Faction != Faction.OfPlayer) + { + switch (pawn.Faction.PlayerRelationKind) + { + case FactionRelationKind.Neutral: + break; + case FactionRelationKind.Ally: + break; + case FactionRelationKind.Hostile: + break; + default: + break; + } + } + return true; + } } diff --git a/source/SizedApparel/SizedApparelforRJW.csproj b/source/SizedApparel/SizedApparelforRJW.csproj index 50ddab0..4187908 100644 --- a/source/SizedApparel/SizedApparelforRJW.csproj +++ b/source/SizedApparel/SizedApparelforRJW.csproj @@ -9,7 +9,7 @@ Properties SizedApparel SizedApparelforRJW - v4.7.2 + v4.8 512 true @@ -28,7 +28,7 @@ none true - ..\..\1.3\Assemblies\ + ..\..\1.4\Assemblies\ TRACE prompt 4 @@ -49,11 +49,15 @@ False - ..\..\..\rimnude-unofficial\1.3 Assembly\Assemblies\RimNudeWorld.dll + ..\..\..\rimnude-unofficial\Assembly Folders\1.4 Assembly\Assemblies\RimNudeWorld.dll + False + + + ..\..\..\rimworld-animations\1.4\Assemblies\Rimworld-Animations.dll False - ..\..\..\RJW\1.3\Assemblies\RJW.dll + ..\..\..\rjw\1.4\Assemblies\RJW.dll False @@ -74,6 +78,10 @@ ..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll False + + ..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll + False + @@ -86,6 +94,7 @@ + diff --git a/source/SizedApparel/SizedApparelsDatabase.cs b/source/SizedApparel/SizedApparelsDatabase.cs index e59c72f..631a5e0 100644 --- a/source/SizedApparel/SizedApparelsDatabase.cs +++ b/source/SizedApparel/SizedApparelsDatabase.cs @@ -26,6 +26,7 @@ namespace SizedApparel public string pathWithoutSizeIndex; // Do Not Include Size Data to path! bodytype could be included public string raceName; public string bodyTypeName; + public Gender gender; public string hediffName; public int targetSize; public bool isHorny; @@ -33,11 +34,12 @@ namespace SizedApparel public string variation; - public SizedApparelDatabaseKey(string path, string race, string bodyType = null, string hediff = null, int size = -1, bool horny = false, string customPose = null, string variation = null) + public SizedApparelDatabaseKey(string path, string race, string bodyType = null, Gender genderInput = Gender.None , string hediff = null, int size = -1, bool horny = false, string customPose = null, string variation = null) { this.pathWithoutSizeIndex = path; this.raceName = race; this.bodyTypeName = bodyType; + this.gender = genderInput; this.hediffName = hediff; this.targetSize = size; this.isHorny = horny; @@ -51,7 +53,7 @@ namespace SizedApparel { if (x.targetSize != y.targetSize) return false; - return true && (x.pathWithoutSizeIndex == y.pathWithoutSizeIndex) && (x.bodyTypeName == y.bodyTypeName) && (x.raceName == y.raceName) && (x.hediffName == y.hediffName) && (x.isHorny == y.isHorny) && (x.customPose == y.customPose) && (x.variation == y.variation); + return true && (x.pathWithoutSizeIndex == y.pathWithoutSizeIndex) && (x.bodyTypeName == y.bodyTypeName) && (x.raceName == y.raceName)&& (x.gender == y.gender) && (x.hediffName == y.hediffName) && (x.isHorny == y.isHorny) && (x.customPose == y.customPose) && (x.variation == y.variation); } public int GetHashCode(SizedApparelDatabaseKey obj) @@ -65,17 +67,19 @@ namespace SizedApparel public string bodyTypeName; public string hediffName; public string folderPath; + public Gender gender; public int targetSize; public bool isHorny; public string customPose; // null custom pose as default pose public string variation; // null variation as default graphic - public BodyPartDatabaseKey(string race, string bodyType = null, string hediff = null, string path = null, int size = -1, bool horny = false, string customPose = null, string variation = null) + public BodyPartDatabaseKey(string race, string bodyType = null, string hediff = null, string path = null, Gender pawnGender = Gender.None, int size = -1, bool horny = false, string customPose = null, string variation = null) { this.raceName = race; this.bodyTypeName = bodyType; this.hediffName = hediff; this.folderPath = path; + this.gender = pawnGender; this.targetSize = size; this.isHorny = horny; this.customPose = customPose; @@ -88,7 +92,7 @@ namespace SizedApparel { if (x.targetSize != y.targetSize) return false; - return true && (x.raceName == y.raceName) && (x.bodyTypeName == y.bodyTypeName) && (x.hediffName == y.hediffName) && ( x.folderPath == y.folderPath) && (x.isHorny == y.isHorny) && (x.customPose == y.customPose) && (x.variation == y.variation); + return true && (x.raceName == y.raceName) && (x.bodyTypeName == y.bodyTypeName) && (x.hediffName == y.hediffName) && ( x.folderPath == y.folderPath)&& (x.gender == y.gender) && (x.isHorny == y.isHorny) && (x.customPose == y.customPose) && (x.variation == y.variation); } public int GetHashCode(BodyPartDatabaseKey obj) @@ -115,6 +119,7 @@ namespace SizedApparel this.points = pointsInput; } } + private static Dictionary ApparelRecordersCache = new Dictionary(); private static Dictionary SizedApparelBodyGraphic = new Dictionary(); // TODO private static Dictionary SupportedApparelResultPath = new Dictionary(new SizedApparelDatabaseKeyComparer()); @@ -124,6 +129,14 @@ namespace SizedApparel //AlienRace AllowHumanlike. Need to Restart or Clear cache to change options + public static ApparelRecorderComp GetApparelCompFast(Pawn pawn) + { + if (ApparelRecordersCache.ContainsKey(pawn)) + return ApparelRecordersCache[pawn]; + ApparelRecorderComp comp = pawn.GetComp(); // comp can be null + ApparelRecordersCache.Add(pawn, comp); + return comp; + } public static Dictionary AlienRaceUseHumanlike = new Dictionary(); private static void ResetAlienRaceUseHumanlike() @@ -205,6 +218,8 @@ namespace SizedApparel Log.Message("[Sized Apparel] SizedApparelDataBase::Result Path: " + value.pathWithSizeIndex); return value; } + + if (SizedApparelSettings.Debug) Log.Message(" [Sized Apparel] SizedApparelDataBase::Key Not Found: " + key.pathWithoutSizeIndex); @@ -228,11 +243,22 @@ namespace SizedApparel targetRaceName = key.raceName;*/ targetRaceName = key.raceName; Graphic graphic = null; - graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult, targetRaceName, key.hediffName, key.customPose);//key.customPose + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult, targetRaceName, key.hediffName, key.customPose, key.gender);//key.customPose + if(graphic == null && key.gender != Gender.None) + { + //try Genderless + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult, targetRaceName, key.hediffName, key.customPose, Gender.None);//key.customPose + } + if (key.customPose != null && graphic == null) { customPose = false; - graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult , targetRaceName); + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult , targetRaceName, key.hediffName , null ,key.gender); + if (graphic == null && key.gender != Gender.None) + { + //try Genderless + graphic = SizedApparelUtility.GetSizedApparelGraphic(sourceGraphic, SizedApparelUtility.BreastSizeIndexToSeverity(key.targetSize), out indexOut, out currentSeverityOut, out flag, out hediffResult, targetRaceName, key.hediffName, null, Gender.None);//key.customPose + } } //Try Find Different Target Size @@ -251,7 +277,7 @@ namespace SizedApparel return result; } - public static PathAndSize GetSupportedBodyPartPath(BodyPartDatabaseKey key, bool isBreast, string folderName, string defaultHediffName, string customRaceDefName = null) + public static PathAndSize GetSupportedBodyPartPath(BodyPartDatabaseKey key, bool isBreast, string folderName, string defaultHediffName) { PathAndSize result; if (SupportedBodyPartResultPath.ContainsKey(key)) @@ -261,7 +287,7 @@ namespace SizedApparel Graphic graphic = null; if (key.customPose != null) { - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName+"/CustomPose/"+key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, customRaceDefName, key.variation); + 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); @@ -269,7 +295,7 @@ namespace SizedApparel return result; } if (key.bodyTypeName != null) - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, customRaceDefName, key.variation); + 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); @@ -278,7 +304,7 @@ namespace SizedApparel } } - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, customRaceDefName, key.variation); + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, null, key.variation, key.gender); if (graphic != null) { result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult); @@ -287,7 +313,7 @@ namespace SizedApparel } if (key.bodyTypeName != null) - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, customRaceDefName, key.variation); + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, null, key.variation, key.gender); if (graphic != null) { result = new PathAndSize(graphic.path, currentSize, false, key.customPose == null ? true : false, hediffResult); @@ -309,7 +335,7 @@ namespace SizedApparel if (key.customPose != null) { - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation); + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); if (graphic != null) { result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult); @@ -317,7 +343,7 @@ namespace SizedApparel return result; } if (key.bodyTypeName != null) - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation); + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName + "/CustomPose/" + key.customPose, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); if (graphic != null) { result = new PathAndSize(graphic.path, currentSize, true, true, hediffResult); @@ -326,7 +352,7 @@ namespace SizedApparel } } - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation); + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, key.bodyTypeName, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); if (graphic != null) { result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult); @@ -335,7 +361,7 @@ namespace SizedApparel } if (key.bodyTypeName != null) - graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation); + graphic = SizedApparelUtility.GetBodyPartGraphic(key.raceName, null, key.hediffName, isBreast, key.targetSize, folderName, defaultHediffName, out currentSize, out hediffResult, key.isHorny, "Humanlike", key.variation, key.gender); if (graphic != null) { result = new PathAndSize(graphic.path, currentSize, true, key.customPose == null ? true : false, hediffResult); @@ -351,5 +377,95 @@ namespace SizedApparel return result; } + public static void RandomPreCacheForBodyParts() + { + //variationDef = DefDatabase.AllDefsListForReading; + BodyPartDatabaseKey key; + for (int i = 0; i<11; i++) + { + key = new BodyPartDatabaseKey("Human", "Female", "Breasts", "Breasts", Gender.Female, i); + GetSupportedBodyPartPath(key, true, "Breasts", "Breasts"); + key = new BodyPartDatabaseKey("Human", "Thin", "Breasts", "Breasts", Gender.Female, i); + GetSupportedBodyPartPath(key, true, "Breasts", "Breasts"); + } + + for (int i = 0; i < 6; i++) + { + key = new BodyPartDatabaseKey("Human", "Female", "Vagina", "Vagina", Gender.Female, i); + GetSupportedBodyPartPath(key, false, "Vagina", "Vagina"); + key = new BodyPartDatabaseKey("Human", "Thin", "Vagina", "Vagina", Gender.Female, i); + GetSupportedBodyPartPath(key, false, "Vagina", "Vagina"); + } + + for (int i = 0; i < 6; i++) + { + key = new BodyPartDatabaseKey("Human", "Female", "Anus", "Anus", Gender.Female, i); + GetSupportedBodyPartPath(key, false, "Anus", "Anus"); + key = new BodyPartDatabaseKey("Human", "Thin", "Anus", "Anus", Gender.Female, i); + GetSupportedBodyPartPath(key, false, "Anus", "Anus"); + key = new BodyPartDatabaseKey("Human", "Male", "Anus", "Anus", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Anus", "Anus"); + key = new BodyPartDatabaseKey("Human", "Thin", "Anus", "Anus", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Anus", "Anus"); + } + for (int i = 0; i < 6; i++) + { + key = new BodyPartDatabaseKey("Human", "Male", "Penis", "Penis", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + key = new BodyPartDatabaseKey("Human", "Male", "Penis", "Penis/Balls", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + + key = new BodyPartDatabaseKey("Human", "Thin", "Penis", "Penis", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + key = new BodyPartDatabaseKey("Human", "Thin", "Penis", "Penis/Balls", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + + key = new BodyPartDatabaseKey("Human", "Fat", "Penis", "Penis", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + key = new BodyPartDatabaseKey("Human", "Fat", "Penis", "Penis/Balls", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + + key = new BodyPartDatabaseKey("Human", "Hulk", "Penis", "Penis", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + key = new BodyPartDatabaseKey("Human", "Hulk", "Penis", "Penis/Balls", Gender.Male, i); + GetSupportedBodyPartPath(key, false, "Penis", "Penis"); + + } + + } + + + public static void RandomPreCacheForApparels() + { + //random precache should be useful. so it target female and thin body only. + //don't target male because the male doesn't need breasts textures usually. + + List bodyTypes = new List(); + bodyTypes.Add("Female"); + bodyTypes.Add("Thin"); + + + // DefDatabase.AllDefsListForReading + foreach (ThingDef thingDef in DefDatabase.AllDefsListForReading) + { + if (thingDef.IsApparel && !thingDef.apparel.wornGraphicPath.NullOrEmpty()) + { + + for(int i = 0; i<11; i++) + { + var key = new SizedApparelDatabaseKey(thingDef.apparel.wornGraphicPath, "Human", "Female", Gender.Female, "Breasts", i); + GetSupportedApparelSizedPath(key); + key = new SizedApparelDatabaseKey(thingDef.apparel.wornGraphicPath, "Human", "Thin", Gender.Female, "Breasts", i); + GetSupportedApparelSizedPath(key); + //need Humanlike Cache? + } + + } + } + + + } + + } }