analysis promotion dialog side based on dest (fixes #6875)

pull/6882/head
Niklas Fiekas 2020-06-26 15:17:56 +02:00
parent 9da27766e2
commit 772c457b2a
1 changed files with 5 additions and 4 deletions

View File

@ -78,12 +78,13 @@ function renderPromotion(ctrl: AnalyseCtrl, dest: Key, pieces: string[], color:
}));
}
const roles: Role[] = ['queen', 'knight', 'rook', 'bishop'];
export function view(ctrl: AnalyseCtrl) {
if (!promoting) return;
var pieces = ['queen', 'knight', 'rook', 'bishop'];
if (ctrl.data.game.variant.key === "antichess") pieces.push('king');
return renderPromotion(ctrl, promoting.dest, pieces,
util.opposite(ctrl.chessground.state.turnColor),
return renderPromotion(ctrl, promoting.dest,
ctrl.data.game.variant.key === 'antichess' ? roles.concat('king') : roles,
promoting.dest[1] === '8' ? 'white' : 'black',
ctrl.chessground.state.orientation);
}