private void buttonEditTileset_Click(object sender, System.EventArgs e) { EditTilesetDialog dialog = new EditTilesetDialog() { SourceTileset = (Tileset)comboBoxTilesets.SelectedItem }; if (dialog.ShowDialog() == DialogResult.OK) { dialog.SourceTileset.Apply(dialog.ModifiedTileset); tilesetPreviewer.RefreshFrames(); monoGameEditor1.Bootstrap.SaveTilesets(); } }
/// <summary> /// buttonEditTileset_Click(object, EventArgs) /// Handler for then the 'Edit Tileset' button is clicked. /// Opens an EditTilesetDialog in which the user can divide the /// Tileset into seperate, selectable frames. /// </summary> /// <param name="sender">(object) - The object signaling the event.</param> /// <param name="e">(EventArgs) - The type of event being sent.</param> private void buttonEditTileset_Click(object sender, EventArgs e) { // Create an instance of EditTilesetDialog with the currently selected Tileset (comboBox) EditTilesetDialog dialog = new EditTilesetDialog() { SourceTileset = (Tileset)comboBoxTilesets.SelectedItem }; // Open dialog and wait for results, update Tileset based on the changes made in the dialog. if (dialog.ShowDialog() == DialogResult.OK) { dialog.SourceTileset.Apply(dialog.ModifiedTileset); // Apply changes to the SourceTileset tilesetPreviewer.RefreshFrames(); // Update Tileset frames based on changes. monoGameEditor.Bootstrap.SaveTilesets(); // Save updated Tileset data in a JSON file. } }