Beispiel #1
0
        private void ContextMenuListBox_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.Text == "Delete")
            {
                var current = (listBoxObject.DataSource as BindingSource).Current as GameObject;
                this._mapController.ObjectEditor.QuadTree.removeObject(current);
                (listBoxObject.DataSource as BindingSource).RemoveCurrent();
            }
            else if (e.ClickedItem.Text == "Fit Tile")
            {
                var current = (listBoxObject.DataSource as BindingSource).Current as GameObject;
                ObjectEditor.FitTile(current);

                this._mapController.Draw(getVisibleMap());
            }
        }
Beispiel #2
0
        private void ExportQuadTree()
        {
            var filedialog = new SaveFileDialog();

            filedialog.Filter = "XML Files (*.xml)|*.xml";
            var result = filedialog.ShowDialog();

            if (result != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            string filename = filedialog.FileName;

            Cursor.Current = Cursors.WaitCursor;
            ObjectEditor.SaveQuadTree(this._mapController.ObjectEditor.QuadTree, filename);
            Cursor.Current = Cursors.Default;
        }