private void shapesButton_Click(object sender, RoutedEventArgs e) { if (ssw == null) { MessageBox.Show("????"); } this.RemoveVisualChild(ssw); ssw = null; if (Tetromino.POSSIBLE_TETROMINOS.Count == 4) { this.RemoveVisualChild(ssw); ssw = new ShapeSelectorWindow(Tetromino.POSSIBLE_TETROMINOS); } else { ssw = new ShapeSelectorWindow(); } this.RemoveVisualChild(ssw); ssw.ShowDialog(); //here be dragons if (ssw.ShapesMadeCount == 4) { Startable = true; Tetromino.GenerateShapes(ssw.ExportSelection()); } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { timer.Stop(); ShapeSelectorWindow ssw = new ShapeSelectorWindow(Tetromino.POSSIBLE_TETROMINOS); ssw.ShowDialog(); ssw.Close(); Tetromino.GenerateShapes(ssw.ExportSelection()); timer.Start(); }
public MainMenuWindow() { InitializeComponent(); ssw = new ShapeSelectorWindow(); DataContext = this; Startable = false; }