Bug fixes (issues #1, 2, 3 and 6)

This commit is contained in:
AbstractConcept 2022-10-02 00:42:07 -05:00
parent 6b44db7400
commit 518a912ef1
156 changed files with 352 additions and 625 deletions

View file

@ -77,14 +77,16 @@ namespace RimWorldAnimationStudio
if (siblingIndex != null && siblingCount != null && MoveAnimationTimeline(siblingIndex.Value, delta))
{
//siblingIndex = Mathf.Clamp(siblingCount.Value + delta, 0, siblingCount.Value - 1);
transform.SetSiblingIndex(transform.GetSiblingIndex() + delta);
//transform.SetSiblingIndex(transform.GetSiblingIndex() + delta);
AnimationController.Instance.ResetAnimationTimeline();
AnimationController.Instance.InitializeAnimationTimeline();
}
}
public bool MoveAnimationTimeline(int startIndex, int delta)
{
if (startIndex + delta < 0 || startIndex + delta >= Workspace.animationDef.animationStages[Workspace.stageID].animationClips.Count)
{ return false; }
{ Debug.Log("Cannot move animation timeline - movement would exceed bounds"); return false; }
Actor actor = Workspace.animationDef.actors[startIndex];
Workspace.animationDef.actors[startIndex] = Workspace.animationDef.actors[startIndex + delta];

View file

@ -23,6 +23,7 @@ namespace RimWorldAnimationStudio
private PawnAnimationClip clip;
private PawnKeyframe keyframe;
private float dragTimeStart = -1f;
public void Initialize(AnimationTimeline timeline, int actorID, int keyframeID)
{
@ -47,7 +48,7 @@ namespace RimWorldAnimationStudio
keyframe.atTick = (int)value;
clip.BuildSimpleCurves();
AnimationController.Instance.stageTick = keyframe.atTick.Value;
//AnimationController.Instance.stageTick = keyframe.atTick.Value;
timeline.InitiateUpdateOfGhostFrames();
}
@ -104,9 +105,11 @@ namespace RimWorldAnimationStudio
public void OnBeginDrag(PointerEventData eventData)
{
AnimationController.Instance.stageTick = keyframe.atTick.Value;
//AnimationController.Instance.stageTick = keyframe.atTick.Value;
Workspace.actorID = actorID;
Workspace.keyframeID = keyframeID;
dragTimeStart = Time.unscaledTime;
}
public override void OnDrag(PointerEventData eventData)
@ -114,9 +117,12 @@ namespace RimWorldAnimationStudio
if (keyframe.atTick == 1)
{ value = 1; return; }
if (Time.unscaledTime - dragTimeStart < 0.05f) return;
interactable = true;
base.OnDrag(eventData);
AnimationController.Instance.stageTick = keyframe.atTick.Value;
//AnimationController.Instance.stageTick = keyframe.atTick.Value;
Workspace.actorID = actorID;
}
@ -125,6 +131,7 @@ namespace RimWorldAnimationStudio
if (keyframe.atTick == 1)
{ value = 1; return; }
interactable = false;
Workspace.Instance.RecordEvent("Keyframe tick");
}