static public void RealmChecks(ref TextBox textbox, ref ToolStripProgressBar ProgressBar) { if (!Directory.Exists((string)Settings.Global.Properties["POLPath"] + @"\realm")) { textbox.AppendText("* Fail: Realms have not been generated." + Environment.NewLine); } else { string[] tmp = FileSystemUtil.GetAllFileNames((string)Settings.Global.Properties["POLPath"] + @"\realm", "*.*"); if (tmp.Length > 1) { textbox.AppendText("* Pass: Realm folder detected." + Environment.NewLine); } else { textbox.AppendText("* Fail: Realm folder is empty." + Environment.NewLine); } } ProgressBar.PerformStep(); foreach (string s in PL_UOConvert.GetConfigFileNames()) { if (File.Exists((string)Settings.Global.Properties["POLPath"] + @"\" + s)) { textbox.AppendText("* Pass: Found config file '" + s + "'." + Environment.NewLine); } else { textbox.AppendText("* Fail: Config file '" + s + "' not found." + Environment.NewLine); } ProgressBar.PerformStep(); } }
void UOCConsole_Exited(object sender, EventArgs e) { ((MyConsole)sender).Dispose(); Process_UOConvert = null; if (this.InvokeRequired) { this.Invoke((MethodInvoker) delegate() { TB_UOCOutput.Text += UOConvertOutput + System.Environment.NewLine + System.Environment.NewLine; }); } else { TB_UOCOutput.Text += UOConvertOutput + System.Environment.NewLine + System.Environment.NewLine; } if (File.Exists(Settings.Global.Properties["POLPath"] + @"\multis.cfg")) { PL_UOConvert.MoveConfigFile(Settings.Global.Properties["POLPath"] + @"\multis.cfg", Settings.Global.Properties["POLPath"] + "\\config\\multis.cfg"); } if (File.Exists(Settings.Global.Properties["POLPath"] + @"\landtiles.cfg")) { PL_UOConvert.MoveConfigFile(Settings.Global.Properties["POLPath"] + @"\landtiles.cfg", Settings.Global.Properties["POLPath"] + "\\config\\landtiles.cfg"); } if (File.Exists(Settings.Global.Properties["POLPath"] + @"\tiles.cfg")) { PL_UOConvert.MoveConfigFile(Settings.Global.Properties["POLPath"] + @"\tiles.cfg", Settings.Global.Properties["POLPath"] + "\\config\\tiles.cfg"); } if (this.InvokeRequired) { this.Invoke((MethodInvoker) delegate() { ProgressBar.PerformStep(); }); } else { ProgressBar.PerformStep(); } if (PL_UOConvert.BuildList.Count != 0) { PL_UOConvert.BuildList.RemoveAt(0); if (PL_UOConvert.BuildList.Count != 0) { RunUOConvert(); } else { if (this.InvokeRequired) { BTN_UOConvert.Invoke((MethodInvoker) delegate() { BTN_UOConvert.Enabled = true; }); this.Invoke((MethodInvoker) delegate() { ProgressBar.Value = 0; }); this.Invoke((MethodInvoker) delegate() { ProgressBar.Visible = false; }); this.Invoke((MethodInvoker) delegate() { Cursor = Cursors.Default; }); } else { BTN_UOConvert.Enabled = true; ProgressBar.Value = 0; ProgressBar.Visible = false; Cursor = Cursors.Default; } MessageBox.Show("Conversion has completed! See text box for details about the conversion process."); } } else { if (this.InvokeRequired) { BTN_UOConvert.Invoke((MethodInvoker) delegate() { BTN_UOConvert.Enabled = true; }); this.Invoke((MethodInvoker) delegate() { ProgressBar.Value = 0; }); this.Invoke((MethodInvoker) delegate() { ProgressBar.Visible = false; }); this.Invoke((MethodInvoker) delegate() { Cursor = Cursors.Default; }); } else { BTN_UOConvert.Enabled = true; ProgressBar.Value = 0; ProgressBar.Visible = false; Cursor = Cursors.Default; } MessageBox.Show("Conversion has completed! See text box for details about the conversion process."); } }