Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ errorT Game::WriteMoveList(TextBuffer* tb, moveT* oldCurrentMove,
if (IsColorFormat()) {
startTable = "<br>";
endColumn = "<br>";
printDiagrams = PgnStyle & PGN_STYLE_DIAGRAM;
}

if (IsHtmlFormat() && VarDepth == 0) { tb->PrintString ("<b>"); }
Expand Down Expand Up @@ -1843,7 +1844,6 @@ errorT Game::WriteMoveList(TextBuffer* tb, moveT* oldCurrentMove,
}
tb->PrintWord (temp);
colWidth -= (int) std::strlen(temp);

}
if (IsColorFormat() && m->nagCount > 0) {
tb->PrintString ("</nag>");
Expand All @@ -1856,7 +1856,10 @@ errorT Game::WriteMoveList(TextBuffer* tb, moveT* oldCurrentMove,
}
}

if (printDiagramHere) {
if (printDiagramHere && IsColorFormat()) {
// print tag here to avoid dumping board in next if-statement
tb->PrintString ("<board>");
} else if (printDiagramHere) {
if ((PgnStyle & PGN_STYLE_COLUMN) && VarDepth == 0) {
if (! endedColumn) {
if (CurrentPos->GetToMove() == WHITE) {
Expand Down
1 change: 1 addition & 0 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ enum gameFormatT {
#define PGN_STYLE_STRIP_MARKS 1024 // Strip [%mark] and [%arrow] codes.
#define PGN_STYLE_NO_NULL_MOVES 2048 // Convert null moves to comments.
#define PGN_STYLE_UNICODE 4096 // Use U+2654..U+2659 for figurine
#define PGN_STYLE_DIAGRAM 8192 // Show board diagram


void game_printNag (byte nag, char * str, bool asSymbol, gameFormatT format);
Expand Down
6 changes: 4 additions & 2 deletions src/tkscid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3294,14 +3294,14 @@ sc_game_pgn (ClientData, Tcl_Interp * ti, int argc, const char ** argv)
"-column", "-comments", "-base", "-gameNumber", "-format",
"-shortHeader", "-indentComments", "-indentVariations",
"-symbols", "-tags", "-variations", "-width", "-space",
"-markCodes", "-unicode",
"-markCodes", "-unicode", "-showDiagram",
NULL
};
enum {
OPT_COLUMN, OPT_COMMENTS, OPT_BASE, OPT_GAME_NUMBER, OPT_FORMAT,
OPT_SHORT_HDR, OPT_INDENT_COMMENTS, OPT_INDENT_VARS,
OPT_SYMBOLS, OPT_TAGS, OPT_VARS, OPT_WIDTH, OPT_SPACE,
OPT_NOMARKS, OPT_UNICODE,
OPT_NOMARKS, OPT_UNICODE, OPT_SHOWDIAGRAM,
};

const scidBaseT* base = db;
Expand Down Expand Up @@ -3392,6 +3392,8 @@ sc_game_pgn (ClientData, Tcl_Interp * ti, int argc, const char ** argv)
bitmask = PGN_STYLE_STRIP_MARKS; break;
case OPT_UNICODE:
bitmask = PGN_STYLE_UNICODE; break;
case OPT_SHOWDIAGRAM:
bitmask = PGN_STYLE_DIAGRAM; break;
default: // unreachable!
return errorResult (ti, "Invalid option.");
};
Expand Down
Loading