private void button_AddLayer_Click(object sender, EventArgs e)
 {
     if (mapViewer.CurrentMap == null)
     {
         MessageBox.Show("You cannot add a layer without generating a map first!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         Dialogs.dlgNewLayer dlgNewLayer = new Dialogs.dlgNewLayer(Dialogs.dlgNewLayer.NewType.Layer);
         if (dlgNewLayer.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             mapViewer.CurrentMap.AddLayer(dlgNewLayer.Label, dlgNewLayer.MapWidth, dlgNewLayer.MapHeight, dlgNewLayer.ParaVert, dlgNewLayer.ParaHorz);
             refreshLayersDisplay();
         }
     }
 }
        private void button_EditLayer_Click(object sender, EventArgs e)
        {
            //Baselayer nicht!
            if (listBox_Layers.SelectedIndex != 0)
            {
                Dialogs.dlgNewLayer dlgNewLayer = new Dialogs.dlgNewLayer(Dialogs.dlgNewLayer.NewType.EditLayer);

                dlgNewLayer.MapHeight = mapViewer.CurrentMap.Layers[listBox_Layers.SelectedIndex].Height;
                dlgNewLayer.MapWidth = mapViewer.CurrentMap.Layers[listBox_Layers.SelectedIndex].Width;
                dlgNewLayer.ParaHorz = mapViewer.CurrentMap.Layers[listBox_Layers.SelectedIndex].ParallaxValueVertical / mapViewer.CurrentMap.BaseParallaxValueVertical;
                dlgNewLayer.ParaVert = mapViewer.CurrentMap.Layers[listBox_Layers.SelectedIndex].ParallaxValueHorizontal / mapViewer.CurrentMap.BaseParallaxValueHorizontal;
                dlgNewLayer.Label = mapViewer.CurrentMap.Layers[listBox_Layers.SelectedIndex].Name;

                if (dlgNewLayer.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    mapViewer.CurrentMap.ModifyLayer(listBox_Layers.SelectedIndex, dlgNewLayer.Label, dlgNewLayer.MapWidth, dlgNewLayer.MapHeight, dlgNewLayer.ParaVert, dlgNewLayer.ParaHorz);
                    refreshLayersDisplay();
                }
            }
        }
        private void newMapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Dialogs.dlgNewLayer dlgNewMap = new Dialogs.dlgNewLayer(Dialogs.dlgNewLayer.NewType.Map);
            if (dlgNewMap.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //Neue Map erstellen
                //wenn schon eine map da ist, dann ist auch ein tilesheet da! (übernehmen width und height!)
                int tmpTileWidth = -1;
                int tmpTileHeight = -1;
                if (mapViewer.CurrentMap != null)
                {
                    tmpTileWidth = mapViewer.CurrentMap.TileWidth;
                    tmpTileHeight = mapViewer.CurrentMap.TileHeight;
                }
                mapViewer.SetMap(new Map.Map(dlgNewMap.Label, dlgNewMap.MapWidth, dlgNewMap.MapHeight, dlgNewMap.ParaVert, dlgNewMap.ParaHorz));
                mapViewer.CurrentMap.SetTileDimensions(tmpTileWidth, tmpTileHeight);

                listBox_Layers.DataSource = mapViewer.CurrentMap.Layers;
            }
        }