|
@@ -123,10 +123,17 @@ class ChessManager:
|
|
|
if not session:
|
|
|
raise KeyError(id)
|
|
|
|
|
|
+ arrows = []
|
|
|
+ if session.board.move_stack:
|
|
|
+ arrows.append((session.board.move_stack[-1].from_square, session.board.move_stack[-1].to_square))
|
|
|
+
|
|
|
+ if len(session.board.move_stack) > 1:
|
|
|
+ arrows.append((session.board.move_stack[-2].from_square, session.board.move_stack[-2].to_square))
|
|
|
+
|
|
|
if session.board.is_check():
|
|
|
- return chess.svg.board(session.board, size=size, fill={checker: "#cc0000cc" for checker in session.board.checkers()}, check=session.board.king(session.board.turn))
|
|
|
+ return chess.svg.board(session.board, size=size, arrows=arrows, fill={checker: "#cc0000cc" for checker in session.board.checkers()}, check=session.board.king(session.board.turn))
|
|
|
|
|
|
- return chess.svg.board(session.board, size=size)
|
|
|
+ return chess.svg.board(session.board, size=size, arrows=arrows)
|
|
|
|
|
|
def ascii(self, id):
|
|
|
session = self.sessions.get(id)
|