mirror of
https://gitgud.io/ll.mirrors/sizedapparel.git
synced 2024-08-15 00:43:40 +00:00
Mirror of 1.4.23 from Lovers Lab
This commit is contained in:
parent
b501ddfb0f
commit
e47a1fc4f0
730 changed files with 646 additions and 182 deletions
|
@ -143,7 +143,7 @@ namespace SizedApparel
|
|||
|
||||
public enum SizedApparelBodyPartOf
|
||||
{
|
||||
All, Torso, Breasts, Crotch, Penis, Balls, Vagina, Anus, Belly, PubicHair, Udder, Hips, Thighs, hands, feet, None
|
||||
All, Torso, Breasts, Nipples, Crotch, Penis, Balls, Vagina, Anus, Belly, PubicHair, Udder, Hips, Thighs, hands, feet, None
|
||||
}
|
||||
public static class SizedApparelBodyPartOfExtension
|
||||
{
|
||||
|
@ -161,7 +161,11 @@ namespace SizedApparel
|
|||
return false;
|
||||
return true;
|
||||
case SizedApparelBodyPartOf.Breasts:
|
||||
if (source == SizedApparelBodyPartOf.Breasts)
|
||||
if (source == SizedApparelBodyPartOf.Breasts || source == SizedApparelBodyPartOf.Nipples)
|
||||
return true;
|
||||
return false;
|
||||
case SizedApparelBodyPartOf.Nipples:
|
||||
if (source == SizedApparelBodyPartOf.Nipples)
|
||||
return true;
|
||||
return false;
|
||||
case SizedApparelBodyPartOf.Crotch:
|
||||
|
@ -396,7 +400,6 @@ namespace SizedApparel
|
|||
public Color? variationColor;
|
||||
public colorOverrideMode variationColorMode = colorOverrideMode.Default;
|
||||
|
||||
|
||||
//TODO. age setting?
|
||||
public int minDrawAge = -1;
|
||||
public int maxDrawAge = -1;
|
||||
|
@ -505,10 +508,10 @@ namespace SizedApparel
|
|||
positionOffsetEast = east;
|
||||
positionOffsetWest = west;
|
||||
}
|
||||
public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, bool mustMatchBodytype = false, bool mustMatchRace = false, string poseOverride = null)
|
||||
public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, bool mustMatchBodytype = false, bool mustMatchRace = false, string poseOverride = null, string variationOverride = null)
|
||||
{
|
||||
SizedApparelTexturePointDef var;
|
||||
return GetBodyPartGraphics(isHorny, out var, mustMatchBodytype, mustMatchSize, mustMatchRace, poseOverride);
|
||||
return GetBodyPartGraphics(isHorny, out var, mustMatchBodytype, mustMatchSize, mustMatchRace, poseOverride, variationOverride);
|
||||
}
|
||||
|
||||
public Graphic GetBodyPartGraphics(bool isHorny, out SizedApparelTexturePointDef outPoints, bool mustMatchSize = false, bool mustMatchBodyType = false , bool mustMatchRace = false ,string poseOverride = null, string variationOverride = null)
|
||||
|
|
|
@ -1542,12 +1542,22 @@ namespace SizedApparel
|
|||
|
||||
foreach(var addon in bodyAddons)
|
||||
{
|
||||
if(addon.bodyPartOf == SizedApparelBodyPartOf.Breasts)
|
||||
if(addon.bodyPartOf == SizedApparelBodyPartOf.Breasts) //Include SizedApparelBodyPartOf.Nipples
|
||||
{
|
||||
addon.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(BreastSeverityCache), breastvar?.variation);
|
||||
addon.SetBone(skeleton?.FindBone("Breasts"));
|
||||
addon.UpdateGraphic();
|
||||
}
|
||||
|
||||
|
||||
if (SizedApparelPatch.MenstruationActive)
|
||||
{
|
||||
//Nipple Patch?
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//bodyPartBreasts.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(breastSeverityCapped), breastvar?.variation);
|
||||
//bodyPartBreasts.UpdateGraphic();
|
||||
|
@ -1563,6 +1573,10 @@ namespace SizedApparel
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace SizedApparel
|
|||
public string raceName = null;
|
||||
public bool overrideDef = false;
|
||||
public bool asHuman = false;
|
||||
public bool allowRaceNamedApparel = true;
|
||||
public float drawMinAge = -1; //pawn's Biological age. -1 to ignore.
|
||||
|
||||
public AlienRaceSetting(string raceName)
|
||||
|
@ -33,6 +34,7 @@ namespace SizedApparel
|
|||
Scribe_Values.Look(ref raceName, "raceName", null);
|
||||
Scribe_Values.Look(ref overrideDef, "overrideDef", false);
|
||||
Scribe_Values.Look(ref asHuman, "asHuman", false);
|
||||
Scribe_Values.Look(ref allowRaceNamedApparel, "allowRaceNamedApparel", true);
|
||||
Scribe_Values.Look(ref drawMinAge, "drawMinAge", -1);
|
||||
}
|
||||
|
||||
|
@ -561,6 +563,7 @@ namespace SizedApparel
|
|||
}
|
||||
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.CheckboxLabeled("Allow Race Named Apparel", ref raceSetting.allowRaceNamedApparel, "This Race Can use separated texture from common race. even same BodyType name. \n Default: True");
|
||||
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();
|
||||
|
|
|
@ -156,11 +156,9 @@ namespace SizedApparel
|
|||
|
||||
string path;
|
||||
string extraPath = null;
|
||||
string raceExtraPath = null;
|
||||
string racePath = null;
|
||||
|
||||
|
||||
|
||||
//string raceExtraPath = null;
|
||||
//string racePath = null;
|
||||
|
||||
//path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName;
|
||||
path = sourceGraphic.path;
|
||||
|
@ -185,12 +183,15 @@ namespace SizedApparel
|
|||
path = path + genderSting;
|
||||
|
||||
if (wearerDefName != null)
|
||||
racePath = path + "_" + wearerDefName;
|
||||
{
|
||||
//racePath = path + "_" + wearerDefName;
|
||||
path = path + "_" + wearerDefName;
|
||||
}
|
||||
if (breastHediffName != null)
|
||||
{
|
||||
extraPath = path + "_" + breastHediffName;
|
||||
if (wearerDefName != null)
|
||||
raceExtraPath = path + "_" + wearerDefName + "_" + breastHediffName;
|
||||
//if (wearerDefName != null)
|
||||
// raceExtraPath = path + "_" + wearerDefName + "_" + breastHediffName;
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,10 +207,12 @@ namespace SizedApparel
|
|||
Graphic graphic = null;
|
||||
bool findBigger = true; // if false : search smaller first
|
||||
string pathString = "";
|
||||
while (offset < SizedApparelUtility.breastsSizeStrings.Length)
|
||||
|
||||
while (offset < SizedApparelUtility.breastsSizeStrings.Length) //Search Bigger
|
||||
{
|
||||
if (breastHediffName != null)
|
||||
{
|
||||
/*
|
||||
if(raceExtraPath != null)
|
||||
{
|
||||
pathString = raceExtraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut);
|
||||
|
@ -224,7 +227,7 @@ namespace SizedApparel
|
|||
//Log.Message(extraPath + BreastSeverityString(breastSeverity, offset, findBigger) + ":Extra Texture Found");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
pathString = extraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut);
|
||||
|
@ -243,7 +246,7 @@ namespace SizedApparel
|
|||
}
|
||||
if (SizedApparelSettings.Debug && SizedApparelSettings.DetailLog)
|
||||
Log.Message("[Sized Apparel] (" + pathString + ")apparel texture is missing");
|
||||
|
||||
/*
|
||||
if(racePath != null)
|
||||
{
|
||||
pathString = racePath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut);
|
||||
|
@ -258,7 +261,7 @@ namespace SizedApparel
|
|||
//Log.Message(path + BreastSeverityString(breastSeverity, offset, findBigger) + ":Texture Found");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
pathString = path + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, findBigger, ref indexOut, ref severityOut);
|
||||
|
@ -282,13 +285,16 @@ namespace SizedApparel
|
|||
if (indexOut == -1)
|
||||
break;
|
||||
}
|
||||
if (validTexture == false)
|
||||
|
||||
|
||||
if (validTexture == false) // Search Smaller
|
||||
{
|
||||
offset = 0;
|
||||
while (offset < SizedApparelUtility.breastsSizeStrings.Length)
|
||||
{
|
||||
if (breastHediffName != null)
|
||||
{
|
||||
/*
|
||||
if (raceExtraPath != null)
|
||||
{
|
||||
pathString = raceExtraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut);
|
||||
|
@ -305,7 +311,7 @@ namespace SizedApparel
|
|||
//Log.Message(extraPath + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Extra Texture Found");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
pathString = extraPath + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut);
|
||||
if (ContentFinder<Texture2D>.Get((pathString + "_south"), false) != null) // checking special texture like udder
|
||||
|
@ -325,7 +331,7 @@ namespace SizedApparel
|
|||
|
||||
//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);
|
||||
|
@ -341,7 +347,7 @@ namespace SizedApparel
|
|||
//Log.Message(path + BreastSeverityString(breastSeverity, offset, !findBigger) + ":Texture Found");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
pathString = path + SizedApparelUtility.BreastSeverityString(breastSeverity, offset, !findBigger, ref indexOut, ref severityOut);
|
||||
if ((ContentFinder<Texture2D>.Get((pathString + "_south"), false) != null))
|
||||
|
@ -388,11 +394,12 @@ namespace SizedApparel
|
|||
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;
|
||||
|
||||
}
|
||||
|
|
|
@ -273,7 +273,17 @@ namespace SizedApparel
|
|||
|
||||
else
|
||||
targetRaceName = key.raceName;*/
|
||||
|
||||
|
||||
AlienRaceSetting raceSetting;
|
||||
raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == key.raceName);
|
||||
|
||||
targetRaceName = key.raceName;
|
||||
if(raceSetting != null && raceSetting.allowRaceNamedApparel == false)
|
||||
{
|
||||
targetRaceName = null;
|
||||
}
|
||||
|
||||
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)
|
||||
|
@ -299,12 +309,43 @@ namespace SizedApparel
|
|||
result = new PathAndSize(graphic.path, indexOut, false, customPose, hediffResult, key.bodyTypeName, key.raceName);
|
||||
SupportedApparelResultPath.SetOrAdd(key, result);
|
||||
SupportedApparelOriginalPath.SetOrAdd(result.pathWithSizeIndex, key.pathWithoutSizeIndex);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Try Search Human Apparel. then null
|
||||
if (key.raceName != "Human" && key.raceName != null) // null check for avoid infinite loop
|
||||
{
|
||||
if (raceSetting != null && raceSetting.asHuman)
|
||||
{
|
||||
var newKey = new SizedApparelDatabaseKey(key.pathWithoutSizeIndex, "Human", key.bodyTypeName, key.gender, key.hediffName, key.targetSize, key.isHorny, key.customPose, key.variation);
|
||||
result = GetSupportedApparelSizedPath(newKey, out indexOut, out currentSeverityOut);
|
||||
SupportedApparelResultPath.SetOrAdd(key, result);
|
||||
SupportedApparelOriginalPath.SetOrAdd(key.pathWithoutSizeIndex, key.pathWithoutSizeIndex);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
var newKey = new SizedApparelDatabaseKey(key.pathWithoutSizeIndex, null, key.bodyTypeName, key.gender, key.hediffName, key.targetSize, key.isHorny, key.customPose, key.variation);
|
||||
result = GetSupportedApparelSizedPath(newKey, out indexOut, out currentSeverityOut);
|
||||
SupportedApparelResultPath.SetOrAdd(key, result);
|
||||
SupportedApparelOriginalPath.SetOrAdd(key.pathWithoutSizeIndex, key.pathWithoutSizeIndex);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (key.raceName == "Human")
|
||||
{
|
||||
var newKey = new SizedApparelDatabaseKey(key.pathWithoutSizeIndex, null, key.bodyTypeName, key.gender, key.hediffName, key.targetSize, key.isHorny, key.customPose, key.variation);
|
||||
result = GetSupportedApparelSizedPath(newKey, out indexOut, out currentSeverityOut);
|
||||
SupportedApparelResultPath.SetOrAdd(key, result);
|
||||
SupportedApparelOriginalPath.SetOrAdd(key.pathWithoutSizeIndex, key.pathWithoutSizeIndex);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = new PathAndSize(null, -1);
|
||||
SupportedApparelResultPath.SetOrAdd(key, result);
|
||||
SupportedApparelOriginalPath.SetOrAdd(key.pathWithoutSizeIndex, key.pathWithoutSizeIndex);
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue