private void TerminateGame(object sender, EventArgs e) { this.RecheckMenuEligibility(); if (!this.m_GameTerminateMenuItem.Enabled || this.m_ActiveGame == null) return; this.m_ActiveGame.Dispose(); this.m_ActiveGame = null; OgmoEditor.Ogmo.MainWindow.StatusText = "The game has been terminated forcefully."; }
private void TimerCallback(object sender, EventArgs e) { if (this.m_ActiveGame != null) { IDataProxy proxy = this.m_ActiveGame.Proxy; // Check if the game has exited. if (proxy.Loaded) { // game is finished. OgmoEditor.Ogmo.MainWindow.StatusText = "The game has exited."; this.m_ActiveGame.Dispose(); this.m_ActiveGame = null; this.m_DebugWindow.EditorVisible = false; this.RecheckMenuEligibility(); return; } // Update the focused object for the debugging window if needed. this.m_DebugWindow.FocusedObject = proxy.FocusedObject; } this.m_DebugWindow.EditorVisible = Ogmo.LayersWindow.EditorVisible && this.m_ActiveGame != null; this.RecheckMenuEligibility(); }
private void RunGame(object sender, EventArgs e) { this.RecheckMenuEligibility(); if (!this.m_GameMenuItem.Enabled) return; // Get data proxy. if (!this.m_Level.Save()) return; this.m_ActiveGame = this.LoadGame(this.m_Project.CustomPluginEntries["ProtogamePath"], "run", this.m_Level.SavePath); OgmoEditor.Ogmo.MainWindow.StatusText = "The game is now running."; }