X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwoptions.c;h=b2bbf0a8b0539cdc8c41fe520614fa3aa4182580;hb=refs%2Ftags%2Fv4.3.14;hp=1d921292540030b11ae839fd2c094f29a8142877;hpb=7e4f4f5718bf4efee8be4abfc981d18cfd6f8438;p=xboard.git diff --git a/winboard/woptions.c b/winboard/woptions.c index 1d92129..b2bbf0a 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -65,6 +65,7 @@ extern char installDir[]; extern HWND hCommPort; /* currently open comm port */ extern DCB dcb; extern BOOLEAN chessProgram; +extern startedFromPositionFile; /* [HGM] loadPos */ /* types */ @@ -495,7 +496,7 @@ BoardOptionsWhichRadio(HWND hDlg) LRESULT CALLBACK BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - static Boolean mono; + static Boolean mono, white, flip; static BoardSize size; static COLORREF lsc, dsc, wpc, bpc, hsc, phc; static HBITMAP pieces[3]; @@ -564,6 +565,12 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if (appData.monoMode) CheckDlgButton(hDlg, OPT_Monochrome, TRUE); + if (appData.allWhite) + CheckDlgButton(hDlg, OPT_AllWhite, TRUE); + + if (appData.upsideDown) + CheckDlgButton(hDlg, OPT_UpsideDown, TRUE); + pieces[0] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "s"); pieces[1] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "w"); pieces[2] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "o"); @@ -575,6 +582,8 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) hsc = highlightSquareColor; phc = premoveHighlightColor; mono = appData.monoMode; + white= appData.allWhite; + flip = appData.upsideDown; size = boardSize; SetBoardOptionEnables(hDlg); @@ -619,6 +628,8 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) (wpc != whitePieceColor) || (bpc != blackPieceColor) || (hsc != highlightSquareColor) || + (flip != appData.upsideDown) || + (white != appData.allWhite) || (phc != premoveHighlightColor)) { lightSquareColor = lsc; @@ -628,6 +639,8 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) highlightSquareColor = hsc; premoveHighlightColor = phc; appData.monoMode = mono; + appData.allWhite = white; + appData.upsideDown = flip; InitDrawingColors(); InitDrawingSizes(boardSize, 0); @@ -695,7 +708,11 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) hsc = ParseColorName(HIGHLIGHT_SQUARE_COLOR); phc = ParseColorName(PREMOVE_HIGHLIGHT_COLOR); mono = FALSE; + white= FALSE; + flip = FALSE; CheckDlgButton(hDlg, OPT_Monochrome, FALSE); + CheckDlgButton(hDlg, OPT_AllWhite, FALSE); + CheckDlgButton(hDlg, OPT_UpsideDown, FALSE); PaintColorBlock(hDlg, OPT_LightSquareColor, lsc); PaintColorBlock(hDlg, OPT_DarkSquareColor, dsc); PaintColorBlock(hDlg, OPT_WhitePieceColor, wpc); @@ -713,6 +730,16 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) mono = !mono; SetBoardOptionEnables(hDlg); break; + + case OPT_AllWhite: + white = !white; + SetBoardOptionEnables(hDlg); + break; + + case OPT_UpsideDown: + flip = !flip; + SetBoardOptionEnables(hDlg); + break; } break; } @@ -747,7 +774,16 @@ VariantWhichRadio(HWND hDlg) (IsDlgButtonChecked(hDlg, OPT_VariantSuicide) ? VariantSuicide : (IsDlgButtonChecked(hDlg, OPT_VariantAtomic) ? VariantAtomic : (IsDlgButtonChecked(hDlg, OPT_VariantShatranj) ? VariantShatranj : - VariantNormal ))))))))))))))); + (IsDlgButtonChecked(hDlg, OPT_VariantFRC) ? VariantFischeRandom : + (IsDlgButtonChecked(hDlg, OPT_VariantCylinder) ? VariantCylinder : + (IsDlgButtonChecked(hDlg, OPT_VariantFalcon) ? VariantFalcon : + (IsDlgButtonChecked(hDlg, OPT_VariantCRC) ? VariantCapaRandom : + (IsDlgButtonChecked(hDlg, OPT_Variant3Checks) ? Variant3Check : + (IsDlgButtonChecked(hDlg, OPT_VariantBerolina) ? VariantBerolina : + (IsDlgButtonChecked(hDlg, OPT_VariantJanus) ? VariantJanus : + (IsDlgButtonChecked(hDlg, OPT_VariantWildcastle) ? VariantWildCastle : + (IsDlgButtonChecked(hDlg, OPT_VariantNocastle) ? VariantNoCastle : + VariantNormal )))))))))))))))))))))))); } LRESULT CALLBACK @@ -810,6 +846,33 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case VariantShatranj: CheckDlgButton(hDlg, OPT_VariantShatranj, TRUE); break; + case VariantFischeRandom: + CheckDlgButton(hDlg, OPT_VariantFRC, TRUE); + break; + case VariantCapaRandom: + CheckDlgButton(hDlg, OPT_VariantCRC, TRUE); + break; + case VariantFalcon: + CheckDlgButton(hDlg, OPT_VariantFalcon, TRUE); + break; + case VariantCylinder: + CheckDlgButton(hDlg, OPT_VariantCylinder, TRUE); + break; + case Variant3Check: + CheckDlgButton(hDlg, OPT_Variant3Checks, TRUE); + break; + case VariantBerolina: + CheckDlgButton(hDlg, OPT_VariantBerolina, TRUE); + break; + case VariantJanus: + CheckDlgButton(hDlg, OPT_VariantJanus, TRUE); + break; + case VariantWildCastle: + CheckDlgButton(hDlg, OPT_VariantWildcastle, TRUE); + break; + case VariantNoCastle: + CheckDlgButton(hDlg, OPT_VariantNocastle, TRUE); + break; } SetDlgItemInt( hDlg, IDC_Files, -1, TRUE ); @@ -848,6 +911,9 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if(!n2_ok) appData.NrRanks = -1; if(!n3_ok) appData.holdingsSize = -1; + shuffleOpenings = FALSE; /* [HGM] shuffle: possible shuffle reset when we switch */ + startedFromPositionFile = FALSE; /* [HGM] loadPos: no longer valid in new variant */ + appData.pieceToCharTable = NULL; Reset(TRUE, TRUE); return TRUE; @@ -1919,7 +1985,7 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) return TRUE; case OPT_BrowseSound: - f = OpenFileDialog(hDlg, FALSE, NULL, "wav", SOUND_FILT, + f = OpenFileDialog(hDlg, "rb", NULL, "wav", SOUND_FILT, "Browse for Sound File", NULL, NULL, buf); if (f != NULL) { fclose(f); @@ -2463,7 +2529,7 @@ SaveOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) return TRUE; case OPT_AVBrowse: - f = OpenFileDialog(hDlg, TRUE, NULL, + f = OpenFileDialog(hDlg, "a", NULL, appData.oldSaveStyle ? "gam" : "pgn", GAME_FILT, "Browse for Auto Save File", NULL, NULL, buf);