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.SetParameter("Car" + i, DesiredCarList[i].userSettings.engineSound, "CARS"); } } } audiocars_ini.SetParameter("Car1_LowShelfAmp", "2.0", "CARS"); audiocars_ini.SpaceBeforeAndAfterEquals = false; audiocars_ini.Save(); }
private void WriteCarListUserINI() { //copy back to Cars foreach (Car d in DesiredCarList) { int i = AllCars.FindIndex(x => x.nr == d.nr); if (i == -1) { continue; } AllCars[i] = d; } //write carListUser.ini for all cars in carList.ini INIFile carListUserINI = new INIFile(); foreach (Car c in AllCars) { carListUserINI.SetParameter("engineSound", c.userSettings.engineSound, "Car_" + c.nr); carListUserINI.SetParameter("FMODSoundBank", c.userSettings.FMODSoundBank, "Car_" + c.nr); carListUserINI.SetParameter("hideSteeringWheel", c.userSettings.hideSteeringWheel.ToString(), "Car_" + c.nr); carListUserINI.SetParameter("hideWipers", c.userSettings.hideWipers.ToString(), "Car_" + c.nr); carListUserINI.SetParameter("hideWindShield", c.userSettings.hideWindShield.ToString(), "Car_" + c.nr); } carListUserINI.SaveAs("RBRCIT\\carListUser.ini"); }
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.SetParameter("FileName", string.Format("Cars\\{0}\\{1}.sgc", c.folder, c.iniFile), section); carsINI.SetParameter("IniFile", string.Format("Cars\\{0}\\{1}.ini", c.folder, c.iniFile), section); carsINI.SetParameter("ShaderFile", string.Format("Cars\\{0}\\{1}_shaders.ini", c.folder, c.iniFile), section); carsINI.SetParameter("ShaderSettings", string.Format("Cars\\{0}\\{1}_shader_settings", c.folder, c.iniFile), section); carsINI.SetParameter("TexturePath", string.Format("Cars\\{0}\\Textures", c.folder), section); carsINI.SetParameter("CarName", c.manufacturer + " " + c.name, section); } carsINI.Save(); }