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); }
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; }
protected override Uri GetPageAddress(SelectRating category) { return(category.Rating == null?SelectCarDialog.FavouritesUri() : SelectCarDialog.RatingUri(category.Rating.Value)); }
protected override Uri GetPageAddress(SelectTag category) { return(SelectCarDialog.TagUri(category.TagValue)); }
protected override Uri GetPageAddress(SelectCarBrand category) { return(SelectCarDialog.BrandUri(category.DisplayName)); }
protected override Uri GetPageAddress(SelectCountry category) { return(SelectCarDialog.CountryUri(category.DisplayName)); }