-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement Multiple Autosplitter Support #2
Conversation
- Allows refresh upon starting a preset save - added _isOldMapState() to avoid loadmap splitting on old map data while loading into a save on the titlescreen
Gives support for managing multiple autosplitters at the same time, using a global settings.json with optional extra autosplitters in an autosplitters/ directory. CCTimer will listen for a start condition upon pressing New Game or opening a Save Preset, then once a condition is met, will target that autosplitter for splits.
_copyArray() results in potential references of portions of Config._originalSplits getting passed into Config,splits rather than exclusively values. Implementation now uses the suggested method here: https://stackoverflow.com/questions/597588/how-do-you-clone-an-array-of-objects-in-javascript
Add documentation for the new `"preset"` split condition and setting up multiple autosplitters.
With the README addition, it makes more sense to keep this as an optional feature rather than one directly included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good so far. I will have to test it properly but that might take some time.
Utils.log('[timer] Using original ingame time'); | ||
this.utils.updateTime(this.connection); | ||
} else { | ||
Utils.log('[timer] Using custom time filter'); | ||
const stateManager = new StateManager(); | ||
stateManager.filterStates(config.filter); | ||
stateManager.filterStates(mainConfig.filter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see this is not updated if another config active (same with isIGT
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the way I have it set up is for settings.json
to be the only source for time and state settings, I mention it in the readme changes. It looked like it'd be a bit of a hassle to mess with dynamically handling time / state so I decided against it, especially since it's incredibly likely the desired settings would be the same between autosplitters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to these changes (especially _activeConfig
) it is no longer possible to use the auto-splitter for any speedrun that requires restarting the game.
This has always been a bit buggy because the current state isn't stored. It would be nice to use localstorage or similar to store it.
This PR adds in the ability to use multiple autosplitters at the same time. This is designed to allow for easily practicing segments by tying in the
"start"
condition of various autosplitters and waiting for the first one to fire.