Example #1
0
        private void ModelViewerStart_Click(object sender, EventArgs e)
        {
            if (GameRunning)
            {
                if (Root.Instance.CurrentFlow is SpaceWar2006.Flows.Viewer)
                {
                    FileSystemNode n1 = (FileSystemNode)ModelList.SelectedItems[0].Tag;
                    ((SpaceWar2006.Flows.Viewer)Root.Instance.CurrentFlow).ChangeMesh(n1.GetFullPath());
                }
                else
                {
                    MessageBox.Show(this, "Stop the current game first.", "<°)))><", MessageBoxButtons.AbortRetryIgnore);
                }
                return;
            }

            GameRunning = true;

            Root r = Root.Instance;

            r.Authoritive = true;

            ViewerForm vf = new ViewerForm();

            vf.Show();
            r.ClientClient(new string[] { }, vf.glControl1);

            //r.ClientClient(new string[] { });
            IUserInterface ui = r.UserInterface;

            FileSystemNode n = (FileSystemNode)ModelList.SelectedItems[0].Tag;

            SpaceWar2006.Flows.Viewer v = new SpaceWar2006.Flows.Viewer(n.GetFullPath());
            Root.Instance.CurrentFlow = v;
            v.Start();
            r.CurrentFlow = v;



            v.Start();

            r.ClientLoop();

            //Cheetah.Root.Instance.LocalObjects.Remove(h);

            r.ResourceManager.UnloadAll();
            r.UserInterface.Dispose();
            r.UserInterface = null;
            vf.Close();

            GameRunning = false;
        }
Example #2
0
        private void ModelViewerStart_Click(object sender, EventArgs e)
        {
            if (GameRunning)
            {
                if (Root.Instance.CurrentFlow is SpaceWar2006.Flows.Viewer)
                {
                    FileSystemNode n1 = (FileSystemNode)ModelList.SelectedItems[0].Tag;
                    ((SpaceWar2006.Flows.Viewer)Root.Instance.CurrentFlow).ChangeMesh(n1.GetFullPath());
                }
                else
                {
                    MessageBox.Show(this, "Stop the current game first.", "<°)))><", MessageBoxButtons.AbortRetryIgnore);
                }
                return;
            }

            GameRunning = true;

            Root r = Root.Instance;

            r.Authoritive = true;

            ViewerForm vf = new ViewerForm();
            vf.Show();
            r.ClientClient(new string[] { }, vf.glControl1);

            //r.ClientClient(new string[] { });
            IUserInterface ui = r.UserInterface;

            FileSystemNode n = (FileSystemNode)ModelList.SelectedItems[0].Tag;

            SpaceWar2006.Flows.Viewer v = new SpaceWar2006.Flows.Viewer(n.GetFullPath());
            Root.Instance.CurrentFlow = v;
            v.Start();
            r.CurrentFlow = v;

            v.Start();

            r.ClientLoop();

            //Cheetah.Root.Instance.LocalObjects.Remove(h);

            r.ResourceManager.UnloadAll();
            r.UserInterface.Dispose();
            r.UserInterface = null;
            vf.Close();

            GameRunning = false;
        }