Ejemplo n.º 1
0
        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.";
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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.";
        }