示例#1
0
        //Form closing event
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Quit confirmation due to Unsaved Changes
            bool run = false;

            if (FileManager.UnsavedChanges)
            {
                SystemSounds.Exclamation.Play();
                DialogResult _res = MessageBox.Show("Save changes to the project?", "JSGameIDE", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
                if (_res == DialogResult.Yes)
                {
                    FileManager.Save(true);
                }
                run = _res == DialogResult.Yes || _res == DialogResult.No;
            }
            else
            {
                run = true;
            }
            if (run)
            {
                FileManager.UnsavedChanges = false;
                LivePreview.Shutdown();
                Application.Exit();
            }
            else
            {
                e.Cancel = true;
            }
        }
示例#2
0
 void MainForm_Activated(object sender, EventArgs e)
 {
     Focused = true;
     if (!IDEConfig.IsDefaultEditor)
     {
         FileManager.ReloadCode();
         LivePreview.Reload();
     }
 }
示例#3
0
 public MainForm()
 {
     //Updates this form reference on the File Manager
     FileManager.mainForm = this;
     InitializeComponent();
     LivePreview.Init(this, livePreview, developerTab, tableLayoutPanel1);
     this.KeyPreview  = true;
     this.Activated  += MainForm_Activated;
     this.Deactivate += MainForm_Deactivated;
 }
示例#4
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     LivePreview.ShowDebug(false);
 }
示例#5
0
 private void toggleDebugToolStripMenuItem_Click(object sender, EventArgs e)
 {
     toggleDebugToolStripMenuItem.Text = LivePreview.ConsoleOpen ? "Show debug" : "Hide debug";
     LivePreview.ConsoleOpen           = !LivePreview.ConsoleOpen;
     LivePreview.ShowDebug(LivePreview.ConsoleOpen);
 }
示例#6
0
 private void reloadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     LivePreview.Reload();
 }