From e904260f0346ca1efe9095ae5ae61a4020f154ec Mon Sep 17 00:00:00 2001 From: Reherc Date: Fri, 25 Dec 2020 16:14:20 +0100 Subject: [PATCH] Fixed issue where mod would load primary car color as secondary --- Distance.CustomCar/ProfileCarColors.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Distance.CustomCar/ProfileCarColors.cs b/Distance.CustomCar/ProfileCarColors.cs index 4a73405..90b562c 100644 --- a/Distance.CustomCar/ProfileCarColors.cs +++ b/Distance.CustomCar/ProfileCarColors.cs @@ -19,21 +19,18 @@ protected void Load() protected void Awake() { Load(); - Save(); } protected Section Profile(string profileName) { Section profile = Config.GetOrCreate(profileName, new Section()); - Save(); return profile; } protected Section Vehicle(string profileName, string vehicleName) { Section vehicle = Profile(profileName).GetOrCreate(vehicleName, new Section()); - Save(); return vehicle; } @@ -43,12 +40,11 @@ protected CarColors GetCarColors(string profileName, string vehicleName) CarColors colors = new CarColors { primary_ = GetColor(vehicle, "primary", Colors.whiteSmoke), - secondary_ = GetColor(vehicle, "primary", Colors.darkGray), + secondary_ = GetColor(vehicle, "secondary", Colors.darkGray), glow_ = GetColor(vehicle, "glow", Colors.cyan), sparkle_ = GetColor(vehicle, "sparkle", Colors.lightSlateGray) }; SetCarColors(profileName, vehicleName, colors); - Save(); return colors; } @@ -77,8 +73,6 @@ protected void SetCarColors(string profileName, string vehicleName, CarColors co profile[vehicleName] = vehicle; Config[profileName] = profile; - - Save(); } protected Section ToSection(Color color) @@ -90,7 +84,6 @@ protected Section ToSection(Color color) ["b"] = color.b, ["a"] = color.a }; - Save(); return section; } @@ -148,6 +141,8 @@ public void SaveAll() SetCarColors(currentProfile.FileName_, carInfo.name_, colors); } } + + Save(); } } }