Exemplo n.º 1
0
        private void mnuEngineSettings_Click(object sender, EventArgs e)
        {
            //If the server is running, don't allow editing of the Engine Settings.
            //This can cause instability and corruption.
            if (Editor.Game.Server.Enabled)
            {
                MessageBox.Show("You can not change settings while the server is running!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //Create a instance of the Engine Settings editor
            FrmEngineSettings engineSettings = new FrmEngineSettings();

            //Show it as a dialog. This prevents other editors from starting at the same time.
            //Ensures that the static Editor Type will only be accessed by one editor at a time.
            engineSettings.ShowDialog();

            //While the editor is visible, just keep the App responsive.
            while (engineSettings.Visible)
            {
                Application.DoEvents();
            }

            //Null the reference we have.
            engineSettings = null;

            //Refresh the UI in the event the Game or Server types were changed.
            RefreshUI();
        }
Exemplo n.º 2
0
        private void mnuEngineSettings_Click(object sender, EventArgs e)
        {
            //If the server is running, don't allow editing of the Engine Settings.
            //This can cause instability and corruption.
            if (Editor.Game.Server.Enabled)
            {
                MessageBox.Show("You can not change settings while the server is running!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //Create a instance of the Engine Settings editor
            FrmEngineSettings engineSettings = new FrmEngineSettings();

            //Show it as a dialog. This prevents other editors from starting at the same time.
            //Ensures that the static Editor Type will only be accessed by one editor at a time.
            engineSettings.ShowDialog();

            //While the editor is visible, just keep the App responsive.
            while (engineSettings.Visible)
            {
                Application.DoEvents();
            }

            //Null the reference we have.
            engineSettings = null;

            //Refresh the UI in the event the Game or Server types were changed.
            RefreshUI();
        }