Seamless Page Overflow V.2#123
Open
J4PC wants to merge 11 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Back in february I reworked the old pull request (#92 ) from the ground up, but never got around to submitting it. Suffice it to say I believe it is a lot better, but I am not sure if even this improved version is remotely close to the rest of the mod.
The features include more customisability on how you want the page to overflow.
I liked your suggestion with the enum and went a bit further: you now have two settings:
"Overflow when typing" and Overflow when Pasting ("Paste Behavior").
The overflow when typing is just a normal boolean toggle which is off by default and when turned on it automatically continues on the new page when typing and also you then get the enter and Backspace shortcuts from before.
Then for the second setting "Paste Behavior" here the default is deny if it doesn't fit (so the vanilla behaviour), the new option here being fill page: When you paste something it will fill the page until full but not continue on the next pages.
And then lastly the Overflow to next page behaviour which is just the same except it continues on the following pages.
Personally thought about changing the default paste behaviour to fit page because I think it is more intuitive that way, it changes vanilla behaviour but so does the entire mod. I left the default in the pull request on deny if it doesn't fit but I am curious what your thoughts on that are.
On the topic of synergies I now consolidated the way the paste and typing overflow system work so they go through one function which leads to the same behaviour when pasting or typing a single character. I know this implementation is probably not what you had in mind when you cited the binary search as too complex but I decided to keep it and just give it the same word wrapping as typing because when testing without the binary search there was a noticeable lag/freeze when pasting a bit more and the game could crash when pasting for example moby dick in (even though it cuts off at 100 pages).
Also while testing I noticed that some websites have a next line symbol which appears when pasting the contents in the book so in this new version they get filtered out.
#57