コード例 #1
0
        public override MenuBasic Create()
        {
            this.NeedsInput = false;
            Ready           = true;

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

            return(base.Create());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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;
        }
コード例 #4
0
 void TimeLine(Button button)
 {
     MasterEditor.TimeLine();
 }
コード例 #5
0
 void RunProject(Button button)
 {
     MasterEditor.Run();
 }
コード例 #6
0
 void NewProject(Button button)
 {
     MasterEditor.CreateNewLevel();
 }