private void OnLayerProperties(object sender, EventArgs eventArgs) { if (m_selectedComponent == null || !(m_selectedComponent is Layer)) return; Layer layer = (Layer)m_selectedComponent; LayerPropertiesDialog layerPropertiesDialog = new LayerPropertiesDialog(layer, false); if (layerPropertiesDialog.ShowDialog(this) == DialogResult.OK) { m_mapTreeView.UpdateTree(); m_needsSaving = true; UpdateFileControls(); UpdateEditControls(); UpdateLayerControls(); } }
private void OnLayerNew(object sender, EventArgs eventArgs) { Size tileSize = m_map.TileSheets.Count > 0 ? m_map.TileSheets[0].TileSize : new Size(8, 8); Layer layer = new Layer("untitled layer", m_map, new Size(100, 25), tileSize); LayerPropertiesDialog layerPropertiesDialog = new LayerPropertiesDialog(layer, true); if (layerPropertiesDialog.ShowDialog(this) == DialogResult.Cancel) return; m_mapPanel.Enabled = true; m_mapTreeView.UpdateTree(); m_mapTreeView.SelectedComponent = layer; m_needsSaving = true; UpdateFileControls(); UpdateEditControls(); UpdateLayerControls(); m_mapPanel.SelectedLayer = layer; }