Skip to content

Commit

Permalink
Further integration work ; ending is now also tested a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
cieldeville committed Oct 3, 2021
1 parent 3b3aee4 commit 0eea5e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Game/Speedrun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public void UnInitialize()

public void Reset()
{
_currentState = State.WaitingForTitleScreen;
_currentSplit = 0;
_timer.Reset();
}

public void OnTimerReset()
{
Debug.WriteLine("OnTimerReset() invoked");
_currentState = State.WaitingForTitleScreen;
_currentSplit = 0;
}

private void OnPause()
Expand Down Expand Up @@ -172,12 +172,13 @@ public void Update()
if (_gameState.EndScreen == GameState.EndScreenState.Input)
{
Console.WriteLine("Detected end of game!");
_currentState = State.Finished;
_timer.Split();
_timer.CurrentState.IsGameTimePaused = true;
}
}

if (_currentState >= State.ReadyForLaunch && _gameState.AtTitleScreen)
if (_currentState >= State.ReadyForLaunch && _currentState != State.Finished && _gameState.AtTitleScreen)
{
Reset();
}
Expand Down
2 changes: 1 addition & 1 deletion ProcessCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ProcessCapture
/// <summary>
/// Number of seconds in between hooking attempts
/// </summary>
public int HookAttemptDelay { get; set; } = 10;
public int HookAttemptDelay { get; set; } = 3;

/// <summary>
/// Event raised whenever a new process has been hooked.
Expand Down

0 comments on commit 0eea5e0

Please sign in to comment.