public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition)
        {
            List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>();

            DamageTimeline NewDamageTimeline = new DamageTimeline(Owner, ActiveAnimation.Content);

            NewDamageTimeline.Position   = new Vector2(535, 170);
            NewDamageTimeline.SpawnFrame = KeyFrame;
            NewDamageTimeline.DeathFrame = KeyFrame + 10;
            NewDamageTimeline.IsUsed     = true;//Disable the spawner as we spawn the Marker manually.
            NewDamageTimeline.Add(KeyFrame,
                                  new DamageKeyFrame(new Vector2(NewDamageTimeline.Position.X, NewDamageTimeline.Position.Y),
                                                     true, -1));

            ReturnValue.Add(NewDamageTimeline);

            return(ReturnValue);
        }
 protected override VisibleTimeline DoLoadCopy(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer)
 {
     return(new SceneObjectTimeline(BR, SceneObject));
 }
        protected override VisibleTimeline DoLoadCopy(BinaryReader BR, ContentManager Content, AnimationClass.AnimationLayer ActiveLayer)
        {
            DamageTimeline Copy = new DamageTimeline(BR, Content);

            Copy.Owner = Owner;
            return(Copy);
        }
        public AnimationClass.AnimationLayer GetAnimationLayer(int TargetIndex, ref int CurrentIndex, AnimationClass.AnimationLayer ActiveLayer, bool Remove, int Indent = 1)
        {
            AnimationClass.AnimationLayer TempLayer;

            for (int i = 0; i < ActiveLayer.ListChildren.Count; i++)
            {
                if (CurrentIndex == TargetIndex)
                {
                    AnimationLayersDragDropSelectedItemIndent = Indent;
                    if (Remove)
                    {
                        TempLayer = ActiveLayer.ListChildren[i];
                        ActiveLayer.ListChildren[i] = null;
                        return(TempLayer);
                    }
                    else
                    {
                        return(ActiveLayer.ListChildren[i]);
                    }
                }
                else
                {
                    CurrentIndex++;
                    TempLayer = GetAnimationLayer(TargetIndex, ref CurrentIndex, ActiveLayer.ListChildren[i], Remove, Indent + 1);
                    if (TempLayer != null)
                    {
                        return(TempLayer);
                    }
                }
            }
            return(null);
        }
        public bool InsertAnimationLayers(int TargetIndex, ref int CurrentIndex, AnimationClass.AnimationLayer ActiveGroup, AnimationClass.AnimationLayer ActiveEvent, bool InsertInGroup)
        {
            if (CurrentIndex == TargetIndex)
            {
                ActiveGroup.ListChildren.Insert(0, ActiveEvent);
                return(true);
            }

            CurrentIndex++;
            if (!ActiveGroup.ShowChildren)
            {
                return(false);
            }

            for (int i = 0; i < ActiveGroup.ListChildren.Count; i++)
            {
                if (ActiveGroup.ListChildren[i] == null)
                {
                    CurrentIndex++;
                    continue;
                }

                if (InsertInGroup && CurrentIndex == TargetIndex)
                {
                    ActiveGroup.ListChildren[i].ListChildren.Add(ActiveEvent);
                    return(true);
                }
                else if (InsertAnimationLayers(TargetIndex, ref CurrentIndex, ActiveGroup.ListChildren[i], ActiveEvent, InsertInGroup))
                {
                    return(true);
                }
            }
            return(false);
        }
        public void DrawLayer(ref int Index, int Indent, ref int VisibleIndex, AnimationClass.AnimationLayer ActiveEvent)
        {
            if (Index >= Owner.vsbAnimationLayer.Value)
            {
                int PosX = 1 + Indent * 5;
                int PosY = VisibleIndex * AnimationLayerItemHeight;

                if (ActiveEvent.IsSelected)
                {
                    panAnimationLayersGraphicDevice.Graphics.FillRectangle(Brushes.CornflowerBlue, new Rectangle(0, PosY, Owner.panAnimationLayers.Width - 10, 20));
                }

                if (ActiveEvent.IsVisible)
                {
                    panAnimationLayersGraphicDevice.Graphics.DrawImage(imgEyeOpen, PosX, PosY - 1);
                }
                else
                {
                    panAnimationLayersGraphicDevice.Graphics.DrawImage(imgEyeClosed, PosX, PosY - 1);
                }

                PosX += 22;

                if (ActiveEvent.ShowChildren)
                {
                    panAnimationLayersGraphicDevice.Graphics.DrawLine(Pens.Black, PosX, 10 + PosY, 5 + PosX, 10 + PosY);
                    panAnimationLayersGraphicDevice.Graphics.DrawLine(Pens.Black, PosX, 10 + PosY, 5 + PosX, 5 + PosY);
                    panAnimationLayersGraphicDevice.Graphics.DrawLine(Pens.Black, 5 + PosX, 5 + PosY, 5 + PosX, 10 + PosY);
                }
                else
                {
                    panAnimationLayersGraphicDevice.Graphics.DrawLine(Pens.Black, 1 + PosX, 2 + PosY, 5 + PosX, 6 + PosY);
                    panAnimationLayersGraphicDevice.Graphics.DrawLine(Pens.Black, 1 + PosX, 10 + PosY, 5 + PosX, 6 + PosY);
                    panAnimationLayersGraphicDevice.Graphics.DrawLine(Pens.Black, 1 + PosX, 2 + PosY, 1 + PosX, 10 + PosY);
                }

                PosX += 10;

                if (ActiveEvent.IsLocked)
                {
                    panAnimationLayersGraphicDevice.Graphics.DrawImage(imgLocked, PosX, PosY - 1);
                }
                else
                {
                    panAnimationLayersGraphicDevice.Graphics.DrawImage(imgUnlocked, PosX, PosY - 1);
                }

                PosX += 22;

                panAnimationLayersGraphicDevice.Graphics.DrawString(ActiveEvent.Name, fntListView, Brushes.Black, 10 + PosX, 4 + PosY);
                VisibleIndex++;
            }
            Index++;
            if (ActiveEvent.ShowChildren)
            {
                for (int L = 0; L < ActiveEvent.ListChildren.Count; L++)
                {
                    DrawLayer(ref Index, Indent + 1, ref VisibleIndex, ActiveEvent.ListChildren[L]);
                }
            }
        }
