add milliseconds to fast forward ui

This commit is contained in:
Mister_Nebula 2021-07-29 23:44:59 +01:00
parent 5aa907d259
commit 32bea79812
2 changed files with 4 additions and 1 deletions

View File

@ -76,11 +76,12 @@ namespace QSB.TimeSync
var totalSeconds = Mathf.Max(TargetTime - Time.timeSinceLevelLoad, 0f);
var minutes = Mathf.FloorToInt(totalSeconds / 60f);
var seconds = Mathf.FloorToInt(totalSeconds) % 60;
var milliseconds = totalSeconds % 1 * 1000;
var text = "";
switch (_currentType)
{
case TimeSyncType.Fastforwarding:
text = $"{minutes:D2}:{seconds:D2}"
text = $"{minutes:D2}:{seconds:D2}.{milliseconds:000}"
+ Environment.NewLine
+ "Fast-forwarding to match server time...";
break;

View File

@ -275,6 +275,8 @@ namespace QSB.TimeSync
var diff = _serverTime - Time.timeSinceLevelLoad;
OWTime.SetTimeScale(Mathf.SmoothStep(MinFastForwardSpeed, MaxFastForwardSpeed, Mathf.Abs(diff) / MaxFastForwardDiff));
TimeSyncUI.TargetTime = _serverTime;
if (QSBSceneManager.CurrentScene == OWScene.SolarSystem && _isFirstFastForward)
{
var spawnPoint = Locator.GetPlayerBody().GetComponent<PlayerSpawner>().GetInitialSpawnPoint().transform;