Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whole new state machine #12

Merged
merged 62 commits into from
Mar 22, 2022
Merged

Whole new state machine #12

merged 62 commits into from
Mar 22, 2022

Conversation

LtPeriwinkle
Copy link
Owner

@LtPeriwinkle LtPeriwinkle commented Mar 7, 2022

Reimplementation of the internal state machine will eventually allow for plugins and stuff to work. The principle that this is based off of is "sending events" between the input handler, the state of the run, which handles timing and timer state, and the render state, which handles actually displaying things to the screen. Theoretically, the renderer could even be implemented as a plugin at this point, but I wasn't going to go that far. Things that still need to be tested/fixed before this can merge:

  • Panel behavior
  • Inline splits behavior
  • Saving split files
  • Window resizing (this has always been buggy, would be great to get it once and for all)
  • Unsplitting
    • Implementation
    • Testing
  • Split Skipping

Some other stuff I'd like to get through in this, since it's basically a complete rewrite

  • Clippy warnings (done for now, ci will check eventually though)
  • Set up cargo workspace
  • Fix any remaining issues where quoted messages get sent to the error dialog box

this will hopefully let me have the run as a field on App and
accessible from RunState and the future RenderState
copies the implementation of old `render_rows` with minor
modifications. started work on an update function taking a
RunUpdate from the RunState.
mostly copypasted code for window resizing/titling, added
`StateChange::Reset` to `update()` and copy paste for that too
method only recreates the parts of `RenderState` that depend
on the run, which is more efficient than calling `new()` when reloading
a run. will still have to call `new()` when reloading config.
i'm not really sure how it behaved before, but now it will
increase the number of splits on screen if there are more, starting
at the top. if splits have been scrolled off the top of the screen, they
will be re-shown before splits scrolled off the bottom.

When shrinking the window, splits at the bottom are always removed.
this allows skipping splits to still have the expected color changes
when you are ahead or behind later in the run, because previously-
everything got really confused
persist the time value across pausing so that it's the same when
you come out instead of recalculating for a frame, removing the weird
blink of a different time
example of how nice it is to add new events now. just slap em in
StateChangeRequest and add a relevant match arm and boooom.
it was already being used as such, and there was nothing actually checking
it for whether or not to round, so it's been reappropriated.
this avoids having golds set on split, which caused issues when
unsplitting if the unsplitted split was a gold.
mist 1.14.0 -> 1.15.0
mist-core 0.9.0 -> 0.10.0
@LtPeriwinkle LtPeriwinkle merged commit c15a681 into master Mar 22, 2022
@LtPeriwinkle LtPeriwinkle deleted the new_state branch March 22, 2022 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant