Extra keybinds

This commit is contained in:
AbstractConcept 2022-10-08 21:15:28 -05:00
parent e210923733
commit c3c0a05ac0
139 changed files with 586 additions and 233 deletions

View file

@ -20,7 +20,9 @@ namespace RimWorldAnimationStudio
public static ActorManipulationMode actorManipulationMode = ActorManipulationMode.Pan;
public static ActorBodyPart selectedBodyPart;
static int _actorID = 0;
public static List<PawnKeyframe> copiedKeyframes = new List<PawnKeyframe>();
private static int _actorID = 0;
public static int actorID { get { return Mathf.Clamp(_actorID, 0, animationDef.actors.Count - 1); } set { _actorID = value; } }
public static int StageWindowSize
@ -109,6 +111,38 @@ namespace RimWorldAnimationStudio
return animationDef.animationStages[stageID].animationClips[actorID].keyframes.Any(x => x.atTick == atTick);
}
public PawnKeyframe GetNextKeyframe(int actorID)
{
PawnKeyframe pawnKeyframe = null;
PawnAnimationClip clip = GetPawnAnimationClip(actorID);
int stageTick = AnimationController.Instance.stageTick;
foreach (PawnKeyframe keyframe in clip.keyframes)
{
if (keyframe.atTick > stageTick)
{ pawnKeyframe = keyframe; break; }
}
return pawnKeyframe;
}
public PawnKeyframe GetPreviousKeyframe(int actorID)
{
PawnKeyframe pawnKeyframe = null;
PawnAnimationClip clip = GetPawnAnimationClip(actorID);
int stageTick = AnimationController.Instance.stageTick;
foreach (PawnKeyframe keyframe in clip.keyframes)
{
if (keyframe.atTick < stageTick)
{ pawnKeyframe = keyframe; }
}
return pawnKeyframe;
}
public PawnKeyframe GetCurrentOrPreviousKeyframe(int actorID)
{
PawnKeyframe pawnKeyframe = null;