예제 #1
0
        private void Monsters_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!this.Modified && !battleScriptsEditor.Modified)
            {
                if (hackingToolsWindow.Visible)
                {
                    hackingToolsWindow.Close();
                }
                return;
            }
            DialogResult result = MessageBox.Show(
                "Monsters and battlescripts have not been saved.\n\nWould you like to save changes?", "LAZY SHELL",
                MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                Assemble();
                battleScriptsEditor.Assemble();
                battleScriptsEditor.Close();
                if (hackingToolsWindow.Visible)
                {
                    hackingToolsWindow.Close();
                }
                if (previewer != null)
                {
                    previewer.Close();
                }
            }
            else if (result == DialogResult.No)
            {
                Model.Monsters      = null;
                Model.MonsterNames  = null;
                Model.BattleScripts = null;
                battleScriptsEditor.Close();
                if (hackingToolsWindow.Visible)
                {
                    hackingToolsWindow.Close();
                }
                if (previewer != null)
                {
                    previewer.Close();
                }
                return;
            }
            else if (result == DialogResult.Cancel)
            {
                e.Cancel = true;
                return;
            }
        }
예제 #2
0
 public void CloseEditors()
 {
     if (spritePaletteEditor.Visible)
     {
         spritePaletteEditor.Close();
     }
     if (spriteGraphicEditor.Visible)
     {
         spriteGraphicEditor.Close();
     }
     if (stageGraphicEditor.Visible)
     {
         stageGraphicEditor.Close();
     }
     if (stagePaletteEditor.Visible)
     {
         stagePaletteEditor.Close();
     }
     spritePaletteEditor.Dispose();
     spriteGraphicEditor.Dispose();
     stageGraphicEditor.Dispose();
     stagePaletteEditor.Dispose();
     if (previewer != null)
     {
         previewer.Close();
     }
 }