public ColoredItem(Dictionary <string, TintedEntry> replacements, CarPaintColors colors) : base(false) { Replacements = replacements; Colors = colors; Colors.PropertyChanged += OnColorsChanged; AffectedTextures.AddRange(Replacements.Keys); }
public CarPaintPattern(string name, [NotNull] PaintShopSource source, [CanBeNull] PaintShopSource overlay, CarPaintColors colors) { DisplayName = name; Source = source; Overlay = overlay; Colors = colors; colors.PropertyChanged += OnColorsChanged; }
protected void DeserializeColors([NotNull] CarPaintColors target, JObject data, string key) { var colors = (data?[key] as JArray)?.ToObject <string[]>(); if (colors != null) { for (var i = 0; i < colors.Length && i < target.Colors.Length; i++) { target.Colors[i].Value = colors[i].ToColor() ?? Colors.White; } } }
public TintedWindows(Dictionary <string, TintedEntry> replacements, CarPaintColors colors, double defaultAlpha = 0.23, bool fixedColor = false) : base(replacements, colors) { DefaultAlpha = defaultAlpha; FixedColor = fixedColor; }
public TintedWindows([Localizable(false)] string diffuseTexture, CarPaintColors colors, double defaultAlpha = 0.23, bool fixedColor = false) : base(diffuseTexture, colors) { DefaultAlpha = defaultAlpha; FixedColor = fixedColor; }
public ColoredItem([Localizable(false)] string diffuseTexture, CarPaintColors colors) : this(new Dictionary <string, TintedEntry> { [diffuseTexture] = new TintedEntry(PaintShopSource.White, null, null) }, colors) { }
protected JArray SerializeColors([CanBeNull] CarPaintColors target) { return(target == null ? null : JArray.FromObject(target.ActualColors.Select(x => x.ToHexString()))); }