//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; } }
void MainForm_Activated(object sender, EventArgs e) { Focused = true; if (!IDEConfig.IsDefaultEditor) { FileManager.ReloadCode(); LivePreview.Reload(); } }
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; }
private void MainForm_Load(object sender, EventArgs e) { LivePreview.ShowDebug(false); }
private void toggleDebugToolStripMenuItem_Click(object sender, EventArgs e) { toggleDebugToolStripMenuItem.Text = LivePreview.ConsoleOpen ? "Show debug" : "Hide debug"; LivePreview.ConsoleOpen = !LivePreview.ConsoleOpen; LivePreview.ShowDebug(LivePreview.ConsoleOpen); }
private void reloadToolStripMenuItem_Click(object sender, EventArgs e) { LivePreview.Reload(); }