Merge pull request #217 from Carifio24/time-rate
Fix issue with time offset at non-unit clock rates and update speed text with shortcuts
This commit is contained in:
Коммит
3e3c7c1968
|
@ -18,7 +18,7 @@ namespace TerraViewer
|
|||
if (timeRate != 1.0)
|
||||
{
|
||||
TimeSpan ts = justNow - last;
|
||||
long ticks = (long)(ts.Ticks * timeRate);
|
||||
long ticks = (long)(ts.Ticks * (timeRate - 1));
|
||||
offset = offset.Add(new TimeSpan(ticks));
|
||||
}
|
||||
last = justNow;
|
||||
|
|
|
@ -6942,9 +6942,17 @@ namespace TerraViewer
|
|||
break;
|
||||
case Keys.F:
|
||||
SpaceTimeController.Faster();
|
||||
if (viewPane != null)
|
||||
{
|
||||
viewPane.UpdateSpeed();
|
||||
}
|
||||
break;
|
||||
case Keys.S:
|
||||
SpaceTimeController.Slower();
|
||||
if (viewPane != null)
|
||||
{
|
||||
viewPane.UpdateSpeed();
|
||||
}
|
||||
break;
|
||||
case Keys.H:
|
||||
// turn friction on and off
|
||||
|
|
|
@ -227,14 +227,14 @@ namespace TerraViewer
|
|||
UpdateSpeed();
|
||||
}
|
||||
|
||||
private void UpdateSpeed()
|
||||
public void UpdateSpeed()
|
||||
{
|
||||
|
||||
if (SpaceTimeController.TimeRate == 1.0)
|
||||
{
|
||||
TimeMode.Text = Language.GetLocalizedText(513, "Real Time");
|
||||
}
|
||||
else if (SpaceTimeController.TimeRate == -2.0)
|
||||
else if (SpaceTimeController.TimeRate == -1.0)
|
||||
{
|
||||
TimeMode.Text = Language.GetLocalizedText(521, "Reverse Time");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче