Merge pull request #219 from niuzhix/dev-3.0

feat: 限制时间倍速
This commit is contained in:
denglihong2007
2025-08-02 10:29:12 +08:00
committed by GitHub
2 changed files with 12 additions and 5 deletions

View File

@@ -33,17 +33,24 @@ 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";
}
}
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";
}
}
private void Close(object sender, MouseButtonEventArgs e)
{
Close();
}
}
}

View File

@@ -69,7 +69,7 @@ public partial class StationManagementPageViewModel : ObservableObject
});
}
#region Station
#region Station
public void RefreshStations()
{
var stationsList = _databaseService.GetAllStations();