artasparks / gpub

GPub: Go Publishing for Glift
MIT License
16 stars 3 forks source link

Feature: Number only the last specified amount (N) of moves #58

Closed xstephenhu98 closed 6 years ago

xstephenhu98 commented 6 years ago

MultiGo has a similar feature that allows the user to control the amount of numbered moves. For example, in a game with 206 moves (main nodes), a user input of "10" will render a diagram with only moves 197-206 numbered.

This might be added as an optional integer parameter; if no number is input, all moves since the last commented node will be numbered by default.

artasparks commented 6 years ago

I added this as on option to the specOptions. You specify a positionOverrides option that's an array of objects. Each one has the form

{
  gameId: <string>
  moveNumber: <number>
  showPreviousMoves: <number>
} 

When on a variation path, you can use:

{
  gameId: <string>
  initialPosition: <string>
  nextMovesPath: <string>
  showPreviousMoves: <number>
}

here's an example in action:

specOptions:
  positionType: GAME_COMMENTARY
  idGenType: PATH
  positionOverrides:
    - gameId: 'ag2'
      moveNumber: 292
      showPreviousMoves: 5