Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions Pal98Timer/GForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -547,22 +547,12 @@ public void OnKeyPress(KeyboardLib.HookStruct hookStruct, out bool handle)
if (KeyChangerDel.IsEnable())
{
KeyChangerDel.Disable();
ShowKCEnable();
KeyChangerDel.Close();
}
else
{
Run(delegate() {
KeyChangerDel.Open();
// Wait for the KeyChanger window to be ready (up to 3 seconds)
for (int i = 0; i < 30 && !KeyChangerDel.IsWindowOpen(); i++)
{
System.Threading.Thread.Sleep(100);
}
KeyChangerDel.Enable();
UI(delegate() { ShowKCEnable(); });
});
KeyChangerDel.Enable();
}
ShowKCEnable();
core.OnFunctionKey(11);
}
handle = core.NeedBlockFunctionKey(11);
Expand Down
3 changes: 2 additions & 1 deletion Pal98Timer/Pal98Timer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
<DependentUpon>Upload.cs</DependentUpon>
</Compile>
<Compile Include="User32.cs" />
<Compile Include="VoicePrompt.cs" />
<Compile Include="wapi\Enums.cs" />
<Compile Include="wapi\Structs.cs" />
<Compile Include="wapi\Win32API.cs" />
Expand Down Expand Up @@ -330,4 +331,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
20 changes: 16 additions & 4 deletions Pal98Timer/TimerCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public TimerCore(GForm form)
{
this.form = form;
CMD5 = GetFileMD5(this.GetType().Assembly.Location);
VoicePrompt.ReloadConfig();
}
/// <summary>
/// 计算文件的MD5
Expand Down Expand Up @@ -512,11 +513,22 @@ protected void Checking()

if (CurrentStep < CheckPoints.Count)
{
CheckPoints[CurrentStep].Current = MT.CurrentTSOnly;
if (CheckPoints[CurrentStep].Check())
CheckPoint currentCheckPoint = CheckPoints[CurrentStep];
currentCheckPoint.Current = MT.CurrentTSOnly;
if (currentCheckPoint.Check())
{
CheckPoints[CurrentStep].Current = new TimeSpan(MT.CurrentTSOnly.Ticks);
CheckPoints[CurrentStep].IsEnd = true;
currentCheckPoint.Current = new TimeSpan(MT.CurrentTSOnly.Ticks);
currentCheckPoint.IsEnd = true;
VoicePrompt.PlayCheckpointSound(currentCheckPoint.GetNickName());
long deltaSeconds = currentCheckPoint.GetCHA();
if (deltaSeconds < 0)
{
VoicePrompt.PlayFasterSound();
}
else if (deltaSeconds > 0)
{
VoicePrompt.PlaySlowerSound();
}
//CurrentStep++;
int nextstep = CurrentStep + 1;
if (nextstep >= CheckPoints.Count)
Expand Down
Loading