Merge branch 'father-indication' into 'main'

Father indication

See merge request lutepickle/rjw_menstruation!2
This commit is contained in:
lutepickle 2022-04-26 12:24:50 +00:00
commit 8e8816d72e
6 changed files with 50 additions and 32 deletions

View file

@ -27,6 +27,7 @@
<Dialog_WombInfo09></Dialog_WombInfo09> <Dialog_WombInfo09></Dialog_WombInfo09>
<Dialog_DoCleanWomb_Tooltip>Gather cums into bucket</Dialog_DoCleanWomb_Tooltip> <Dialog_DoCleanWomb_Tooltip>Gather cums into bucket</Dialog_DoCleanWomb_Tooltip>
<Dialog_DontCleanWomb_Tooltip>Store cums in womb</Dialog_DontCleanWomb_Tooltip> <Dialog_DontCleanWomb_Tooltip>Store cums in womb</Dialog_DontCleanWomb_Tooltip>
<Dialog_FatherUnknown>Unknown</Dialog_FatherUnknown>
<Option1_Label_1>enable womb icon</Option1_Label_1> <Option1_Label_1>enable womb icon</Option1_Label_1>
<Option1_Label_2>enable button in health tab</Option1_Label_2> <Option1_Label_2>enable button in health tab</Option1_Label_2>
@ -43,7 +44,7 @@
<Option7_Label>cycle accelerate</Option7_Label> <Option7_Label>cycle accelerate</Option7_Label>
<Option7_Desc>accelerate menstrution cycle&#10;This can cause early menopause and infertility.&#10;Setting this lower than x12 is recommended.&#10;Rimworld's timescale: x6(default)&#10;</Option7_Desc> <Option7_Desc>accelerate menstrution cycle&#10;This can cause early menopause and infertility.&#10;Setting this lower than x12 is recommended.&#10;Rimworld's timescale: x6(default)&#10;</Option7_Desc>
<Option8_Label>Debug</Option8_Label> <Option8_Label>Debug</Option8_Label>
<Option8_Desc>show debug informations.</Option8_Desc> <Option8_Desc>Show debug informations.&#10;Also overrides "Fetus information level" to All</Option8_Desc>
<Option9_Label>womb status</Option9_Label> <Option9_Label>womb status</Option9_Label>
<Option9_Desc>draw womb icon in status window</Option9_Desc> <Option9_Desc>draw womb icon in status window</Option9_Desc>
<Option10_Label>vagina and breast status</Option10_Label> <Option10_Label>vagina and breast status</Option10_Label>
@ -100,9 +101,11 @@
<Option31_Desc>Enable permanent vagina stretch after birth.&#10;If you are using another mod handling this, turn off this option.</Option31_Desc> <Option31_Desc>Enable permanent vagina stretch after birth.&#10;If you are using another mod handling this, turn off this option.</Option31_Desc>
<Option32_Label>Morph power</Option32_Label> <Option32_Label>Morph power</Option32_Label>
<Option32_Desc>Set morph power.</Option32_Desc> <Option32_Desc>Set morph power.</Option32_Desc>
<Option_EnableGatherCumGizmo_Label>Enable Gather Cum Gizmo</Option_EnableGatherCumGizmo_Label>
<EstimatedCumLifespan>Estimated sperm lifespan</EstimatedCumLifespan> <EstimatedCumLifespan>Estimated sperm lifespan</EstimatedCumLifespan>
<EstimatedEggLifespan>Estimated egg lifespan</EstimatedEggLifespan> <EstimatedEggLifespan>Estimated egg lifespan</EstimatedEggLifespan>
<FertilityDesc>Chance of fertilization within an hour: {0}%&#10;The chance of pregnancy of fertilized egg.&#10;The white overlay is indicates fertilization chance of sperms in womb.</FertilityDesc> <FertilityDesc>Chance of fertilization within an hour: {0}%&#10;The chance of pregnancy of fertilized egg.&#10;The white overlay is indicates fertilization chance of sperms in womb.</FertilityDesc>
<Button_ResetToDefault>Reset to default</Button_ResetToDefault>
<FloatMenu_CleanSelf>Vaginal washing</FloatMenu_CleanSelf> <FloatMenu_CleanSelf>Vaginal washing</FloatMenu_CleanSelf>

View file

