public static void Run(bool engineRunning, string initMapPath) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.CurrentCulture = CultureInfo.InvariantCulture; bool flag; using (new Mutex(true, Program.programGuid, out flag)) { if (!flag) { Win32.EnumWindows(new Win32.EnumWindowsProc(Program.OpenExistingAppCallback), IntPtr.Zero); } else { MainForm mainForm = new MainForm(); if (!engineRunning) { SplashForm.Start(); bool flag2 = Engine.Init(mainForm, mainForm.Viewport); SplashForm.Stop(); if (!flag2) { return; } } else { Engine.Reset(mainForm, mainForm.Viewport); } mainForm.Show(); mainForm.InitMapPath = initMapPath; mainForm.PostLoad(); Engine.Run(); if (!Engine.Reloading) { Engine.Close(); } } } }
private void UpdateStatusBar(MainForm.StatusBarMode mode) { if (mode == MainForm.StatusBarMode.None) { if (this.m_statusBarMode != MainForm.StatusBarMode.None) { this.statusCaption.Image = null; this.statusCaption.Text = Localizer.Localize("EDITOR_STATUS_READY"); this.statusCaption.BackColor = SystemColors.Control; this.statusCaption.ForeColor = SystemColors.ControlText; } } else { if (mode == MainForm.StatusBarMode.Loading) { if (this.m_statusBarMode != MainForm.StatusBarMode.Loading) { this.statusCaption.Image = Resources.hourglass; this.statusCaption.Text = Localizer.Localize("EDITOR_STATUS_LOADING"); this.statusCaption.BackColor = Color.LightCoral; this.statusCaption.ForeColor = Color.Black; } } else { if (mode == MainForm.StatusBarMode.Navmesh) { if (this.m_statusBarMode != MainForm.StatusBarMode.Navmesh) { this.statusCaption.Image = Resources.hourglass; } this.statusCaption.Text = string.Format("Generating {0} navmesh tiles...", Navmesh.PendingTilesCount); this.statusCaption.BackColor = Color.LightCoral; this.statusCaption.ForeColor = Color.Black; } else { if (mode == MainForm.StatusBarMode.Ingame && this.m_statusBarMode != MainForm.StatusBarMode.Ingame) { this.statusCaption.Image = null; this.statusCaption.Text = Localizer.Localize("EDITOR_STATUS_INGAME"); this.statusCaption.BackColor = Color.FromArgb(32, 32, 32); this.statusCaption.ForeColor = Color.GhostWhite; } } } } this.m_statusBarMode = mode; }
public MainForm() { MainForm.s_instance = this; this.InitializeComponent(); Win32.SetProp(base.Handle, Program.programGuid, base.Handle); Editor.PushInput(this); }