Exemplo n.º 1
0
 private void btn_Edit_Click(object sender, EventArgs e)
 {
     if (listBox_Animations.SelectedItem == null)
     {
         MessageBox.Show("Must have an animation selected", "No Animation Selected", MessageBoxButtons.OK);
         return;
     }
     Animation animation = Game.gameGraphics.GetAnimation(SelectedAnimation);
     EditAnimationWindow animationWindow = new EditAnimationWindow(binaryTextures, Game.gameGraphics.GetDrawnNames(), animation);
     switch (animationWindow.ShowDialog())
     {
         case DialogResult.OK:
             if (string.IsNullOrEmpty(SelectedAnimation)) return;
             if (SelectedAnimation == animationWindow.ReturnAnimation.Name)
             {
                 listBox_Animations.SelectedItem = null;
                 Game.gameGraphics.ClearDrawList();
             }
             Game.gameGraphics.SetDrawable(animationWindow.ReturnAnimation);
             Game.gameGraphics.SetLoadedDrawn(animationWindow.ReturnAnimation, animationWindow.ReturnAnimation.Name);
             fileChanged = true;
             break;
         case DialogResult.Cancel:
             return;
     }
 }
Exemplo n.º 2
0
 private void btn_NewAnimation_Click(object sender, EventArgs e)
 {
     EditAnimationWindow animationWindow = new EditAnimationWindow(binaryTextures,Game.gameGraphics.GetDrawnNames());
     switch (animationWindow.ShowDialog())
     {
         case DialogResult.OK:
             Game.gameGraphics.AddDrawable(animationWindow.ReturnAnimation);
             listBox_Animations.Items.Add(animationWindow.ReturnAnimation.Name);
             fileChanged = true;
             break;
         case DialogResult.Cancel:
             return;
     }
 }