private void WriteAudioCarsINI() { if (!UseAudio) { return; } INIFile audiocars_ini = new INIFile("Audio\\Cars\\Cars.ini"); for (int i = 0; i < 8; i++) { if (DesiredCarList[i].userSettings.Equals(CurrentCarList[i].userSettings)) { continue; } if (DesiredCarList[i].userSettings.engineSound != null) { if (File.Exists("Audio\\Cars\\" + DesiredCarList[i].userSettings.engineSound + ".eng")) { audiocars_ini.ChangeParameter("Car" + i, DesiredCarList[i].userSettings.engineSound, "CARS"); } } } audiocars_ini.ChangeParameter("Car1_LowShelfAmp", "2.0", "CARS"); audiocars_ini.SpaceBeforeAndAfterEquals = false; audiocars_ini.Save(); }
private void ApplyUserSettings() { for (int i = 0; i < 8; i++) { //if (DesiredCarList[i].userSettings.Equals(CurrentCarList[i].userSettings)) continue; Car c = DesiredCarList[i]; string filename = "Cars\\" + c.folder + "\\" + c.iniFile + ".ini"; new FileInfo(filename).IsReadOnly = false; INIFile carini = new INIFile(filename); carini.ChangeParameter("Switch", c.userSettings.hideSteeringWheel.ToString(), "i_steeringwheel"); carini.ChangeParameter("Switch", c.userSettings.hideWipers.ToString(), "i_wiper_l"); carini.ChangeParameter("Switch", c.userSettings.hideWipers.ToString(), "i_wiper_r"); carini.ChangeParameter("Switch", c.userSettings.hideWindShield.ToString(), "i_window_f"); //apply the overrides defined in RBRCIT.ini (AlwaysHideXXX...) if (rbrcit_ini.GetParameterValueBool("AlwaysHideSteeringWheel")) { carini.ChangeParameter("Switch", "true", "i_steeringwheel"); } if (rbrcit_ini.GetParameterValueBool("AlwaysHideWipers")) { carini.ChangeParameter("Switch", "true", "i_wiper_l"); carini.ChangeParameter("Switch", "true", "i_wiper_r"); } if (rbrcit_ini.GetParameterValueBool("AlwaysHideWindShield")) { carini.ChangeParameter("Switch", "true", "i_window_f"); } carini.SpaceBeforeAndAfterEquals = false; carini.Save(); } }
private void WriteCarsINI() { FileInfo fi = new FileInfo("Cars\\cars.ini"); fi.IsReadOnly = false; INIFile carsINI = new INIFile("Cars\\cars.ini"); for (int i = 0; i < 8; i++) { if (DesiredCarList[i].Equals(CurrentCarList[i])) { continue; } Car c = DesiredCarList[i]; string section = "Car0" + i; carsINI.ChangeParameter("FileName", string.Format("Cars\\{0}\\{1}.sgc", c.folder, c.iniFile), section); carsINI.ChangeParameter("IniFile", string.Format("Cars\\{0}\\{1}.ini", c.folder, c.iniFile), section); carsINI.ChangeParameter("ShaderFile", string.Format("Cars\\{0}\\{1}_shaders.ini", c.folder, c.iniFile), section); carsINI.ChangeParameter("ShaderSettings", string.Format("Cars\\{0}\\{1}_shader_settings", c.folder, c.iniFile), section); carsINI.ChangeParameter("TexturePath", string.Format("Cars\\{0}\\Textures", c.folder), section); carsINI.AddOrChangeParameter("CarName", c.manufacturer + " " + c.name, section); } carsINI.Save(); }