Skip to content

Commit

Permalink
Fixed Smoothing button timer not stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
thojmr committed Apr 11, 2022
1 parent 4a9b41c commit a86ab04
Showing 1 changed file with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ internal void ResetInflation()
/// <param name="includeClothMesh">Optionally include all cloth meshes as well</param>
internal async Task ApplySmoothing(bool includeClothMesh = false)
{
var anySmoothingStarted = false;

//Check that inflationConfig has a value
if (!infConfig.HasAnyValue()) return;
if (infConfig.inflationSize == 0) return;
Expand All @@ -125,7 +123,6 @@ internal async Task ApplySmoothing(bool includeClothMesh = false)
{
var smr = PregnancyPlusHelper.GetMeshRenderer(ChaControl, renderKey, searchInactive: false);
var _started = await SmoothSingleMesh(smr, renderKey);
if (_started) anySmoothingStarted = true;
}
}
//Only smooth the body mesh around the belly area
Expand All @@ -135,11 +132,10 @@ internal async Task ApplySmoothing(bool includeClothMesh = false)
var renderKey = GetMeshKey(bodySmr);

var started = await SmoothSingleMesh(bodySmr, renderKey);
if (started) anySmoothingStarted = true;
}

//Stop timer if not smoothing is queued
if (!anySmoothingStarted) CheckForEndOfSmoothing();
//Stop button timer when done
PregnancyPlusGui.StopTextCountIncrement();
}


Expand Down Expand Up @@ -175,7 +171,6 @@ await Task.Run(() =>
nativeDetour.Undo();
});

CheckForEndOfSmoothing();
//Re-trigger ApplyInflation to set the new smoothed mesh
await ApplySmoothResults(newVerts, renderKey, smr);
return true;
Expand All @@ -202,15 +197,6 @@ internal async Task ApplySmoothResults(Vector3[] newMesh, string renderKey, Skin
}


//Stop the smoothing timer when done with threads
//TODO fix this with tasks
internal void CheckForEndOfSmoothing()
{
//Stop updating GUI count when done
// if (threading.ThreadCount == 0) PregnancyPlusGui.StopTextCountIncrement();
}


}
}

Expand Down

0 comments on commit a86ab04

Please sign in to comment.