Added: ReorderFrame

This commit is contained in:
quinnvoker
2018-12-29 07:11:27 -08:00
parent 748d772079
commit e2702bb932
3 changed files with 86 additions and 0 deletions
+14
View File
@@ -370,11 +370,14 @@ namespace AnimationEditor
{
if (frameListBox.SelectedIndices.Count == 1 && frameListBox.SelectedIndex < frames.Count - 1)
{
MoveListItem(frames, frameListBox, 1);
/*
var frameBelow = frames[frameListBox.SelectedIndex + 1];
frames[frameListBox.SelectedIndex + 1] = currentFrame;
frames[frameListBox.SelectedIndex] = frameBelow;
UpdateAnimation();
frameListBox_SetSingleSelection(frameListBox.SelectedIndex + 1);
*/
}
}
@@ -382,14 +385,25 @@ namespace AnimationEditor
{
if (frameListBox.SelectedIndices.Count == 1 && frameListBox.SelectedIndex > 0)
{
MoveListItem(frames, frameListBox, -1);
/*
var frameAbove = frames[frameListBox.SelectedIndex - 1];
frames[frameListBox.SelectedIndex - 1] = currentFrame;
frames[frameListBox.SelectedIndex] = frameAbove;
UpdateAnimation();
frameListBox_SetSingleSelection(frameListBox.SelectedIndex - 1);
*/
}
}
private void MoveListItem(BindingList<Frame> frameList, ListBox frameBox, int dir)
{
var mod = new ReorderFrame(frameList, frameBox, dir);
ModHelper.DoModificationWithSelectionTracking(mod, animationBox, frameListBox, frameSpriteListBox);
undoHistory.Add(mod);
UpdateAnimation();
}
private void removeFrameButton_Click(object sender, EventArgs e)
{
if(frameListBox.SelectedIndices.Count == 1 && frameListBox.SelectedIndex > -1 && frameListBox.SelectedIndex < frames.Count)