# HG changeset patch # User Tess Snider # Date 2021-07-26 08:16:19 # Node ID 8ee5f618b07c9da846f30fa391d11aafa5b5baa7 # Parent e9358d0228ac89151dfb11f4bbd61d2e74562785 # Parent 4778889395e801ac4d7e7171ce39ed8c8c6ed749 Merge diff --git a/ViewModels/RecipeGeneratorViewModel.cs b/ViewModels/RecipeGeneratorViewModel.cs --- a/ViewModels/RecipeGeneratorViewModel.cs +++ b/ViewModels/RecipeGeneratorViewModel.cs @@ -13,7 +13,7 @@ namespace DesertPaintCodex.ViewModels { public class RecipeGeneratorViewModel : ViewModelBase { - private const long UpdateInterval = 2000; // ms + private const long UpdateInterval = 200; // ms private const long SaveInterval = 30000; // ms private const string PaintStateFile = "dp_generator_state"; private const string RibbonStateFile = "dp_generator_ribbon_state"; @@ -24,8 +24,8 @@ namespace DesertPaintCodex.ViewModels private float _progress = 0; public float Progress { get => _progress; private set => this.RaiseAndSetIfChanged(ref _progress, value); } - private int _permutationCount = 0; - public int PermutationCount { get => _permutationCount; private set => this.RaiseAndSetIfChanged(ref _permutationCount, value); } + private string _permutationCount = "0"; + public string PermutationCount { get => _permutationCount; private set => this.RaiseAndSetIfChanged(ref _permutationCount, value); } private DateTime _mostRecentTime; @@ -242,17 +242,18 @@ namespace DesertPaintCodex.ViewModels if (System.IO.File.Exists(stateFile)) { _generator.LoadState(stateFile); - + + // Always set these, or the values will be invalid + MaxReagents = (int)_generator.MaxReagents; + MaxConcentration = (int)_generator.MaxConcentration; + FullQuantity = (int)_generator.FullQuantity; + FullQuantityDepth = (int)_generator.FullQuantityDepth; + if (_generator.CanResume) { IsInProgress = true; IsPaused = true; - MaxReagents = (int) _generator.MaxReagents; - MaxConcentration = (int) _generator.MaxConcentration; - FullQuantity = (int) _generator.FullQuantity; - FullQuantityDepth = (int) _generator.FullQuantityDepth; - SaveSettings(mode); } else @@ -324,9 +325,9 @@ namespace DesertPaintCodex.ViewModels _updatesAvailable = false; DateTime now = DateTime.Now; - + // Update test count. - PermutationCount = _newRecipeCount; + PermutationCount = $"{_newRecipeCount:n0}"; // Pull in new recipes. if (!_pendingNewRecipes.IsEmpty)