@ -27,6 +27,8 @@ namespace RJW_Menstruation
public const float EggLifespanMultiplierDefault = 1.0f; public const float EggLifespanMultiplierDefault = 1.0f;
public const float VaginaMorphPowerDefault = 0.2f; public const float VaginaMorphPowerDefault = 0.2f;
public static DetailLevel infoDetail = DetailLevel.All;
public static float ImplantationChance = ImplantationChanceDefault; public static float ImplantationChance = ImplantationChanceDefault;
public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault; public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault;
public static float FertilizeChance = FertilizeChanceDefault; public static float FertilizeChance = FertilizeChanceDefault;
@ -43,7 +45,7 @@ namespace RJW_Menstruation
public static bool DrawEggOverlay = true; public static bool DrawEggOverlay = true;
public static bool Debug = false; public static bool Debug = false;
public static bool EnableMenopause = true; public static bool EnableMenopause = true;
public static DetailLevel InfoDetail = DetailLevel.All; public static DetailLevel InfoDetail { get => Debug ? DetailLevel.All : infoDetail; }
public static bool UseMultiplePregnancy = true; public static bool UseMultiplePregnancy = true;
public static bool EnableHeteroOvularTwins = true; public static bool EnableHeteroOvularTwins = true;
public static bool EnableEnzygoticTwins = true; public static bool EnableEnzygoticTwins = true;
@ -52,6 +54,7 @@ namespace RJW_Menstruation
public static int MaxEnzygoticTwins = MaxEnzygoticTwinsDefault; public static int MaxEnzygoticTwins = MaxEnzygoticTwinsDefault;
public static int BleedingAmount = BleedingAmountDefault; public static int BleedingAmount = BleedingAmountDefault;
public static bool EnableButtonInHT = false; public static bool EnableButtonInHT = false;
public static bool EnableGatherCumGizmo = true;
public static PawnFlags ShowFlag = PawnFlags.Colonist | PawnFlags.Prisoner; public static PawnFlags ShowFlag = PawnFlags.Colonist | PawnFlags.Prisoner;
public static bool UseHybridExtention = true; public static bool UseHybridExtention = true;
public static bool MotherFirst = false; public static bool MotherFirst = false;
@ -79,6 +82,7 @@ namespace RJW_Menstruation
CumDecayRatioAdjust = CumDecayRatioAdjustDefault; CumDecayRatioAdjust = CumDecayRatioAdjustDefault;
CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault; CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault;
EnableWombIcon = true; EnableWombIcon = true;
EnableGatherCumGizmo = true;
EnableAnimalCycle = false; EnableAnimalCycle = false;
CycleAcceleration = CycleAccelerationDefault; CycleAcceleration = CycleAccelerationDefault;
EnzygoticTwinsChanceAdjust = EnzygoticTwinsChanceAdjustDefault; EnzygoticTwinsChanceAdjust = EnzygoticTwinsChanceAdjustDefault;
@ -183,7 +187,7 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref DrawVaginaStatus, "DrawVaginaStatus", DrawVaginaStatus, true); Scribe_Values.Look(ref DrawVaginaStatus, "DrawVaginaStatus", DrawVaginaStatus, true);
Scribe_Values.Look(ref DrawEggOverlay, "DrawEggOvray", DrawEggOverlay, true); Scribe_Values.Look(ref DrawEggOverlay, "DrawEggOvray", DrawEggOverlay, true);
Scribe_Values.Look(ref Debug, "Debug", Debug, true); Scribe_Values.Look(ref Debug, "Debug", Debug, true);
Scribe_Values.Look(ref InfoDetail, "InfoDetail", InfoDetail, true); Scribe_Values.Look(ref infoDetail, "InfoDetail", infoDetail, true);
Scribe_Values.Look(ref EnableMenopause, "EnableMenopause", EnableMenopause, true); Scribe_Values.Look(ref EnableMenopause, "EnableMenopause", EnableMenopause, true);
Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true); Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true);
Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true); Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true);
@ -193,6 +197,7 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref MaxEnzygoticTwins, "MaxEnzygoticTwins", MaxEnzygoticTwins, true); Scribe_Values.Look(ref MaxEnzygoticTwins, "MaxEnzygoticTwins", MaxEnzygoticTwins, true);
Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmount, true); Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmount, true);
Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", EnableButtonInHT, true); Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", EnableButtonInHT, true);
Scribe_Values.Look(ref EnableGatherCumGizmo, "EnableGatherCumGizmo", true, true);
Scribe_Values.Look(ref ShowFlag, "ShowFlag", ShowFlag, true); Scribe_Values.Look(ref ShowFlag, "ShowFlag", ShowFlag, true);
Scribe_Values.Look(ref UseHybridExtention, "UseHybridExtention", UseHybridExtention, true); Scribe_Values.Look(ref UseHybridExtention, "UseHybridExtention", UseHybridExtention, true);
Scribe_Values.Look(ref MotherFirst, "MotherFirst", MotherFirst, true); Scribe_Values.Look(ref MotherFirst, "MotherFirst", MotherFirst, true);
@ -264,10 +269,11 @@ namespace RJW_Menstruation
Widgets.BeginScrollView(outRect, ref scroll, mainRect); Widgets.BeginScrollView(outRect, ref scroll, mainRect);
listmain.Begin(mainRect); listmain.Begin(mainRect);
listmain.Gap(20f); listmain.Gap(20f);
Rect optionrect1 = listmain.GetRect(30f); Rect firstLine = listmain.GetRect(30f);
Widgets.CheckboxLabeled(optionrect1.LeftHalf(), Translations.Option1_Label_1, ref Configurations.EnableWombIcon,false,null,null,true); firstLine.SplitVertically(firstLine.width / 3, out Rect leftCell, out Rect middleAndRightCells);
Widgets.CheckboxLabeled(optionrect1.RightHalf(), Translations.Option1_Label_2, ref Configurations.EnableButtonInHT, false, null, null, true); Widgets.CheckboxLabeled(leftCell, Translations.Option1_Label_1, ref Configurations.EnableWombIcon, false, null, null, true);
//listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); Widgets.CheckboxLabeled(middleAndRightCells.LeftHalf(), Translations.Option1_Label_2, ref Configurations.EnableButtonInHT, false, null, null, true);
Widgets.CheckboxLabeled(middleAndRightCells.RightHalf(), Translations.Option_EnableGatherCumGizmo_Label, ref Configurations.EnableGatherCumGizmo, false, null, null, true);
if (Configurations.EnableWombIcon || Configurations.EnableButtonInHT) if (Configurations.EnableWombIcon || Configurations.EnableButtonInHT)
{ {
Listing_Standard wombsection = listmain.BeginSection(400); Listing_Standard wombsection = listmain.BeginSection(400);
@ -279,12 +285,12 @@ namespace RJW_Menstruation
wombsection.CheckboxLabeled(Translations.Option10_Label, ref Configurations.DrawVaginaStatus, Translations.Option10_Desc); wombsection.CheckboxLabeled(Translations.Option10_Label, ref Configurations.DrawVaginaStatus, Translations.Option10_Desc);
wombsection.CheckboxLabeled(Translations.Option29_Label, ref Configurations.AllowShrinkIcon, Translations.Option29_Desc); wombsection.CheckboxLabeled(Translations.Option29_Label, ref Configurations.AllowShrinkIcon, Translations.Option29_Desc);
if (wombsection.ButtonText(Translations.Option11_Label + ": " + Configurations.LevelString(Configurations.InfoDetail))) if (wombsection.ButtonText(Translations.Option11_Label + ": " + Configurations.LevelString(Configurations.infoDetail)))
{ {
if (Configurations.InfoDetail == Configurations.DetailLevel.Hide) Configurations.InfoDetail = Configurations.DetailLevel.All; if (Configurations.infoDetail == Configurations.DetailLevel.Hide) Configurations.infoDetail = Configurations.DetailLevel.All;
else Configurations.InfoDetail++; else Configurations.infoDetail++;
} }
switch (Configurations.InfoDetail) switch (Configurations.infoDetail)
{ {
case Configurations.DetailLevel.All: case Configurations.DetailLevel.All:
wombsection.Label(Translations.Option11_Desc_1); wombsection.Label(Translations.Option11_Desc_1);
@ -446,7 +452,7 @@ namespace RJW_Menstruation
Widgets.EndScrollView(); Widgets.EndScrollView();
listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc); listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc);
if (listmain.ButtonText("reset to default")) if (listmain.ButtonText(Translations.Button_ResetToDefault))
{ {
Configurations.SettoDefault(); Configurations.SettoDefault();

View file

@ -87,26 +87,25 @@ namespace RJW_Menstruation
public string GetFatherInfo() public string GetFatherInfo()
{ {
if (babies.NullOrEmpty())
return "Null";
string res = Translations.Dialog_WombInfo03 + ": "; string res = Translations.Dialog_WombInfo03 + ": ";
if (!babies.NullOrEmpty())
if (!is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All)
return res + Translations.Dialog_FatherUnknown;
var babiesdistinct = babies.Distinct(new FatherComparer(pawn));
int iteration = 0;
foreach (Pawn baby in babiesdistinct)
{ {
if (iteration > 0) res += ", ";
var babiesdistinct = babies.Distinct(new FatherComparer(pawn)); res += Utility.GetFather(baby, pawn)?.LabelShort ?? Translations.Dialog_FatherUnknown;
int iteration = 0; iteration++;
foreach (Pawn baby in babiesdistinct)
{
if (iteration > 0) res += ", ";
res += Utility.GetFather(baby, pawn)?.LabelShort ?? "Unknown";
iteration++;
}
return res;
} }
return "Null"; return res;
} }
private void HumanlikeBirth(Pawn baby, List<Pawn> siblings) private void HumanlikeBirth(Pawn baby, List<Pawn> siblings)
{ {
Pawn mother = pawn; Pawn father = Utility.GetFather(baby, pawn); Pawn mother = pawn; Pawn father = Utility.GetFather(baby, pawn);

View file

@ -21,6 +21,7 @@ namespace RJW_Menstruation
public static readonly string Button_MilkTooltip = "Button_MilkTooltip".Translate(); public static readonly string Button_MilkTooltip = "Button_MilkTooltip".Translate();
public static readonly string Dialog_DoCleanWomb_Tooltip = "Dialog_DoCleanWomb_Tooltip".Translate(); public static readonly string Dialog_DoCleanWomb_Tooltip = "Dialog_DoCleanWomb_Tooltip".Translate();
public static readonly string Dialog_DontCleanWomb_Tooltip = "Dialog_DontCleanWomb_Tooltip".Translate(); public static readonly string Dialog_DontCleanWomb_Tooltip = "Dialog_DontCleanWomb_Tooltip".Translate();
public static readonly string Dialog_FatherUnknown = "Dialog_FatherUnknown".Translate();
public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate(); public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate();
public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate(); public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate();
@ -106,6 +107,9 @@ namespace RJW_Menstruation
public static readonly string Option31_Desc = "Option31_Desc".Translate(); public static readonly string Option31_Desc = "Option31_Desc".Translate();
public static readonly string Option32_Label = "Option32_Label".Translate(); public static readonly string Option32_Label = "Option32_Label".Translate();
public static readonly string Option32_Desc = "Option32_Desc".Translate(); public static readonly string Option32_Desc = "Option32_Desc".Translate();
public static readonly string Option_EnableGatherCumGizmo_Label = "Option_EnableGatherCumGizmo_Label".Translate();
public static readonly string Button_ResetToDefault = "Button_ResetToDefault".Translate();
public static readonly string EstimatedCumLifespan = "EstimatedCumLifespan".Translate(); public static readonly string EstimatedCumLifespan = "EstimatedCumLifespan".Translate();
public static readonly string EstimatedEggLifespan = "EstimatedEggLifespan".Translate(); public static readonly string EstimatedEggLifespan = "EstimatedEggLifespan".Translate();

View file

@ -191,17 +191,22 @@ namespace RJW_Menstruation
Pawn fetus = pawn.GetFetus(); Pawn fetus = pawn.GetFetus();
if (fetus != null && Utility.ShowFetusInfo()) if (fetus != null && Utility.ShowFetusInfo())
{ {
preginfoheight = fontheight; preginfoheight = fontheight;
Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight); Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight);
fontstyleright.normal.textColor = Color.white; fontstyleright.normal.textColor = Color.white;
fontstyleright.alignment = TextAnchor.MiddleRight; fontstyleright.alignment = TextAnchor.MiddleRight;
buttonstyle.alignment = TextAnchor.MiddleLeft; buttonstyle.alignment = TextAnchor.MiddleLeft;
GUI.Box(preginfo, b.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); string father;
GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + b.father.LabelShort + " ", fontstyleright);
}
if (!b.is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All)
father = Translations.Dialog_FatherUnknown;
else
father = b.father.LabelShort;
GUI.Box(preginfo, b.babies.Count + " " + fetus.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle);
GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + father + " ", fontstyleright);
}
} }
else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true); else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
} }

View file

@ -18,7 +18,8 @@ namespace RJW_Menstruation.Sexperience
{ {
public static void Postfix(Pawn pawn, HediffComp_Menstruation comp, ref List<Gizmo> __result) public static void Postfix(Pawn pawn, HediffComp_Menstruation comp, ref List<Gizmo> __result)
{ {
__result.Add(CreateGizmo_GatherCum(comp)); if (Configurations.EnableGatherCumGizmo)
__result.Add(CreateGizmo_GatherCum(comp));
} }
private static Gizmo CreateGizmo_GatherCum(HediffComp_Menstruation comp) private static Gizmo CreateGizmo_GatherCum(HediffComp_Menstruation comp)