mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-04 08:06:25 +08:00
feat: 限制时间倍速
This commit is contained in:
@@ -33,13 +33,32 @@ namespace CRSim.ScreenSimulator.Views
|
||||
|
||||
private void DecreaseSpeed(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
_timeService.Speed /= 2 ;
|
||||
SpeedText.Text = _timeService.Speed.ToString()+"x" ;
|
||||
if (_timeService.Speed > 0.25 && _timeService.Speed <= 1024)
|
||||
{
|
||||
_timeService.Speed /= 2;
|
||||
SpeedText.Text = _timeService.Speed.ToString() + "x";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_timeService.Speed == 0.25)
|
||||
{
|
||||
_timeService.Speed = -1;
|
||||
SpeedText.Text = _timeService.Speed.ToString() + "x";
|
||||
}
|
||||
}
|
||||
}
|
||||
private void IncreaseSpeed(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
_timeService.Speed *= 2;
|
||||
SpeedText.Text = _timeService.Speed.ToString() + "x";
|
||||
if (_timeService.Speed >= 0.25 && _timeService.Speed < 1024)
|
||||
{
|
||||
_timeService.Speed *= 2;
|
||||
SpeedText.Text = _timeService.Speed.ToString() + "x";
|
||||
}
|
||||
if (_timeService.Speed == -1)
|
||||
{
|
||||
_timeService.Speed = 0.25;
|
||||
SpeedText.Text = _timeService.Speed.ToString() + "x";
|
||||
}
|
||||
}
|
||||
|
||||
private void Close(object sender, MouseButtonEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user