Example #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            using (ComposedForm composed = new ComposedForm("Select name and direction",
                ComposedForm.Parts.Name | ComposedForm.Parts.Direction,
                ComposedForm.Parts.Name)) {
                foreach (string groupName in groups.Keys) {
                    composed.AddNameChecker(s => s.Trim() != groupName.Split('.')[0]);
                }
                composed.AddNameChecker(s => !s.Contains("."));
                if (composed.ShowDialog(this) == DialogResult.OK) {

                    using (AnimationSelector selector = new AnimationSelector(CurrentSheet, project)) {
                        if (selector.ShowDialog(this) == DialogResult.OK) {
                            string name = composed.GetName();
                            if (composed.GetDirection() == "") {
                                AddAnimationGroup(name + ".down", selector.SelectedFrames);
                                AddAnimationGroup(name + ".left", selector.SelectedFrames);
                                AddAnimationGroup(name + ".right", selector.SelectedFrames);
                                AddAnimationGroup(name + ".up", selector.SelectedFrames);
                            }
                            else {
                                AddAnimationGroup(name + "." + composed.GetDirection(), selector.SelectedFrames);
                            }
                        }
                    }
                }
            }
        }
Example #2
0
 //TODO: Ability to change name/direction
 private void groupsListBox_DoubleClick(object sender, EventArgs e)
 {
     if (groupsListBox.SelectedIndex == -1) return;
     Animation.Group anim = ((KeyValuePair<string, Animation.Group>)groupsListBox.SelectedItem).Value;
     using (AnimationSelector selector = new AnimationSelector(anim, CurrentSheet, project)) {
         if (selector.ShowDialog(this) == DialogResult.OK) {
             anim.frames = new List<Animation.Frame>(selector.SelectedFrames);
         }
     }
 }