Skip to content

Commit

Permalink
Faster flight refresh interval
Browse files Browse the repository at this point in the history
500ms for the VAB is pretty good, but its really clunky looking in
flight and in flight we have lighterweight updates.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Jul 11, 2023
1 parent ec3be1b commit ee36930
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions MechJeb2/MechJebLib/Utils/BackgroundJob.cs
@@ -1,10 +1,9 @@
#nullable enable

using System;
using System.Threading;
using System.Threading.Tasks;

#nullable enable

namespace MechJebLib.Utils
{
// TODO:
Expand Down
5 changes: 3 additions & 2 deletions MechJeb2/MechJebModuleStageStats.cs
Expand Up @@ -3,7 +3,6 @@
using JetBrains.Annotations;
using MechJebLib.Simulations;
using Unity.Profiling;
using Debug = UnityEngine.Debug;

namespace MuMech
{
Expand Down Expand Up @@ -176,7 +175,9 @@ private void TryStartSimulation()
if (Vessel is null) return;
}

if (_stopwatch.IsRunning && _stopwatch.ElapsedMilliseconds < 500)
double refreshInterval = HighLogic.LoadedSceneIsEditor ? 500 : 100;

if (_stopwatch.IsRunning && _stopwatch.ElapsedMilliseconds < refreshInterval)
return;

_stopwatch.Restart();
Expand Down

0 comments on commit ee36930

Please sign in to comment.