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