Example #1
0
 public ColoredItem(Dictionary <string, TintedEntry> replacements, CarPaintColors colors) : base(false)
 {
     Replacements            = replacements;
     Colors                  = colors;
     Colors.PropertyChanged += OnColorsChanged;
     AffectedTextures.AddRange(Replacements.Keys);
 }
Example #2
0
 public Replacement([NotNull] string[] textures, [NotNull] Dictionary <string, PaintShopSource> replacements) : base(false)
 {
     _textures    = textures;
     Replacements = replacements;
     Value        = Replacements.FirstOrDefault();
     AffectedTextures.AddRange(_textures);
 }
Example #3
0
 public SolidColorIfFlagged([NotNull] string[] textures, bool inverse, Color color, double opacity = 1d) : base(false)
 {
     _textures = textures;
     _inverse  = inverse;
     _color    = color;
     _opacity  = opacity;
     AffectedTextures.AddRange(textures);
 }
Example #4
0
 public ComplexCarPaint([Localizable(false)] string detailsTexture, int flakesSize, [Localizable(false)] string mapsTexture,
                        [NotNull] PaintShopSource mapsSource, [CanBeNull] PaintShopSource mapsMask, Color?defaultColor = null)
     : base(detailsTexture, flakesSize, defaultColor)
 {
     MapsTexture        = mapsTexture;
     MapsMask           = mapsMask;
     MapsDefaultTexture = mapsSource;
     AffectedTextures.Add(mapsTexture);
 }
Example #5
0
 public void SetPatterns(string patternTexture, PaintShopSource patternBase, [CanBeNull] PaintShopSource patternOverlay,
                         IEnumerable <CarPaintPattern> patterns)
 {
     PatternTexture = patternTexture;
     PatternBase    = patternBase;
     PatternOverlay = patternOverlay;
     Patterns.ReplaceEverythingBy(patterns.Prepend(new CarPaintPattern("Nothing", PaintShopSource.Transparent, null, new CarPaintColors())));
     CurrentPattern  = Patterns[0];
     _patternChanged = true;
     AffectedTextures.Add(patternTexture);
 }
Example #6
0
 public CarPaint(string detailsTexture, int flakesSize = 256, Color?defaultColor = null) : base(true)
 {
     LiveryPriority = 1;
     FlakesSize     = flakesSize;
     SupportsFlakes = flakesSize > 0;
     DetailsTexture = detailsTexture;
     DefaultColor   = defaultColor ?? Color.FromRgb(255, 255, 255);
     Patterns       = new ChangeableObservableCollection <CarPaintPattern>();
     Patterns.ItemPropertyChanged += OnPatternChanged;
     AffectedTextures.Add(detailsTexture);
 }
Example #7
0
 public MultiReplacement(Dictionary <string, Dictionary <string, PaintShopSource> > replacements) : base(false)
 {
     Replacements = replacements;
     Value        = Replacements.FirstOrDefault();
     AffectedTextures.AddRange(Replacements.Values.SelectMany(x => x.Keys));
 }
Example #8
0
 public ReplacedIfFlagged(bool inverse, [NotNull] Dictionary <string, PaintShopSource> replacements) : base(false)
 {
     _inverse      = inverse;
     _replacements = replacements;
     AffectedTextures.AddRange(_replacements.Keys);
 }