Esempio n. 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
            });
        }
Esempio n. 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);
        }
Esempio n. 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)
 {
 }
Esempio n. 4
0
 public ColoredItem([NotNull, Localizable(false)] PaintShopDestination diffuseTexture, Color defaultColor)
     : this(diffuseTexture, new CarPaintColors(defaultColor))
 {
 }
Esempio n. 5
0
 public TintedWindows([Localizable(false)] PaintShopDestination diffuseTexture, CarPaintColors colors, double defaultAlpha = 0.23, bool fixedColor = false)
     : base(diffuseTexture, colors)
 {
     DefaultAlpha = defaultAlpha;
     FixedColor   = fixedColor;
 }
Esempio n. 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;
 }
Esempio n. 7
0
 private PaintShopOverrideBase GetOverride(PaintShopDestination name)
 {
     return(new PaintShopOverrideWithColor {
         Color = _color.ToColor((_opacity * 255).ClampToByte())
     });
 }
Esempio n. 8
0
 private PaintShopOverrideBase GetOverride(PaintShopDestination name)
 {
     return(new PaintShopOverrideWithTexture {
         Source = _replacements.GetValueOrDefault(name)
     });
 }
Esempio n. 9
0
 public ComplexCarPaint([Localizable(false)] PaintShopDestination mapsTexture, [NotNull] PaintShopSource mapsSource, [CanBeNull] PaintShopSource mapsMask)
 {
     MapsTexture        = mapsTexture;
     MapsMask           = mapsMask;
     MapsDefaultTexture = mapsSource;
 }