Changeset - 62d349a8db2f
[Not reviewed]
Jason Maltzen - 3 years ago 2021-08-27 21:58:31
jason@hiddenachievement.com
Fix the PaintMix export format - use the PracticalPaint internal names for ingredients, and remove excess whitespace. Also, don't export a recipe for colors that don't have a recipe.
1 file changed with 10 insertions and 6 deletions:
0 comments (0 inline, 0 general)
Models/PlayerProfile.cs
Show inline comments
...
 
@@ -644,23 +644,27 @@ namespace DesertPaintCodex.Models
 
            using (writer)
 
            {
 
                foreach (PaintColor color in PaletteService.Colors)
 
                {
 
                    if (recipeDict.TryGetValue(color.Name, out PaintRecipe? recipe))
 
                    {
 
                        string colorLine = $"{color.Name} : ";
 
                        foreach (PaintRecipe.ReagentQuantity ingredient in recipe.Reagents)
 
                        if (recipe.Reagents.Count > 0)
 
                        {
 
                            colorLine += $" {ingredient.Name} {ingredient.Quantity}";
 
                            string colorLine = $"{color.Name} :";
 
                            foreach (PaintRecipe.ReagentQuantity ingredient in recipe.Reagents)
 
                            {
 
                                Reagent reagent = ReagentService.GetReagent(ingredient.Name);
 
                                colorLine += $" {reagent.PracticalPaintName} {ingredient.Quantity}";
 
                            }
 
                            colorLine += $" - #{color.Red:X2}{color.Green:X2}{color.Blue:X2}";
 
                            writer.WriteLine(colorLine);
 
                        }
 
                        colorLine += $"  - #{color.Red:X2}{color.Green:X2}{color.Blue:X2}";
 
                        writer.WriteLine(colorLine);
 
                    }
 
                    else
 
                    {
 
                        // no recipe
 
                        // no recipe - skip
 
                    }
 
                }
 
            }
 
        }
 

	
 
        public Reaction? FindReaction(Reagent? reagent1, Reagent? reagent2)
0 comments (0 inline, 0 general)