Changeset - 62d349a8db2f
[Not reviewed]
Jason Maltzen - 11 months 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
...
 
@@ -647,17 +647,21 @@ namespace DesertPaintCodex.Models
 
                {
 
                    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
 
                    }
 
                }
 
            }
0 comments (0 inline, 0 general)