33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using RimWorld;
|
|
using Verse;
|
|
|
|
namespace Rimworld_Animations {
|
|
public class AnimationDef : Def
|
|
{
|
|
public List<AnimationStage> animationStages;
|
|
public List<Actor> actors;
|
|
public int animationTimeTicks = 0; //do not set manually
|
|
public bool sounds = false;
|
|
public List<rjw.xxx.rjwSextype> sexTypes = null;
|
|
public List<String> interactionDefTypes = null;
|
|
public List<string> tags = new List<string>();
|
|
|
|
public override void PostLoad() {
|
|
base.PostLoad();
|
|
// FIXME: I could not figure out how to map between controlGenitalAngle and PawnAnimationClip. This is brittle AF! -Zsar 2023-04-16
|
|
var controlGenitalAngle = this.actors.ConvertAll(actor => actor.controlGenitalAngle);
|
|
foreach(AnimationStage stage in animationStages) {
|
|
var brokenClips = stage.Initialize(controlGenitalAngle);
|
|
if (brokenClips > 0)
|
|
throw new Exception($"AnimationDef '{this.defName}', stage '{stage.stageName}' contained {brokenClips} broken Clips. The animation has been dropped.");
|
|
animationTimeTicks += stage.playTimeTicks;
|
|
}
|
|
}
|
|
}
|
|
}
|