Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit 1649b0d

Browse files
committed
On check resume, a blank will be written before "Checker resumed!" if there was a hit between pausing and resuming
That makes it look nicer, instead of having the hit and the "Checker resumed!" glued
1 parent 15d710f commit 1649b0d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/Milky/Checker.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ private void OutputCombo(Combo combo, CheckResult checkResult)
222222
};
223223

224224
Console.WriteLine(outputString);
225+
226+
Info.LastHit = DateTime.Now;
225227
}
226228
}
227229
}

src/Milky/ConsoleManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ public async Task StartListeningKeysAsync(ConsoleKey? pauseKey = ConsoleKey.P, C
136136
{
137137
lock (_checker.Info.Locker)
138138
{
139+
if (_checker.Info.LastHit > _checker.Info.LastPause)
140+
{
141+
Console.WriteLine();
142+
}
143+
139144
Console.ForegroundColor = ConsoleColor.White;
140145
Console.WriteLine($"Checker resumed! Pause duration: {TimeSpan.FromSeconds((int)_checker.Resume().TotalSeconds)}{Environment.NewLine}");
141146
}

src/Milky/Models/CheckerInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public int EstimatedHits
5151

5252
internal TimeSpan TotalPause { get; set; }
5353

54+
internal DateTime LastHit { get; set; }
55+
5456
public TimeSpan Elapsed => TimeSpan.FromSeconds((int)((End ?? DateTime.Now) - Start - TotalPause - (Status == CheckerStatus.Paused ? DateTime.Now - LastPause : TimeSpan.Zero)).TotalSeconds);
5557

5658
public TimeSpan? Remaining

0 commit comments

Comments
 (0)