예제 #1
0
파일: Main.cs 프로젝트: pacxboy/g9impulse
        private void mnuOpen_Click(object sender, System.EventArgs e)
        {
            FolderBrowserDialog folderDlg = new FolderBrowserDialog();

            folderDlg.Description         = "Choose the project directory";
            folderDlg.ShowNewFolderButton = true;
            folderDlg.SelectedPath        = Application.StartupPath;

            if (folderDlg.ShowDialog() == DialogResult.OK)
            {
                LevelMeta meta;
                string    path = folderDlg.SelectedPath;
                try
                {
                    meta = new LevelMeta(path + "\\meta.gleu");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Failed to load level project:\n" + ex.Message,
                                    "GLEU Load Error",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    return;
                }

                _load(meta);
            }
            else
            {
                return;
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: pacxboy/g9impulse
 private void _load(LevelMeta meta)
 {
     _designerForm.LevelImage.ImagePath = meta.BackgroundFilename;
     _designerForm.LevelImage.View      =
         new Rectangle(0,
                       meta.Bounds.Low,
                       _designerForm.LevelImage.Width,
                       meta.Bounds.High - meta.Bounds.Low);
 }