Beispiel #1
0
        private PaintShopOverrideBase GetOverride(PaintShopDestination name)
        {
            var replacement = Replacements.GetValueOrDefault(name);

            return(new PaintShopOverrideTint {
                Colors = Colors.DrawingColors,
                Alpha = ValueAdjustment.Same,
                Source = replacement?.Source,
                Mask = replacement?.Mask,
                Overlay = replacement?.Overlay
            });
        }
Beispiel #2
0
        public CarPaint SetDetailsParams(PaintShopDestination detailsTexture, bool supportFlakes = true, int flakesSize = 512,
                                         bool colorAvailable = true, Color?defaultColor = null, Dictionary <string, CarPaintReplacementSource> replacements = null)
        {
            FlakesSize        = flakesSize;
            SupportsFlakes    = supportFlakes && flakesSize > 0;
            ColorAvailable    = colorAvailable;
            DetailsTexture    = detailsTexture;
            DefaultColor      = defaultColor ?? Color.FromRgb(255, 255, 255);
            ColorReplacements = replacements?.If(colorAvailable, x => x.Prepend(new KeyValuePair <string, CarPaintReplacementSource>("Solid color", null)))
                                .ToDictionary(x => x.Key, x => x.Value);

            if (ColorReplacements != null)
            {
                ColorReplacementValue = ColorReplacements.FirstOrDefault();
            }
            else
            {
                UpdateFlakesAllowed();
                UpdateColorAllowed();
            }

            return(this);
        }
Beispiel #3
0
 public ColoredItem([NotNull, Localizable(false)] PaintShopDestination diffuseTexture, [NotNull] CarPaintColors colors)
     : this(new Dictionary <PaintShopDestination, PaintShop.TintedEntry> {
     [diffuseTexture] = new PaintShop.TintedEntry(PaintShopSource.White, null, null)
 }, colors)
 {
 }
Beispiel #4
0
 public ColoredItem([NotNull, Localizable(false)] PaintShopDestination diffuseTexture, Color defaultColor)
     : this(diffuseTexture, new CarPaintColors(defaultColor))
 {
 }
Beispiel #5
0
 public TintedWindows([Localizable(false)] PaintShopDestination diffuseTexture, CarPaintColors colors, double defaultAlpha = 0.23, bool fixedColor = false)
     : base(diffuseTexture, colors)
 {
     DefaultAlpha = defaultAlpha;
     FixedColor   = fixedColor;
 }
Beispiel #6
0
 public TintedWindows([Localizable(false)] PaintShopDestination diffuseTexture, Color?defaultColor = null, double defaultAlpha = 0.23,
                      bool fixedColor = false) : base(diffuseTexture, defaultColor ?? Color.FromRgb(41, 52, 55))
 {
     DefaultAlpha = defaultAlpha;
     FixedColor   = fixedColor;
 }
Beispiel #7
0
 private PaintShopOverrideBase GetOverride(PaintShopDestination name)
 {
     return(new PaintShopOverrideWithColor {
         Color = _color.ToColor((_opacity * 255).ClampToByte())
     });
 }
Beispiel #8
0
 private PaintShopOverrideBase GetOverride(PaintShopDestination name)
 {
     return(new PaintShopOverrideWithTexture {
         Source = _replacements.GetValueOrDefault(name)
     });
 }
Beispiel #9
0
 public ComplexCarPaint([Localizable(false)] PaintShopDestination mapsTexture, [NotNull] PaintShopSource mapsSource, [CanBeNull] PaintShopSource mapsMask)
 {
     MapsTexture        = mapsTexture;
     MapsMask           = mapsMask;
     MapsDefaultTexture = mapsSource;
 }