Siderite/lichessTools

Make mousewheel work during game play.

Closed this issue · 3 comments

is it possible to add the use of mousewheel during games? to go though the moves. currently its only usable in analysis

The buttons during play can be used to ascertain the current, prev and next plys.

<div class="buttons">
    <div class="noop"/>
    <button class="fbt" data-icon="&#57418;" data-ply="0"/>
    <button class="fbt" data-icon="&#57420;" data-ply="9"/>
    <button class="fbt" data-icon="&#57419;" data-ply="11"/>
    <button class="fbt glowing" data-icon="&#57417;" data-ply="11"/>
    <button class="fbt board-menu-toggle" title="menu" data-icon="&#57422;"/>
</div>

Moving to a specific position can be achieved by triggering 'mousedown' events on the various buttons. I.e. one can create a button with a specific data-ply attribute, append it to .buttons, trigger mousedown, then remove it.

Here is the line that disallows scrolling during gameplay: https://github.com/lichess-org/lila/blob/e2fe0defb0b389681a11f184803387ace5c94ceb/ui/round/src/view/main.ts#L41

Raised an issue to discuss the possibility of removing the check: lichess-org/lila#16152

Implemented in v2.3.148