public override void CreateKeyFrame(AnimationClass.AnimationLayer ActiveLayer, int KeyFrame) { int HighestPreviousKeyFrame; int NextKeyFrame; GetSurroundingKeyFrames(KeyFrame, out HighestPreviousKeyFrame, out NextKeyFrame); VisibleAnimationObjectKeyFrame HighestPreviousKeyFrameObject; DicAnimationKeyFrame.TryGetValue(HighestPreviousKeyFrame, out HighestPreviousKeyFrameObject); if (HighestPreviousKeyFrame != -1) { HighestPreviousKeyFrameObject.NextKeyFrame = KeyFrame; } if (HighestPreviousKeyFrameObject != null) { AnimationObjectKeyFrame ActiveAnimationSprite = HighestPreviousKeyFrameObject.Copy(ActiveLayer, NextKeyFrame); Add(KeyFrame, ActiveAnimationSprite); } else { Add(KeyFrame, null); } NextEventKeyFrame = KeyFrame; }
public virtual void MoveKeyFrame(int OriginalKeyFrame, int NewKeyFrame) { AnimationObjectKeyFrame KeyFrameToMove = Get(OriginalKeyFrame); DeleteKeyFrame(OriginalKeyFrame); Add(NewKeyFrame, KeyFrameToMove); }
public void OnKeyFrameSelected(AnimationObjectKeyFrame ActiveKeyFrame) { if (KeyFrameSelected != null) { KeyFrameSelected(ActiveKeyFrame); } }
public override bool TryGetValue(int Key, out AnimationObjectKeyFrame Value) { VisibleAnimationObjectKeyFrame OutVisibleAnimationObjectKeyFrame = null; bool ReturnValue = DicAnimationKeyFrame.TryGetValue(Key, out OutVisibleAnimationObjectKeyFrame); Value = OutVisibleAnimationObjectKeyFrame; return(ReturnValue); }
public override void Add(int Index, AnimationObjectKeyFrame NewAnimationObjectKeyFrame) { if (NewAnimationObjectKeyFrame == null) { DicAnimationKeyFrame.Add(Index, CreateFirstKeyFrame()); } else { DicAnimationKeyFrame.Add(Index, NewAnimationObjectKeyFrame); } }
public BackgroundKeyFrame(AnimationObjectKeyFrame Copy) { BackgroundKeyFrame ActiveBackgroundKeyFrame = Copy as BackgroundKeyFrame; if (ActiveBackgroundKeyFrame != null) { _SpeedX = ActiveBackgroundKeyFrame._SpeedX; _SpeedY = ActiveBackgroundKeyFrame._SpeedY; _SpeedZ = ActiveBackgroundKeyFrame._SpeedZ; _SpeedYaw = ActiveBackgroundKeyFrame._SpeedYaw; _SpeedPitch = ActiveBackgroundKeyFrame._SpeedPitch; _SpeedRoll = ActiveBackgroundKeyFrame._SpeedRoll; } }
public virtual void CreateKeyFrame(AnimationClass.AnimationLayer ActiveLayer, int KeyFrame) { int HighestPreviousKeyFrame; GetSurroundingKeyFrames(KeyFrame, out HighestPreviousKeyFrame, out _); AnimationObjectKeyFrame HighestPreviousKeyFrameObject; TryGetValue(HighestPreviousKeyFrame, out HighestPreviousKeyFrameObject); if (HighestPreviousKeyFrameObject != null) { AnimationObjectKeyFrame ActiveAnimationSprite = HighestPreviousKeyFrameObject.Copy(ActiveLayer); Add(KeyFrame, ActiveAnimationSprite); } else { Add(KeyFrame, null); } }
public override void MoveKeyFrame(int OriginalKeyFrame, int NewKeyFrame) { int HighestPreviousKeyFrame; int NextKeyFrame; GetSurroundingKeyFrames(OriginalKeyFrame, out HighestPreviousKeyFrame, out NextKeyFrame); AnimationObjectKeyFrame KeyFrameToMove = Get(OriginalKeyFrame); if (HighestPreviousKeyFrame >= 0) { if (HighestPreviousKeyFrame == NewKeyFrame || NextKeyFrame == NewKeyFrame) { AnimationObjectKeyFrame KeyFrameToSwapWith = Get(NewKeyFrame); if (NewKeyFrame > OriginalKeyFrame) { DicAnimationKeyFrame[OriginalKeyFrame].NextKeyFrame = NextKeyFrame; DicAnimationKeyFrame[NewKeyFrame].NextKeyFrame = NewKeyFrame; } else { DicAnimationKeyFrame[OriginalKeyFrame].NextKeyFrame = OriginalKeyFrame; DicAnimationKeyFrame[NewKeyFrame].NextKeyFrame = NextKeyFrame; } Remove(NewKeyFrame); Remove(OriginalKeyFrame); Add(NewKeyFrame, KeyFrameToMove); Add(OriginalKeyFrame, KeyFrameToSwapWith); } else { DicAnimationKeyFrame[HighestPreviousKeyFrame].NextKeyFrame = NewKeyFrame; Remove(OriginalKeyFrame); Add(NewKeyFrame, KeyFrameToMove); } } NextEventKeyFrame = NewKeyFrame; }
public QuoteSetKeyFrame(AnimationObjectKeyFrame Copy) { _QuoteSet = new Quote(); }
public override void Add(int Index, AnimationObjectKeyFrame NewAnimationObjectKeyFrame) { DicAnimationKeyFrame.Add(Index, (VisibleAnimationObjectKeyFrame)NewAnimationObjectKeyFrame); }
private void panTimelineViewer_MouseDown(object sender, MouseEventArgs e) { MouseEventOriginal = e; MouseEventOld = e; if (e.X < 0) { return; } #region Left Button if (e.Button == MouseButtons.Left) { if (e.X < TimelineStartX) { TimelineDragDropSelectedItemIndex = -2; int VisibleIndex = 0; for (int i = 0; i < TimelineActiveItems && VisibleIndex < TimelineVisibleItemCount; i++) { ActiveTimelineEvent = GetTimelineEvent(i); //End of TimelineEvent list. if (ActiveTimelineEvent == null) { break; } if (e.Y >= (VisibleIndex + 1) * 20 && e.Y < (VisibleIndex + 2) * 20 && i >= vsbTimeline.Value) { TimelineDragDropSelectedItemIndex = i; } else { if (Control.ModifierKeys != Keys.Shift) { ActiveAnimation.ListSelectedObjects.Remove(ActiveTimelineEvent); GroupTimeline ActiveGroup = ActiveTimelineEvent as GroupTimeline; if (ActiveGroup != null) { SelectTimelineGroup(ActiveGroup, false); } } } if (i >= vsbTimeline.Value) { VisibleIndex++; } } if (TimelineDragDropSelectedItemIndex >= 0) { ActiveTimelineEvent = GetTimelineEvent(TimelineDragDropSelectedItemIndex); GroupTimeline ActiveGroup = ActiveTimelineEvent as GroupTimeline; if (ActiveGroup != null) { //Expend/Collapse the group if (e.X >= 1 + TimelineDragDropSelectedItemIndent * 5 && e.X < 9 + TimelineDragDropSelectedItemIndent * 5) { ActiveGroup.IsOpen = !ActiveGroup.IsOpen; TimelineDragDropSelectedItemIndex = -2; UpdateTimelineVisibleItems(); } else { SelectTimelineGroup(ActiveGroup, true); OnTimelineSelected(ActiveTimelineEvent); } } else { OnTimelineSelected(ActiveTimelineEvent); } } DrawTimeline(); } else if (e.Y <= 20) { OnKeyFrameChange((e.X - TimelineStartX + ScrollbarStartIndex) / 8); PlaybackStartKeyFrame = ActiveKeyFrame; PlaybackEndKeyFrame = -1; DrawTimeline(); } else if (e.Y >= Height - 20) { ScrollbarSelected = true; } else if (ActiveTimelineEvent == null) { int MouseFrameHalf = (e.X - TimelineStartX + ScrollbarStartIndex + 4) / 8; int MouseEventFrame = (e.X - TimelineStartX + ScrollbarStartIndex) / 8; for (int i = vsbTimeline.Value, VisibleIndex = 0; i < TimelineActiveItems && VisibleIndex < TimelineVisibleItemCount; i++, VisibleIndex++) { if (e.Y < (VisibleIndex + 1) * 20 || e.Y >= (VisibleIndex + 2) * 20) { continue; } Timeline ActiveEvent = GetTimelineEvent(i); ActiveTimelineEvent = ActiveEvent; AnimationObjectKeyFrame ActiveAnimationObjectKeyFrame = null; if (MouseEventFrame == ActiveEvent.SpawnFrame) { TimelineResizeSide = TimelineResizeSides.Left; } else if (MouseFrameHalf == ActiveEvent.DeathFrame) { TimelineResizeSide = TimelineResizeSides.Right; } else if (ActiveEvent.TryGetValue(MouseEventFrame, out ActiveAnimationObjectKeyFrame)) { OnKeyFrameSelected(ActiveAnimationObjectKeyFrame); TimelineResizeSide = TimelineResizeSides.MoveKeyFrame; } else if (MouseEventFrame > ActiveEvent.SpawnFrame && MouseEventFrame < ActiveEvent.DeathFrame) { TimelineResizeSide = TimelineResizeSides.All; } } } } #endregion #region Right Button else if (e.Button == MouseButtons.Right) { Timeline ActiveEvent; if (e.X < TimelineStartX) { for (int i = vsbTimeline.Value, VisibleIndex = 0; i < TimelineActiveItems && VisibleIndex < TimelineVisibleItemCount; i++, VisibleIndex++) { ActiveEvent = GetTimelineEvent(i); if (e.Y < (VisibleIndex + 1) * 20 || e.Y >= (VisibleIndex + 2) * 20) { ActiveAnimation.ListSelectedObjects.Remove(ActiveEvent); continue; } ActiveAnimation.ListSelectedObjects.Add(ActiveEvent); ActiveTimelineEvent = ActiveEvent; } DrawTimeline(); } else { ActiveKeyFrame = (e.X - TimelineStartX + ScrollbarStartIndex) / 8; for (int i = vsbTimeline.Value, VisibleIndex = 0; i < TimelineActiveItems && VisibleIndex < TimelineVisibleItemCount; i++, VisibleIndex++) { if (e.Y < (VisibleIndex + 1) * 20 || e.Y >= (VisibleIndex + 2) * 20) { continue; } ActiveEvent = GetTimelineEvent(i); ActiveTimelineEvent = ActiveEvent; } } } #endregion }
public override void Add(int Index, AnimationObjectKeyFrame NewAnimationObjectKeyFrame) { }
public override bool TryGetValue(int Key, out AnimationObjectKeyFrame Value) { Value = null; return(false); }
public SFXKeyFrame(AnimationObjectKeyFrame Copy) { _SFX = new SFX(); }
public abstract bool TryGetValue(int Key, out AnimationObjectKeyFrame Value);
public abstract void Add(int Key, AnimationObjectKeyFrame NewAnimationObjectKeyFrame);