コード例 #1
0
        private void onQuickImportFromFolderClicked(object sender, EventArgs e)
        {
            Sprite chosen = SpriteChooser.ShowSpriteChooser(_LastSelectedSprite, "Select the first sprite to be imported from the folder");

            if (chosen != null)
            {
                SpriteFolder parent = Factory.AGSEditor.CurrentGame.RootSpriteFolder.FindFolderThatContainsSprite(chosen.Number);
                if (parent != null)
                {
                    for (int i = 0; i < parent.Sprites.Count; i++)
                    {
                        if (parent.Sprites[i].Number >= chosen.Number)
                        {
                            _loop.Frames.Add(new ViewFrame
                            {
                                ID    = _loop.Frames.Count,
                                Image = parent.Sprites[i].Number,
                            });
                        }
                    }

                    UpdateControlWidth();
                    this.Invalidate();
                }
            }
        }
コード例 #2
0
 public void DoubleClick(RoomEditorState state)
 {
     if (_lastSelectedObject != null)
     {
         Sprite chosenSprite = SpriteChooser.ShowSpriteChooser(_lastSelectedObject.Image);
         if (chosenSprite != null)
         {
             _lastSelectedObject.Image = chosenSprite.Number;
         }
     }
 }
コード例 #3
0
 public bool DoubleClick(RoomEditorState state)
 {
     if (_lastSelectedObject != null)
     {
         Sprite chosenSprite = SpriteChooser.ShowSpriteChooser(_lastSelectedObject.Image);
         if (chosenSprite != null)
         {
             _lastSelectedObject.Image = chosenSprite.Number;
         }
         return(true);
     }
     return(false);
 }
コード例 #4
0
 public bool DoubleClick(RoomEditorState state)
 {
     if (_lastSelectedObject != null)
     {
         Sprite chosenSprite = SpriteChooser.ShowSpriteChooser(_lastSelectedObject.Image);
         if (chosenSprite != null && chosenSprite.Number != _lastSelectedObject.Image)
         {
             _lastSelectedObject.Image = chosenSprite.Number;
             _room.Modified = true;
         }
         return true;
     }
     return false;
 }
コード例 #5
0
        private void ViewLoopEditor_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int clickedFrame = GetFrameAtLocation(e.X, e.Y);

            if (clickedFrame >= 0)
            {
                int initialSprite = _loop.Frames[clickedFrame].Image;
                if ((initialSprite == 0) && (clickedFrame > 0))
                {
                    initialSprite = _loop.Frames[clickedFrame - 1].Image;
                }
                if (initialSprite == 0)
                {
                    initialSprite = _LastSelectedSprite;
                }

                Sprite chosen = SpriteChooser.ShowSpriteChooser(initialSprite);
                if (chosen != null)
                {
                    _loop.Frames[clickedFrame].Image = chosen.Number;
                    _LastSelectedSprite = chosen.Number;
                }
            }
        }