private void AddBuild_Click(object sender, EventArgs e) { if (Session.Tiles.Count == 0) { string msg = "You have no libraries containing map tiles."; msg += Environment.NewLine; msg += "Map tiles are required for map building."; MessageBox.Show(msg, "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Map m = new Map(); m.Name = "New Map"; MapBuilderForm dlg = new MapBuilderForm(m, false); if (dlg.ShowDialog() == DialogResult.OK) { Session.Project.Maps.Add(dlg.Map); Session.Modified = true; update_maps(); update_thumbnail(); SelectedMap = dlg.Map; } }
private void EditBtn_Click(object sender, EventArgs e) { if (this.SelectedMap != null) { int map = Session.Project.Maps.IndexOf(this.SelectedMap); MapBuilderForm mapBuilderForm = new MapBuilderForm(this.SelectedMap, false); if (mapBuilderForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Session.Project.Maps[map] = mapBuilderForm.Map; Session.Modified = true; this.update_maps(); this.update_thumbnail(); this.SelectedMap = mapBuilderForm.Map; } } }
private void NewBtn_Click(object sender, EventArgs e) { Masterplan.Data.Map map = new Masterplan.Data.Map() { Name = "New Map" }; MapBuilderForm mapBuilderForm = new MapBuilderForm(map, false); if (mapBuilderForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Session.Project.Maps.Add(mapBuilderForm.Map); Session.Modified = true; this.MapBox.Items.Add(mapBuilderForm.Map); this.MapBox.SelectedItem = mapBuilderForm.Map; } }
private void NewBtn_Click(object sender, EventArgs e) { Map m = new Map(); m.Name = "New Map"; MapBuilderForm dlg = new MapBuilderForm(m, false); if (dlg.ShowDialog() == DialogResult.OK) { Session.Project.Maps.Add(dlg.Map); Session.Modified = true; MapBox.Items.Add(dlg.Map); MapBox.SelectedItem = dlg.Map; } }
private void EditBtn_Click(object sender, EventArgs e) { if (SelectedMap != null) { int index = Session.Project.Maps.IndexOf(SelectedMap); MapBuilderForm dlg = new MapBuilderForm(SelectedMap, false); if (dlg.ShowDialog() == DialogResult.OK) { Session.Project.Maps[index] = dlg.Map; Session.Modified = true; update_maps(); update_thumbnail(); SelectedMap = dlg.Map; } } }
private void AddBuild_Click(object sender, EventArgs e) { if (Session.Tiles.Count == 0) { string str = string.Concat("You have no libraries containing map tiles.", Environment.NewLine); str = string.Concat(str, "Map tiles are required for map building."); MessageBox.Show(str, "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } Map map = new Map() { Name = "New Map" }; MapBuilderForm mapBuilderForm = new MapBuilderForm(map, false); if (mapBuilderForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Session.Project.Maps.Add(mapBuilderForm.Map); Session.Modified = true; this.update_maps(); this.update_thumbnail(); this.SelectedMap = mapBuilderForm.Map; } }