Hsterts / Fumenities

A fork of Swng's Fumen Utils with various UI, aesthetic, and functional improvements. Worked on by Swng, Hillosanation, and Marfung37.
https://hsterts.github.io/Fumenities/
2 stars 2 forks source link

Remove logging extra board history when traversing through pages #9

Open Hillosanation opened 1 year ago

Hillosanation commented 1 year ago

Before moving through pages (prev/next/goto), any auto-color blocks must be solidified first (because they usually only solidify in a mousedown event, not mouseup). This may change the state of the book, so it is always calls AddLog. However, when there is no apparent change in the books, it may look like undo did nothing.

There are a few ways to approach this:

  1. Check if solidifyBoard changed the board, and only call addLog if it did
  2. Make HistoryState automatically refuse to add a new log entry if it is the same as the log it is using(the last entry in undoLog)
  3. Also record the traversal of pages by setting the page number you were on, so that undoing is able to change the page displayState will be displaying.

A combination of 2 and 3 could be useful, so that it always "snaps" you to the latest page where you changed something in the book.