Exemple #1
0
        public string GetAudioFMOD_URL()
        {
            string result = IniFileHelper.ReadValue("Misc", "audio_fmod_url", FILEPATH_CARLIST_INI);

            return(result);
        }
Exemple #2
0
        public string GetAudioFMODVersion()
        {
            string result = IniFileHelper.ReadValue("Versions", "AudioFMOD", FILEPATH_VERSIONS_INI);

            return(result);
        }
Exemple #3
0
        public bool GetFMODStatusEnabled()
        {
            string value = IniFileHelper.ReadValue("Settings", "enableFMOD", FILEPATH_AUDIO_FMOD_INI, "false");

            return(bool.Parse(value));
        }
Exemple #4
0
 public void SetFMODEnabled(bool status)
 {
     IniFileHelper.WriteValue("Settings", "enableFMOD", status.ToString(), FILEPATH_AUDIO_FMOD_INI);
     FMODEnabled = status;
     mainForm.UpdateFMODPanel();
 }
Exemple #5
0
        public void LoadCurrentCars()
        {
            CurrentCarList.Clear();
            DesiredCarList.Clear();
            string pathToCarsINI = "Cars\\Cars.ini";

            if (!File.Exists(pathToCarsINI))
            {
                MessageBox.Show(pathToCarsINI + " could not be found. Please make sure you start this tool " +
                                "from your RBR installation folder and that there is a Cars.ini file in \\Cars. Exiting.");
                Environment.Exit(-1);
                return;
            }
            INIFile CarsINI = new INIFile(pathToCarsINI);

            foreach (string section in CarsINI.GetSections())
            {
                string CarName = CarsINI.GetParameterValue("CarName", section);
                Car    c;
                if (CarName == null)
                {
                    string FileName = CarsINI.GetParameterValue("FileName", section);
                    string carNr    = "";
                    if (FileName.Contains("\\xsara\\"))
                    {
                        carNr = "1";
                    }
                    if (FileName.Contains("\\accent\\"))
                    {
                        carNr = "2";
                    }
                    if (FileName.Contains("\\zr\\"))
                    {
                        carNr = "3";
                    }
                    if (FileName.Contains("\\Lancer_EVO_VII\\"))
                    {
                        carNr = "4";
                    }
                    if (FileName.Contains("\\Peugeot_206\\"))
                    {
                        carNr = "5";
                    }
                    if (FileName.Contains("\\impreza03\\"))
                    {
                        carNr = "6";
                    }
                    if (FileName.Contains("\\Corolla\\"))
                    {
                        carNr = "7";
                    }
                    if (FileName.Contains("\\impreza00\\"))
                    {
                        carNr = "8";
                    }
                    c = AllCars.Find(x => x.nr == carNr);
                }
                else
                {
                    c = AllCars.Find(x => (x.manufacturer + " " + x.name) == CarName);
                    if (c.name == null)
                    {
                        c.name = CarName;
                    }
                }

                //read user settings (hide parts etc.)
                string file = "Cars\\" + c.folder + "\\" + c.iniFile + ".ini";
                if (File.Exists(file))
                {
                    INIFile carini = new INIFile("Cars\\" + c.folder + "\\" + c.iniFile + ".ini");
                    c.userSettings.hideSteeringWheel = carini.GetParameterValueBool("Switch", "i_steeringwheel");
                    c.userSettings.hideWipers        = carini.GetParameterValueBool("Switch", "i_wiper_l") && carini.GetParameterValueBool("Switch", "i_wiper_r");
                    c.userSettings.hideWindShield    = carini.GetParameterValueBool("Switch", "i_window_f");
                }

                CurrentCarList.Add(c);
            }

            //read current engine sounds
            if (UseAudio)
            {
                INIFile AudioCarsINI = new INIFile("Audio\\Cars\\Cars.ini");
                for (int i = 0; i < 8; i++)
                {
                    string sound = AudioCarsINI.GetParameterValue("Car" + i, "CARS");
                    Car    c     = CurrentCarList[i];
                    c.userSettings.engineSound = sound;
                    CurrentCarList[i]          = c;
                }
            }


            //read current FMOD Sound Banks
            if (FMODAvailable)
            {
                for (int i = 0; i < 8; i++)
                {
                    string FMODSoundBank = IniFileHelper.ReadValue("Car" + i.ToString("00"), "bankName", "AudioFMOD\\AudioFMOD.ini");
                    Car    c             = CurrentCarList[i];
                    c.userSettings.FMODSoundBank = FMODSoundBank;
                    CurrentCarList[i]            = c;
                }
            }

            DesiredCarList = new List <Car>(CurrentCarList.ToArray());
            mainForm.UpdateCurrentCars();
        }