Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var dialog = new NewTilesetDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var name = dialog.TilesetName;
                Model.Instance.AddTileset(name);
                comboBoxSource.ResetBindings(false);
            }
        }
        private void addTilesetMenuItem_Click(object sender, RoutedEventArgs e)
        {
            NewTilesetDialog newTilesetDialog = new NewTilesetDialog(editor);

            // Show the dialog, ask for tileset properties.
            if (newTilesetDialog.ShowDialog().Value)
            {
                // Dialog OK, create new tileset.
                NewTilesetProperties newTilesetProperties = newTilesetDialog.NewTilesetProperties;

                editor.AddTileset(newTilesetProperties.Name, newTilesetProperties.Path, new Point(newTilesetProperties.TileWidth, newTilesetProperties.TileHeight),
                                  new Point(newTilesetProperties.OffsetX, newTilesetProperties.OffsetY));
            }
        }
Esempio n. 3
0
        private void newSetButton_Click(object sender, RoutedEventArgs e)
        {
            NewTilesetDialog newTilesetDialog = new NewTilesetDialog(editor);

            if (newTilesetDialog.ShowDialog().Value)
            {
                // Got properties, create new tileset.
                NewTilesetProperties newTilesetProperties = newTilesetDialog.NewTilesetProperties;

                editor.AddTileset(newTilesetProperties.Name, newTilesetProperties.Path, new Point(newTilesetProperties.TileWidth, newTilesetProperties.TileHeight),
                                  new Point(newTilesetProperties.OffsetX, newTilesetProperties.OffsetY));


                // Add new tileset to view model.
                tilesetsViewModel.Tilesets.Add(new TilesetViewModel(editor.Tilesets.FirstOrDefault(t => t.Name == newTilesetProperties.Name)));
            }
        }