Mirror of 1.4.22 from Lovers Lab

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

View file

@ -16,7 +16,7 @@ namespace SizedApparel
{
public string raceName = null;
public bool overrideDef = false;
public bool asHumanlike = true;
public bool asHuman = false;
public float drawMinAge = -1; //pawn's Biological age. -1 to ignore.
public AlienRaceSetting(string raceName)
@ -32,7 +32,7 @@ namespace SizedApparel
{
Scribe_Values.Look(ref raceName, "raceName", null);
Scribe_Values.Look(ref overrideDef, "overrideDef", false);
Scribe_Values.Look(ref asHumanlike, "asHumanlike", true);
Scribe_Values.Look(ref asHuman, "asHuman", false);
Scribe_Values.Look(ref drawMinAge, "drawMinAge", -1);
}
@ -43,10 +43,14 @@ namespace SizedApparel
public class SizedApparelSettings : ModSettings
{
public static bool Debug = false;
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;
@ -60,6 +64,23 @@ namespace SizedApparel
//Apply Target Pawn Category
public static bool ApplyHumanlikes = true; //Always true.
public static bool ApplyAnimals = true;
public static bool ApplyAnimalsPlayerFactionOnly = true; //TODO
public static bool ApplyMechanoid = true;
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;
@ -70,6 +91,7 @@ namespace SizedApparel
public static bool drawAnus = true;
public static bool drawBelly = false;//TODO
public static bool drawUdder = false;//TODO
public static bool drawPubicHair = true;
public static bool hideBallOfFuta = false;
public static bool hidePenisOfMale = false;
public static bool matchBreastToSupportedApparelSize = true;//for avoiding breasts cliping
@ -77,7 +99,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;
@ -171,6 +193,13 @@ 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", true);
Scribe_Values.Look(ref ApplyHumanlikes, "ApplyHumanlikes", true);
Scribe_Values.Look(ref ApplyMechanoid, "ApplyMechanoid", true);
Scribe_Values.Look(ref AnimationPatch, "AnimationPatch", true);
Scribe_Values.Look(ref useBodyTexture, "useBodyTexture", true);
Scribe_Values.Look(ref useGenderSpecificTexture, "useGenderSpecificTexture", true);
@ -189,6 +218,32 @@ namespace SizedApparel
{
alienRaceSettings = new List<AlienRaceSetting>();
}
SizedApparelMod.CheckAndLoadAlienRaces();
//Initialize Setting for missing Race
foreach (var raceName in SizedApparelMod.alienDefList)
{
AlienRaceSetting raceSetting = null;
foreach (var r in SizedApparelSettings.alienRaceSettings)
{
if (r.raceName == null)
continue;
if (raceName == r.raceName)
{
raceSetting = r;
break;
}
}
if (raceSetting == null)
{
raceSetting = new AlienRaceSetting(raceName);
SizedApparelSettings.alienRaceSettings.Add(raceSetting);
}
}
}
if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs)
{
@ -218,6 +273,7 @@ namespace SizedApparel
Scribe_Values.Look(ref drawAnus, "drawAnus", true);
Scribe_Values.Look(ref drawUdder, "drawUdder", true);
Scribe_Values.Look(ref drawBelly, "drawBelly", true);
Scribe_Values.Look(ref drawPubicHair, "drawPubicHair", true);
//force to draw all size type
@ -241,6 +297,10 @@ namespace SizedApparel
//TODO: Humanlike Setting Per Race
//Scribe_Values.Look(ref alienRacesAllowHumanlikTextures, "alienRacesAllowHumanlikTextures");
//BreastsPhysics
Scribe_Values.Look(ref breastsPhysics, "breastsPhysics", false);
base.ExposeData();
}
@ -250,8 +310,9 @@ namespace SizedApparel
{
SizedApparelSettings settings;
private static Vector2 ScrollPos = Vector2.zero;
private static List<string> alienDefList = new List<string>(); // to load aliens and compare with modsetting
private static Vector2 ScrollPosL = Vector2.zero;
private static Vector2 ScrollPosR = Vector2.zero;
public static List<string> alienDefList = new List<string>(); // to load aliens and compare with modsetting
public override void WriteSettings()
{
@ -264,7 +325,7 @@ namespace SizedApparel
{
if(alienDefList == null)
alienDefList = new List<string>();
if (alienDefList.Count == 0)
if (true)//alienDefList.Count == 0
{
IEnumerable<ThingDef> HumanlikeRaces;
HumanlikeRaces = DefDatabase<ThingDef>.AllDefs.Where(b => b.race?.Humanlike == true);
@ -280,19 +341,27 @@ namespace SizedApparel
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<ApparelRecorderComp>();
var comp = pawn.GetComp<ApparelRecorderComp>();
if (comp != null)
comp.SetDirty(clearPawnGraphicSet);
{
comp.UpdateRaceSettingData();
comp.SetDirty(clearPawnGraphicSet,true,true,true);
}
}
}
}
public SizedApparelMod(ModContentPack content) : base(content)
{
this.settings = GetSettings<SizedApparelSettings>();
@ -303,7 +372,7 @@ namespace SizedApparel
const float alienRaceSettingHeight = 120;
CheckAndLoadAlienRaces();
//CheckAndLoadAlienRaces();
Listing_Standard listingStandard = new Listing_Standard();
//Rect rect = new Rect(0f, 0f, inRect.width, 950);
//Rect rect = inRect.ExpandedBy(0.9f);
@ -313,8 +382,8 @@ namespace SizedApparel
//leftRect = leftRect.ContractedBy(10f);
rightRect = rightRect.ContractedBy(10f);
Rect scrollRect = new Rect(0, 0, leftRect.width - 30f, Math.Max(leftRect.height + (float)alienDefList.Count* alienRaceSettingHeight, 1f));
Widgets.BeginScrollView(leftRect, ref ScrollPos, scrollRect, true);
leftRect = new Rect(leftRect.x, leftRect.x, leftRect.width - 30f, leftRect.height + Math.Max((float)alienDefList.Count * alienRaceSettingHeight, 1f));
Widgets.BeginScrollView(leftRect, ref ScrollPosL, scrollRect, true);
leftRect = new Rect(leftRect.x, leftRect.y, leftRect.width - 30f, leftRect.height + Math.Max((float)alienDefList.Count * alienRaceSettingHeight, 1f) + 250f);
listingStandard.Begin(leftRect);
listingStandard.maxOneColumn = true;
@ -333,13 +402,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");
@ -361,10 +438,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");
/*
@ -403,9 +478,21 @@ namespace SizedApparel
}
else
{
//RimJobWorld is Actived
listingStandard.Label(" RimJobWorld is Actived ", -1, "");
if (SizedApparelPatch.MenstruationActive)
{
listingStandard.Label(" RJW Menstuation is Active ", -1, "");
}
else
{
listingStandard.Label(" RJW Menstuation is Not Active", -1, "");
}
}
listingStandard.GapLine(1);
listingStandard.Gap(12);
listingStandard.Label("AlienRace Compatibility (wip)", -1, "");
@ -446,26 +533,9 @@ 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);
if (alienDefList.NullOrEmpty())
CheckAndLoadAlienRaces();
float h = alienDefList.Count * alienRaceSettingHeight;
Listing_Standard Race_ListingStandard = listingStandard.BeginSection(h);
foreach (var raceName in alienDefList)
@ -488,20 +558,22 @@ namespace SizedApparel
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");
}
if(raceName != "Human")
Race_ListingStandard.CheckboxLabeled("If Unsupported, As Human race", ref raceSetting.asHuman, "This Race will use Human race if it doesn't have own textures. useful for race that Unsupported but simillar to human");
Race_ListingStandard.Label((raceSetting.drawMinAge <= 100 ? "" : "[overdrive]") + "SA BodyPart Draw Min Age: " + raceSetting.drawMinAge.ToString(), -1, "Lower than this age will not use Sized Apparel. Useful for BnC. -1 for disable");
raceSetting.drawMinAge = 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.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");
@ -520,6 +592,7 @@ namespace SizedApparel
SizedApparelSettings.drawVagina = false;
SizedApparelSettings.drawAnus = false;
SizedApparelSettings.drawBelly = false;
SizedApparelSettings.drawPubicHair = false;
}
@ -548,40 +621,79 @@ namespace SizedApparel
SizedApparelSettings.drawVagina = true;
SizedApparelSettings.drawAnus = true;
SizedApparelSettings.drawBelly = true;
SizedApparelSettings.drawPubicHair = 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();
////RightRect
scrollRect = new Rect(0, 0, rightRect.width - 30f, Math.Max(rightRect.height + 100f, 1f));
Widgets.BeginScrollView(rightRect, ref ScrollPosR, scrollRect, true);
rightRect = new Rect(0, 0, rightRect.width - 30f, rightRect.height + 100f + 250f);
listingStandard.maxOneColumn = true;
listingStandard.Begin(rightRect);
listingStandard.Label("SizedApparel System Apply (apparel and body parts)");
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.GapLine(5);
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(" Use (Sized Apparel) Base 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 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");
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(" 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 (for now. it works when nude only). It may be heavy for performance. \n Won't work with RimNudeWorld Breasts Rendering. \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(" 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.CheckboxLabeled(" Draw Pubic Hair", ref SizedApparelSettings.drawPubicHair, "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");
@ -614,6 +726,7 @@ namespace SizedApparel
listingStandard.CheckboxLabeled(" use Colossal", ref SizedApparelSettings.useColossal, "use Colossal breasts Sized Apparel.\nDefault: true");
listingStandard.CheckboxLabeled(" use Titanic", ref SizedApparelSettings.useTitanic, "use Titanic breasts Sized Apparel.\nDefault: true");
*/
Widgets.EndScrollView();
listingStandard.End();
//listingStandard.EndScrollView(ref rect);