Ejemplo n.º 7
0
        public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition)
        {
            List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>();

            return(ReturnValue);
        }
Ejemplo n.º 8
0
 protected override VisibleTimeline DoLoadCopy(BinaryReader BR, ContentManager Content, AnimationClass.AnimationLayer ActiveLayer)
 {
     return(new MagicTimeline());
 }
Ejemplo n.º 9
0
            protected override VisibleAnimationObjectKeyFrame CopyAsVisibleAnimationObjectKeyFrame(AnimationClass.AnimationLayer ActiveLayer)
            {
                ENKeyFrame NewAnimatedBitmapKeyFrame = new ENKeyFrame();

                NewAnimatedBitmapKeyFrame.UpdateFrom(this);
                NewAnimatedBitmapKeyFrame._EN = _EN;

                return(NewAnimatedBitmapKeyFrame);
            }
Ejemplo n.º 10
0
        public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition)
        {
            List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>();

            Vector2[] LocalPoints = new Vector2[4]
            {
                new Vector2(MousePosition.X - 40, MousePosition.Y - 40),
                new Vector2(MousePosition.X - 40, MousePosition.Y + 40),
                new Vector2(MousePosition.X + 40, MousePosition.Y + 40),
                new Vector2(MousePosition.X + 40, MousePosition.Y - 40),
            };

            List <Polygon>      ListPolygon      = new List <Polygon>();
            DamageBoxTimeline   NewMeleeTimeline = new DamageBoxTimeline();
            PolygonCutterHelper NewSpawner       = new PolygonCutterHelper(ActiveLayer.renderTarget, ListPolygon, true);

            Polygon NewPolygon = new Polygon(LocalPoints, GameScreen.GraphicsDevice.Viewport.Width, GameScreen.GraphicsDevice.Viewport.Height);

            NewSpawner.PolygonCutterViewer.ListPolygon.Add(NewPolygon);

            if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                NewMeleeTimeline.SpawnFrame = KeyFrame;
                NewMeleeTimeline.DeathFrame = KeyFrame + 10;
                NewMeleeTimeline.IsUsed     = true;//Disable the spawner as we spawn the Marker manually.

                Vector2[] NewArrayVertex = new Vector2[NewSpawner.PolygonCutterViewer.ListPolygon[0].ArrayVertex.Length];
                Array.Copy(NewSpawner.PolygonCutterViewer.ListPolygon[0].ArrayVertex, NewArrayVertex, NewSpawner.PolygonCutterViewer.ListPolygon[0].ArrayVertex.Length);

                VisibleAnimationObjectKeyFrame NewPolygonCutterKeyFrame = new VisibleAnimationObjectKeyFrame(NewMeleeTimeline.Position,
                                                                                                             true, -1);

                Polygon NewKeyFramePolygon = new Polygon(NewArrayVertex, ActiveLayer.renderTarget.Width, ActiveLayer.renderTarget.Height);

                NewMeleeTimeline.Add(KeyFrame, NewPolygonCutterKeyFrame);
                NewMeleeTimeline.ListCollisionPolygon.Add(NewKeyFramePolygon);
                NewMeleeTimeline.ListOriginalPolygon.Add(new Polygon(NewKeyFramePolygon));
                NewKeyFramePolygon.UpdateWorldPosition(Vector2.Zero, 0f);

                NewMeleeTimeline.ComputeSourceRectangle();
                ReturnValue.Add(NewMeleeTimeline);
            }

            return(ReturnValue);
        }