Bug fixes plus extra features

- Insert adds a new keyframe to the selected timeline
- New stages have frames cloned from the last frame of current stage
- Existing key are now replaced when another key is dropped on them
- Fixed bug where starting a new animation could result in errors
This commit is contained in:
AbstractConcept 2022-10-18 21:57:43 -05:00
parent ca22fa0c18
commit 2989d9a72c
137 changed files with 527 additions and 668 deletions

View file

@ -44,7 +44,7 @@ namespace RimWorldAnimationStudio
private float playBackSpeed = 1f;
public void MakeDirty()
{ isDirty = true; }
{ isDirty = true; isTimelineDirty = true; }
public void MakeTimelineDirty()
{ isTimelineDirty = true; }
@ -255,10 +255,11 @@ namespace RimWorldAnimationStudio
public void Reset()
{
Workspace.stageID = 0;
isAnimating = false;
timeSinceLastUpdate = 0;
cycleIndex = 0;
MakeDirty();
}
public void InitializeAnimationTimeline()
@ -377,7 +378,7 @@ namespace RimWorldAnimationStudio
public void ClonePawnKeyframe()
{
List<PawnKeyframe> keyframesToClone = Workspace.Instance.GetPawnKeyframes(Workspace.keyframeID);
List<PawnKeyframe> keyframesToClone = Workspace.Instance.GetPawnKeyframesByID(Workspace.keyframeID);
foreach (PawnKeyframe keyframe in keyframesToClone)
{
@ -413,7 +414,7 @@ namespace RimWorldAnimationStudio
{
Workspace.copiedKeyframes.Clear();
List<PawnKeyframe> keyframesToClone = Workspace.Instance.GetPawnKeyframes(Workspace.keyframeID);
List<PawnKeyframe> keyframesToClone = Workspace.Instance.GetPawnKeyframesByID(Workspace.keyframeID);
foreach (PawnKeyframe keyframe in keyframesToClone)
{ Workspace.copiedKeyframes.Add(keyframe.Copy()); }