private void btnOpen_Click(object sender, EventArgs e) { World world = null; OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "World File (*.wld)|*.wld"; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { world = LoadWorld(dialog.FileName); VectorID worldID = null; MapViewer areaView = null; Assets.Assets.Store.AddAsset(world); worldID = world.AssetID; areaView = new MapViewer(worldID); areaView.Name = "av" + worldID.ID; areaView.AreaNode = _root.Nodes.Add(world.Name); areaView.AreaNode.Tag = worldID; areaView.Dock = DockStyle.Fill; tabMain.TabPages.Add(worldID.ToString(), world.Name); tabMain.SelectedIndex = tabMain.TabPages.IndexOfKey(worldID.ToString()); tabMain.SelectedTab.Controls.Add(areaView); areaView.AreaPage = tabMain.SelectedTab; areaView.CellHover +=areaView_CellHover; _selected = world; } }
private void btnNewArea_Click(object sender, EventArgs e) { VectorID worldID = null; MapViewer areaView = null; worldID = Azmyth.Assets.Assets.CreateWorld(); areaView = new MapViewer(worldID); areaView.Name = "av" + worldID.ID; areaView.AreaNode = _root.Nodes.Add(Azmyth.Assets.Assets.Store[worldID].Name); areaView.AreaNode.Tag = worldID; areaView.Dock = DockStyle.Fill; tabMain.TabPages.Add(worldID.ToString(), Azmyth.Assets.Assets.Store[worldID].Name); tabMain.SelectedIndex = tabMain.TabPages.IndexOfKey(worldID.ToString()); tabMain.SelectedTab.Controls.Add(areaView); areaView.AreaPage = tabMain.SelectedTab; areaView.CellHover +=areaView_CellHover; _selected = Azmyth.Assets.Assets.Store[worldID]; }