コード例 #1
0
        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);
        }
コード例 #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;
        }
コード例 #3
0
 protected override Uri GetPageAddress(SelectRating category)
 {
     return(category.Rating == null?SelectCarDialog.FavouritesUri() : SelectCarDialog.RatingUri(category.Rating.Value));
 }
コード例 #4
0
 protected override Uri GetPageAddress(SelectTag category)
 {
     return(SelectCarDialog.TagUri(category.TagValue));
 }
コード例 #5
0
ファイル: CarBrands.xaml.cs プロジェクト: windygu/actools
 protected override Uri GetPageAddress(SelectCarBrand category)
 {
     return(SelectCarDialog.BrandUri(category.DisplayName));
 }
コード例 #6
0
ファイル: CarCountries.xaml.cs プロジェクト: windygu/actools
 protected override Uri GetPageAddress(SelectCountry category)
 {
     return(SelectCarDialog.CountryUri(category.DisplayName));
 }