Beispiel #1
0
        public override MenuBasic Create()
        {
            this.NeedsInput = false;
            Ready           = true;

            masterEditor = new MasterEditor();
            masterEditor.Load();
            gameManager = new GameManager();

            return(base.Create());
        }
        public override MenuBasic Create()
        {
            this.NeedsInput = false;
            Ready           = true;
            LevelEditorWindow.EditorMode   = false;
            LevelEditorWindow.masterEditor = new MasterEditor();
            LevelEditorWindow.masterEditor.Load();
            LevelEditorWindow.gameManager = new GameManager();


            MasterEditor.LoadNewLevel(DialogManager.ReadFile(new BinaryReader(File.Open("Content/Game/Levels/" + SettingsHolder.map.ToString() + ".lvl", FileMode.Open))));
            GameManager.MyLevel.Reset();
            MasterEditor.Run();

            return(base.Create());
        }
        public void Load()
        {
            FileOpenLoad = true;


            Stream         MyStream;
            OpenFileDialog openFileDialog1;

            openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = "c:\\";
            openFileDialog1.Filter           = "Level files (*.lvl)|*.lvl";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;


            InUse = true;


            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                //try
                {
                    if ((MyStream = File.Open(openFileDialog1.FileName, FileMode.Open)) != null)
                    {
                        using (MyStream)
                        {
                            MasterEditor.LoadNewLevel(ReadFile(new BinaryReader(MyStream)));
                        }
                    }
                }
                //catch (Exception ex)
                {
                    //    MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
                }
            }
            InUse = false;
        }
 void TimeLine(Button button)
 {
     MasterEditor.TimeLine();
 }
 void RunProject(Button button)
 {
     MasterEditor.Run();
 }
 void NewProject(Button button)
 {
     MasterEditor.CreateNewLevel();
 }