mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Remove and save custom tags
This commit is contained in:
parent
e36ef6a368
commit
2f3f807911
264 changed files with 1118 additions and 498 deletions
|
@ -14,9 +14,8 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
[XmlArray("sexTypes"), XmlArrayItem("li")] public List<string> sexTypes = new List<string>();
|
||||
[XmlArray("interactionDefTypes"), XmlArrayItem("li")] public List<string> interactionDefTypes = new List<string>();
|
||||
[XmlArray("actors"), XmlArrayItem("li")] public List<Actor> actors = new List<Actor>();
|
||||
[XmlArray("actors"), XmlArrayItem("li")] public List<Actor> actors = new List<Actor>();
|
||||
[XmlArray("animationStages"), XmlArrayItem("li")] public List<AnimationStage> animationStages = new List<AnimationStage>();
|
||||
|
||||
[XmlIgnore] public int animationTimeTicks = 0;
|
||||
|
||||
public void Initialize()
|
||||
|
@ -30,60 +29,10 @@ namespace RimWorldAnimationStudio
|
|||
}
|
||||
}
|
||||
|
||||
// move to app manager
|
||||
public void RunPreSaveOperations()
|
||||
public void ValidateData()
|
||||
{
|
||||
// Stage edits
|
||||
for (int i = 0; i < animationStages.Count; i++)
|
||||
{
|
||||
AnimationStage stage = animationStages[i];
|
||||
|
||||
// Sort keyframes by atTick
|
||||
foreach (PawnAnimationClip clip in stage.animationClips)
|
||||
{ clip.keyframes = clip.keyframes.OrderBy(x => x.atTick).ToList(); }
|
||||
|
||||
// Check if looping
|
||||
int stageWindowSize = animationStages[i].stageWindowSize > 0 ? animationStages[i].stageWindowSize : animationStages[i].animationClips.Select(x => x.duration).Max();
|
||||
int cycles = Mathf.CeilToInt(animationStages[i].playTimeTicks / stageWindowSize);
|
||||
|
||||
stage.isLooping = cycles > 1;
|
||||
}
|
||||
|
||||
// Actor edits
|
||||
for (int i = 0; i < actors.Count; i++)
|
||||
{
|
||||
Actor actor = actors[i];
|
||||
|
||||
actor.isFucking = actor.requiredGenitals.Contains("Any appendage") ? (bool?)true : null;
|
||||
|
||||
if (actor.isFucking == true)
|
||||
{ actor.requiredGenitals.Remove("Any appendage"); }
|
||||
|
||||
actor.isFucked = actor.requiredGenitals.Contains("Any orifice") ? (bool?)true : null;
|
||||
|
||||
if (actor.isFucked == true)
|
||||
{ actor.requiredGenitals.Remove("Any orifice"); }
|
||||
|
||||
actor.controlGenitalAngle = animationStages.Any(x => x.animationClips[i].keyframes.Any(y => y.genitalAngle != 0)) ? (bool?)true : null;
|
||||
|
||||
//if (actor.requiredGender.Contains("Female")) actor.gender = ActorGender.Female;
|
||||
//else if (actor.requiredGender.Contains("Male")) actor.gender = ActorGender.Male;
|
||||
//else actor.gender = ActorGender.None;
|
||||
}
|
||||
|
||||
//actors.OrderBy(x => (int)x.gender);
|
||||
}
|
||||
|
||||
public void RunPostLoadOperations()
|
||||
{
|
||||
foreach (Actor actor in actors)
|
||||
{
|
||||
if (actor.isFucking == true)
|
||||
{ actor.requiredGenitals.Add("Any appendage"); }
|
||||
|
||||
if (actor.isFucked == true)
|
||||
{ actor.requiredGenitals.Add("Any orifice"); }
|
||||
}
|
||||
sexTypes = interactionDefTypes.Intersect(Tags.sexTypes.Concat(CustomTags.sexTypes))?.ToList();
|
||||
interactionDefTypes = interactionDefTypes.Intersect(Tags.interactionDefTypes.Concat(CustomTags.interactionDefTypes))?.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue