示例#1
0
        private void BtnAddAnimationClick(object sender, EventArgs e)
        {
            if (this.selectedActor != null)
            {
                var dynActor   = (DynamicActor)this.selectedActor;
                var animations = Enum.GetValues(typeof(Animation)).Cast <Animation>().ToList();
                if (dynActor.Animations != null)
                {
                    foreach (var animation in dynActor.Animations)
                    {
                        animations.Remove(animation.Key);
                    }
                }

                if (animations.Count > 0)
                {
                    var dialog = new AddAnimationDialog(animations);
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        Animation animation = dialog.GetAnimation();
                        int       length    = dialog.GetLength();
                        if (dynActor.Animations == null)
                        {
                            dynActor.Animations = new Dictionary <Animation, int>();
                        }

                        dynActor.Animations.Add(animation, length);
                        this.selectedActor = dynActor;
                        this.listAnimations.Items.Add(new ListViewItem(new[] { animation.ToString(), length.ToString() }));
                    }
                }
            }
        }
示例#2
0
 private void ListLevelsSelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.listLevels.SelectedItems.Count == 1)
     {
         this.categorySelected = CategoryEnum.Level;
         this.actorSelected    = Actors.StaticActors.Select(x => x.Value).FirstOrDefault(y => y.Name == this.listLevels.SelectedItems[0].Text);
     }
 }
示例#3
0
 private void BtnRemoveLevelClick(object sender, EventArgs e)
 {
     if (this.listLevels.SelectedItems.Count == 1)
     {
         MapEditor.Actors.StaticActors.Remove(this.listLevels.SelectedItems[0].Text);
         this.listLevels.Items.Remove(this.listLevels.SelectedItems[0]);
         this.selectedActor = null;
         this.ClearActorProperties();
     }
 }
示例#4
0
 private void ListLevelsSelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.listLevels.SelectedItems.Count == 1)
     {
         this.selectedActor = MapEditor.Actors.StaticActors[this.listLevels.SelectedItems[0].Text];
         this.FillActorProperties();
     }
     else
     {
         this.selectedActor = null;
         this.ClearActorProperties();
     }
 }