mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
1.0.4.2
This commit is contained in:
parent
96bca993c7
commit
6d6546a071
7 changed files with 15 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<Manifest>
|
||||
<identifier>RJW Menstruation</identifier>
|
||||
<version>1.0.4.0</version>
|
||||
<version>1.0.4.2</version>
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
<incompatibleWith />
|
||||
|
|
Binary file not shown.
|
@ -1,3 +1,7 @@
|
|||
Version 1.0.4.2
|
||||
- fixed errors on hybrid custom
|
||||
- fixed errors on pregnancy
|
||||
|
||||
Version 1.0.4.1
|
||||
- fixed errors when the race mods are uninstalled
|
||||
- minor bug fixes
|
||||
|
|
|
@ -490,10 +490,10 @@ namespace RJW_Menstruation
|
|||
{
|
||||
PawnKindDef res = null;
|
||||
Pawn opposite = second;
|
||||
HybridInformations info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == first.def.defName && x.hybridExtension.Exists(y => y.defName == second.def.defName));
|
||||
HybridInformations info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == first.def?.defName && (x.hybridExtension?.Exists(y => y.defName == second.def?.defName) ?? false));
|
||||
if (info == null)
|
||||
{
|
||||
info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == second.def.defName && x.hybridExtension.Exists(y => y.defName == first.def.defName));
|
||||
info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == second.def?.defName && (x.hybridExtension?.Exists(y => y.defName == first.def?.defName) ?? false));
|
||||
opposite = first;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace RJW_Menstruation
|
|||
public class HybridExtension
|
||||
{
|
||||
|
||||
public Dictionary<string, float> hybridInfo;
|
||||
public Dictionary<string, float> hybridInfo = new Dictionary<string, float>();
|
||||
public ThingDef thingDef;
|
||||
|
||||
public HybridExtension() { }
|
||||
|
@ -60,7 +60,6 @@ namespace RJW_Menstruation
|
|||
|
||||
public void LoadDataFromXmlCustom(XmlNode xmlRoot)
|
||||
{
|
||||
hybridInfo = new Dictionary<string, float>();
|
||||
DirectXmlCrossRefLoader.RegisterObjectWantsCrossRef(this, "thingDef", xmlRoot.Name);
|
||||
XmlNodeList childNodes = xmlRoot.ChildNodes;
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace RJW_Menstruation
|
|||
|
||||
|
||||
Rect outRect = new Rect(inRect.x, inRect.y + 30f, inRect.width, inRect.height - 30f);
|
||||
Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, Math.Max(24f*Configurations.HybridOverride.Count(),10f));
|
||||
Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, Math.Max(24f*Configurations.HybridOverride?.Count() ?? 1,10f));
|
||||
Listing_Standard listmain = new Listing_Standard();
|
||||
|
||||
listmain.BeginScrollView(outRect, ref scroll, ref mainRect);
|
||||
|
@ -336,12 +336,12 @@ namespace RJW_Menstruation
|
|||
float additionalHeight = 0f;
|
||||
if (!info.hybridExtension.NullOrEmpty()) foreach(HybridExtensionExposable e in info.hybridExtension)
|
||||
{
|
||||
additionalHeight += e.hybridInfo.Count() * rowH;
|
||||
additionalHeight += e.hybridInfo?.Count() ?? 1 * rowH;
|
||||
}
|
||||
|
||||
|
||||
Rect outRect = new Rect(inRect.x, inRect.y + 30f, inRect.width, inRect.height - 30f);
|
||||
Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, rowH * info.hybridExtension.Count() + additionalHeight);
|
||||
Rect mainRect = new Rect(inRect.x, inRect.y + 30f, inRect.width - 30f, rowH * info.hybridExtension?.Count() ?? 1 + additionalHeight);
|
||||
Listing_Standard listmain = new Listing_Standard();
|
||||
|
||||
listmain.BeginScrollView(outRect, ref scroll, ref mainRect);
|
||||
|
@ -351,7 +351,7 @@ namespace RJW_Menstruation
|
|||
{
|
||||
foreach (HybridExtensionExposable extension in info.hybridExtension)
|
||||
{
|
||||
DoRow(listmain.GetRect(rowH + rowH * extension.hybridInfo.Count()), extension);
|
||||
DoRow(listmain.GetRect(rowH + rowH * extension.hybridInfo?.Count() ?? 1), extension);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -184,7 +184,8 @@ namespace RJW_Menstruation
|
|||
if (!h.babies.NullOrEmpty()) return h.babies.First();
|
||||
else
|
||||
{
|
||||
Log.Error("Baby not exist: baby was not created or removed");
|
||||
Log.Error("Baby not exist: baby was not created or removed. Remove pregnancy.");
|
||||
pawn.health.RemoveHediff(hediff);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue