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

Option for start command to also reset #247

Merged
merged 1 commit into from
Jul 9, 2023
Merged

Option for start command to also reset #247

merged 1 commit into from
Jul 9, 2023

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Jul 4, 2023

What problem does this solve?

See how Torje here cannot automatically reset their timer whilst AutoSplit isn't running: https://youtu.be/Tt0llYwGFgw

After carefully looking at it, it seems everything is working as intended in AutoSplit:

  • Whilst AutoSplit is running, the reset image is checked. And that's why resetting works mid-run.
  • The reset image isn't checked whilst AutoSplit is not running.
  • The reset image is not checked during the start image's "pause time". That's also on purpose otherwise you'd be stuck in a loop.

On LiveSplit's side:

  • The timer will only reset from a "reset" or "split" command.
  • With hotkeys, start/split is the same thing
  • With its API, a "start" command specifically won't start the timer when the run is ended. Which is what's happening to you.
  • A "start" command also won't split (but that's irrelevant here)

Doc: https://github.com/LiveSplit/LiveSplit.AutoSplitters/blob/master/README.md#automatic-timer-start-1

Note that the start action will only be run if the timer is currently not running.

And confirmed by looking at the source https://github.com/LiveSplit/LiveSplit/blob/4d30d15ec62e3bb24910b0944949fb55265f3884/LiveSplit/LiveSplit.Core/Model/TimerModel.cs#L37-L53

Potential solutions

So it seems that what we need is either:

  • Have the reset image still be checked whilst AutoSplit is not running. This may require changing when AutoSplit pre-loads and parses images. Like changing the "reload star image" button with "reload all images". And once AutoSplit uses an observer pattern instead of a synchronous loop.
  • Have the start image also emit the reset command/hotkey. I'm not immediately certain if this should always be the case, so I'd make it an option. That'd be doable quickly short term.

Here I'm going for the second solution which is immediately actionable, and making it an option as it may not always be desirable. The first solution would be better long term but is dependant on #219

@Avasam Avasam force-pushed the start-also-resets branch 2 times, most recently from e3c640f to e734468 Compare July 4, 2023 16:10
@Avasam Avasam force-pushed the start-also-resets branch from e734468 to d5662bf Compare July 4, 2023 18:27
@Avasam Avasam force-pushed the start-also-resets branch from d5662bf to f2b674a Compare July 4, 2023 18:28
@Avasam Avasam merged commit 27e3aec into dev Jul 9, 2023
@Avasam Avasam deleted the start-also-resets branch July 9, 2023 18:49
@Avasam Avasam mentioned this pull request Jul 15, 2023
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