@@ -21,19 +21,21 @@ protected void Awake()
2121 Save ( ) ;
2222 }
2323
24- protected Section Profile ( string profileName )
24+ protected Dictionary < string , object > Profile ( string profileName )
2525 {
26- return Config . GetOrCreate ( profileName , new Section ( ) ) ;
26+ Mod . Log . LogInfo ( "Assigning Profile Name..." ) ;
27+ return Config . GetOrCreate ( profileName , new Dictionary < string , object > ( ) ) ;
2728 }
2829
29- protected Section Vehicle ( string profileName , string vehicleName )
30+ protected Dictionary < string , object > Vehicle ( string profileName , string vehicleName )
3031 {
31- return Profile ( profileName ) . GetOrCreate ( vehicleName , new Section ( ) ) ;
32+ Mod . Log . LogInfo ( "Assigning Vehicle Name..." ) ;
33+ return Profile ( profileName ) . GetOrCreate ( vehicleName , new Dictionary < string , object > ( ) ) ;
3234 }
3335
3436 protected CarColors GetCarColors ( string profileName , string vehicleName )
3537 {
36- Section vehicle = Vehicle ( profileName , vehicleName ) ;
38+ Dictionary < string , object > vehicle = Vehicle ( profileName , vehicleName ) ;
3739 CarColors colors = new CarColors
3840 {
3941 primary_ = GetColor ( vehicle , "primary" , Colors . whiteSmoke ) ,
@@ -45,28 +47,29 @@ protected CarColors GetCarColors(string profileName, string vehicleName)
4547 return colors ;
4648 }
4749
48- protected Color GetColor ( Section vehicle , string category , Color defaultColor )
50+ protected Color GetColor ( Dictionary < string , object > vehicle , string category , Color defaultColor )
4951 {
50- Section color = vehicle . GetOrCreate ( category , new Section ( ) ) ;
52+ //Mod.Log.LogWarning(e);
53+ Dictionary < string , object > color = vehicle . GetOrCreate ( category , new Dictionary < string , object > ( ) ) ;
5154
52- var r = color . GetOrCreate ( "r" , defaultColor . r ) ;
53- var g = color . GetOrCreate ( "g" , defaultColor . g ) ;
54- var b = color . GetOrCreate ( "b" , defaultColor . b ) ;
55- var a = color . GetOrCreate ( "a" , defaultColor . a ) ;
55+ float r = color . GetOrCreate ( "r" , defaultColor . r ) ;
56+ float g = color . GetOrCreate ( "g" , defaultColor . g ) ;
57+ float b = color . GetOrCreate ( "b" , defaultColor . b ) ;
58+ float a = color . GetOrCreate ( "a" , defaultColor . a ) ;
5659
57- return new Color ( r , g , b , a ) ;
60+ return new Color ( r , g , b , a ) ;
5861 }
5962
6063 protected void SetCarColors ( string profileName , string vehicleName , CarColors colors )
6164 {
62- Section vehicle = Vehicle ( profileName , vehicleName ) ;
65+ Dictionary < string , object > vehicle = Vehicle ( profileName , vehicleName ) ;
6366
6467 vehicle [ "primary" ] = ToSection ( colors . primary_ ) ;
6568 vehicle [ "secondary" ] = ToSection ( colors . secondary_ ) ;
6669 vehicle [ "glow" ] = ToSection ( colors . glow_ ) ;
6770 vehicle [ "sparkle" ] = ToSection ( colors . sparkle_ ) ;
6871
69- Section profile = Profile ( profileName ) ;
72+ Dictionary < string , object > profile = Profile ( profileName ) ;
7073 profile [ vehicleName ] = vehicle ;
7174
7275 Config [ profileName ] = profile ;
@@ -108,7 +111,9 @@ public void LoadAll()
108111 }
109112
110113 CarInfo carInfo = profileManager . CarInfos_ [ carIndex ] ;
114+ Mod . Log . LogInfo ( $ "Getting car color in { currentProfile . FileName_ } 's profile for the { carInfo . name_ } car") ;
111115 CarColors colors = GetCarColors ( currentProfile . FileName_ , carInfo . name_ ) ;
116+
112117
113118 carColors [ carIndex ] = colors ;
114119 }
0 commit comments