Skip to content

Commit

Permalink
nvui: show turn number in move lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 30, 2019
1 parent b9420b7 commit 06028e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/analyse/src/plugins/nvui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function renderMainline(nodes: Tree.Node[], currentPath: Tree.Path, style: Style
if (!node.san || !node.uci) return;
path += node.id;
const content: MaybeVNodes = [
node.ply & 1 ? '' + moveView.plyToTurn(node.ply) : null,
node.ply & 1 ? moveView.plyToTurn(node.ply) + ' ' : null,
renderSan(node.san, node.uci, style)
];
res.push(h('move', {
Expand Down
1 change: 1 addition & 0 deletions ui/round/src/plugins/nvui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function sanToUci(san: string, sans: Sans): Uci | undefined {
function renderMoves(steps: Step[], style: Style) {
const res: Array<string | VNode> = [];
steps.forEach(s => {
if (s.ply & 1) res.push((Math.ceil(s.ply / 2)) + ' ');
res.push(renderSan(s.san, s.uci, style) + ', ');
if (s.ply % 2 === 0) res.push(h('br'));
});
Expand Down

0 comments on commit 06028e7

Please sign in to comment.