public void SetThemes(BoardTheme board, PieceTheme piece) { BoardImages = board; PieceImages = piece; chessBoardPanel.Refresh(); }
public ThemeSelectionForm(ThemeDatabase db, BoardTheme currentBoardTheme, PieceTheme currentPieceTheme) { InitializeComponent(); Icon = Properties.Resources.application_icon; Themes = db; SelectedBoardTheme = currentBoardTheme; SelectedPieceTheme = currentPieceTheme; chessBoard.SetThemes(SelectedBoardTheme, SelectedPieceTheme); confirmButton.DialogResult = DialogResult.OK; cancelButton.DialogResult = DialogResult.Cancel; foreach (var kv in Themes.BoardThemes) { boardThemesListBox.Items.Add(kv.Key); } foreach (var kv in Themes.PieceThemes) { pieceThemesListBox.Items.Add(kv.Key); } boardThemesListBox.SelectedItem = SelectedBoardTheme.Name; pieceThemesListBox.SelectedItem = SelectedPieceTheme.Name; }
public PromotionSelectionForm(PieceTheme theme, Player player) { InitializeComponent(); Icon = Properties.Resources.application_icon; PieceImages = theme; SideToMove = player; knightPromotionButton.Image = PieceImages.GetImageForPiece(new Knight(player)); bishopPromotionButton.Image = PieceImages.GetImageForPiece(new Bishop(player)); rookPromotionButton.Image = PieceImages.GetImageForPiece(new Rook(player)); queenPromotionButton.Image = PieceImages.GetImageForPiece(new Queen(player)); knightPromotionButton.DialogResult = DialogResult.OK; bishopPromotionButton.DialogResult = DialogResult.OK; rookPromotionButton.DialogResult = DialogResult.OK; queenPromotionButton.DialogResult = DialogResult.OK; }
private void PieceThemesListBox_SelectedIndexChanged(object sender, EventArgs e) { SelectedPieceTheme = Themes.PieceThemes[(string)pieceThemesListBox.SelectedItem]; chessBoard.SetThemes(SelectedBoardTheme, SelectedPieceTheme); }