Ejemplo n.º 1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog od = new OpenFileDialog();

            od.Title  = "Open tileset file";
            od.Filter = "Tileset files|*.tileset";
            od.ShowDialog();

            Tileset temp = new Tileset();

            temp.LoadFromFile(od.FileName);
            mapViewer1.TileSize = temp.Images.ImageSize.Width;

            if (!temp.CheckAgainst(m_openMap))
            {
                if (MessageBox.Show("Some features of the current map don't work with this tileset.\n Would you like to close the current map?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    mnuClose_Click(null, null);
                }

                if (m_fileOpen)
                {
                    return;
                }
            }

            tileset = temp;

            RefreshListViewer();
            RegistryAccess.AddRecentFile(tileset.FileName, RegistrySetting.RecentTilesets);
            RefreshRecentList(recentToolStripMenuItem, RegistrySetting.RecentTilesets);
        }