Exemple #1
0
		public static void Main(string[] args)
		{
			Application.EnableVisualStyles();

			Editor editor;

			if (args.Length > 0)
				editor = new Editor(args[0]);
			else
				editor = new Editor();

			editor.Show();
			Application.Run();
		}
Exemple #2
0
		private void openTerrain(object sender, EventArgs e)
		{
			OpenFileDialog dialog = new OpenFileDialog();
			dialog.Filter = terrainFileFilter;
			dialog.InitialDirectory = Properties.Settings.Default.OpenFileInitialDirectory;
			if (dialog.ShowDialog() == DialogResult.OK)
			{
				if (this.terrain == null)
				{
					try
					{
						this.terrain = Terrain.Read(dialog.FileName);
					}
					catch (Exception bug)
					{
						MessageBox.Show(bug.ToString(), "Failed to load terrain.");
					}

					if (this.terrain != null)
					{
						this.currentFile = new FileInfo(dialog.FileName);
						Properties.Settings.Default.OpenFileInitialDirectory = this.currentFile.DirectoryName;

						this.initialize();
					}
				}
				else
				{
					Editor editor = new Editor(dialog.FileName);
					editor.Show();
				}
			}
		}
Exemple #3
0
		private void newTerrain(object sender, EventArgs e)
		{
			SizeDialog dialog = new SizeDialog();
			if (dialog.ShowDialog() == DialogResult.OK)
			{
				Editor editor = new Editor(new Terrain(dialog.SelectedSize, dialog.SelectedSize));
				this.Close();
				editor.Show();
			}
		}