Ejemplo n.º 1
0
        public void Update(float elapsedSeconds, bool allowMouseUpdate)
        {
            if (!allowMouseUpdate)
            {
                return;
            }

            ScrollViewer.UpdateInput(MainScreen.Input, elapsedSeconds, true);

            if (Rect.Contains(MainScreen.Input.MousePositionPoint))
            {
                // MainScreen.Input.CursorType = MouseCursorType.Arrow;

                if (MainScreen.Input.LeftClickDown)
                {
                    var mouseCheckPoint = new Point(
                        (int)(MainScreen.Input.MousePosition.X - Rect.X + ScrollViewer.Scroll.X),
                        (int)(MainScreen.Input.MousePosition.Y - Rect.Y + ScrollViewer.Scroll.Y));

                    float offset = 0;
                    foreach (var taeSection in AnimTaeSections.Values)
                    {
                        var thisGroupRect = new Rectangle(0, (int)offset, ScrollViewer.Viewport.Width, AnimSectionHeaderHeight);

                        if (thisGroupRect.Contains(mouseCheckPoint))
                        {
                            taeSection.Collapsed = !taeSection.Collapsed;
                        }

                        offset += AnimSectionHeaderHeight; //Section Header

                        if (taeSection.Collapsed)
                        {
                            continue;
                        }

                        float groupStartOffset = offset;
                        foreach (var anim in taeSection.InfoMap)
                        {
                            var thisAnimRect = new Rectangle(0, (int)(groupStartOffset + anim.Value.VerticalOffset),
                                                             ScrollViewer.Viewport.Width, AnimHeight);
                            if (thisAnimRect.Contains(mouseCheckPoint))
                            {
                                MainScreen.Graph?.ViewportInteractor?.CancelCombo();
                                MainScreen.SelectNewAnimRef(taeSection.Tae, anim.Value.Ref);
                            }
                            offset += AnimHeight;
                        }
                    }
                }
            }

            if (MainScreen.Input.KeyDown(Microsoft.Xna.Framework.Input.Keys.Insert))
            {
                MainScreen.AddNewAnimation();
            }
        }
Ejemplo n.º 2
0
 public void GoThere(TaeEditorScreen editor)
 {
     editor.SelectNewAnimRef(TAERef, AnimRef);
     editor.SelectEvent(EventRef);
 }