Race customization and data saving

This commit is contained in:
AbstractConcept 2022-09-24 02:17:40 -05:00
parent 2f3f807911
commit d3b676df06
456 changed files with 6388 additions and 419 deletions

View file

@ -17,7 +17,7 @@ namespace RimWorldAnimationStudio
[XmlArray("tags"), XmlArrayItem("li")] public List<string> tags;
[XmlIgnore] public ActorGender gender;
[XmlIgnore] public string raceDef;
[XmlIgnore] private AlienRaceDef alienRaceDef;
public BodyTypeOffset bodyTypeOffset = new BodyTypeOffset();
public bool initiator = false;
@ -37,9 +37,24 @@ namespace RimWorldAnimationStudio
public bool ShouldSerializeisFucking() { return isFucking; }
public bool ShouldSerializeisFucked() { return isFucked; }
public AlienRaceDef GetAlienRaceDef()
{
if (alienRaceDef == null)
{ alienRaceDef = AlienRaceDefs.GetNamed("Human"); }
return alienRaceDef;
}
public void SetAlienRaceDef(string alienRaceDefName)
{
AlienRaceDef alienRaceDef = AlienRaceDefs.GetNamed(alienRaceDefName);
if (alienRaceDef != null)
{ this.alienRaceDef = alienRaceDef; }
}
public void ValidateData()
{
defNames = defNames.Intersect(Tags.defNames.Concat(CustomTags.defNames))?.ToList();
bodyDefTypes = bodyDefTypes.Intersect(Tags.bodyDefTypes.Concat(CustomTags.bodyDefTypes))?.ToList();
requiredGenitals = requiredGenitals.Intersect(Tags.bodyParts.Concat(CustomTags.bodyParts))?.ToList();
}