Changeset - 4778889395e8
[Not reviewed]
default
0 1 0
Jason Maltzen - 3 years ago 2021-07-25 03:17:12
jason@hiddenachievement.com
Change the displayed permeutation count to display using locale-specific number formatting (with comma / dot separators). Fix a crash when starting a new round of recipe generation after recipe generation completed during a previous run.
1 file changed with 12 insertions and 11 deletions:
0 comments (0 inline, 0 general)
ViewModels/RecipeGeneratorViewModel.cs
Show inline comments
...
 
@@ -14,5 +14,5 @@ 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";
...
 
@@ -25,6 +25,6 @@ namespace DesertPaintCodex.ViewModels
 
        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); }
 
        
 

	
...
 
@@ -243,5 +243,11 @@ namespace DesertPaintCodex.ViewModels
 
            {
 
                _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)
 
                {
...
 
@@ -249,9 +255,4 @@ namespace DesertPaintCodex.ViewModels
 
                    IsPaused = true;
 

	
 
                    MaxReagents       = (int) _generator.MaxReagents;
 
                    MaxConcentration  = (int) _generator.MaxConcentration;
 
                    FullQuantity      = (int) _generator.FullQuantity;
 
                    FullQuantityDepth = (int) _generator.FullQuantityDepth;
 
                    
 
                    SaveSettings(mode);
 
                }
...
 
@@ -325,7 +326,7 @@ namespace DesertPaintCodex.ViewModels
 

	
 
            DateTime now = DateTime.Now;
 
            
 

 
            // Update test count.
 
            PermutationCount = _newRecipeCount;
 
            PermutationCount = $"{_newRecipeCount:n0}";
 
            
 
            // Pull in new recipes.
0 comments (0 inline, 0 general)