void refreshTileset(object sender, EventArgs e)
        {
            try
            {
                int index = tilesetsList.SelectedIndex;

                WorldTileset refresh = new WorldTileset(world.Tilesets[index].Filename,
                    world.CanvasGraphicsDevice);

                world.Tilesets[index] = refresh;
                world.InvalidateCanvas();
                world.UpdateTilesetIndexes();

                selector.Tileset = refresh.Image;
                selector.Selection = Rectangle.Empty;
                selector.Invalidate();
            }
            catch (Exception exception)
            {
                MessageBox.Show("An error occured while refreshing the tileset\n" + exception.Message,
                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a tileset to the world
        /// </summary>
        /// <param name="tileset"> New tileset </param>
        public void AddTileset(WorldTileset tileset)
        {
            tilesets.Add(tileset);

            UpdateTilesetIndexes();
        }