public static async Task <bool> Replace(CarObject car)
        {
            var maxRpm = car.AcdData?.GetIniFile("engine.ini")["ENGINE_DATA"].GetFloat("LIMITER", 0) ?? car.GetRpmMaxValue();

            Logging.Debug(maxRpm);

            var donor = SelectCarDialog.Show(double.IsNaN(maxRpm) || maxRpm < 1000 ? null : $"maxrpm≥{maxRpm - RpmLimiterThreshold:F0} & kunos+");

            if (donor == null)
            {
                return(false);
            }

            await car.ReplaceSound(donor);

            return(true);
        }
Exemple #2
0
        private void OnCarClick(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton != MouseButton.Left || e.ClickCount != 2)
            {
                return;
            }

            if (((FrameworkElement)sender).DataContext is ServerPresetDriverEntry entry)
            {
                var skin     = entry.CarSkinObject;
                var selected = SelectCarDialog.Show(entry.CarObject, ref skin);
                if (selected != null)
                {
                    entry.CarObject     = selected;
                    entry.CarSkinObject = skin;
                }
            }

            e.Handled = true;
        }
Exemple #3
0
 protected override Uri GetPageAddress(SelectRating category)
 {
     return(category.Rating == null?SelectCarDialog.FavouritesUri() : SelectCarDialog.RatingUri(category.Rating.Value));
 }
Exemple #4
0
 protected override Uri GetPageAddress(SelectTag category)
 {
     return(SelectCarDialog.TagUri(category.TagValue));
 }
Exemple #5
0
 protected override Uri GetPageAddress(SelectCarBrand category)
 {
     return(SelectCarDialog.BrandUri(category.DisplayName));
 }
Exemple #6
0
 protected override Uri GetPageAddress(SelectCountry category)
 {
     return(SelectCarDialog.CountryUri(category.DisplayName));
 }