public TextStyling(Graphics graphics, TextStyling previousStyle, CustomJPrototypeResolver resolver, JObject prototype)
     : this(graphics,
            resolver.GetStringOrDefault(prototype, "Font", previousStyle.FontName),
            resolver.GetIntOrDefault(prototype, "FontSize", previousStyle.FontSize),
            resolver.GetFlagsEnumOrDefault(prototype, "FontStyle", previousStyle.FontStyle),
            resolver.GetColorOrDefault(prototype, "Color", previousStyle.Color),
            resolver.GetColorOrDefault(prototype, "BackgroundColor", previousStyle.BackgroundColor),
            resolver.GetColorOrDefault(prototype, "BackgroundBorderColor", previousStyle.BackgroundBorderColor),
            resolver.GetIntOrDefault(prototype, "BackgroundBorderThickness", previousStyle.BackgroundBorderThickness),
            resolver.GetColorOrDefault(prototype, "OutlineColor", previousStyle.OutlineColor),
            resolver.GetIntOrDefault(prototype, "OutlineThickness", previousStyle.OutlineThickness))
 {
 }
Ejemplo n.º 2
0
        private string GetSavePath(CustomJPrototypeResolver resolver, JObject instructions, JObject blueprint, string instructionsDir, string savePath, string saveName, int item, HashSet <string> savedPaths)
        {
            var extension = resolver.GetStringOrDefault(blueprint, "SavePathExtension", "");
            var path      = saveName.Contains("~")
                ? PathX.Build(instructionsDir, savePath + extension, $"{resolver.GetString(instructions, "SaveName")}.png")
                : PathX.Build(instructionsDir, savePath + extension, $"{saveName}{item}.png");

            if (savedPaths.Contains(path))
            {
                Console.WriteLine($"Duplicate Save Path Detected: {path}");
                throw new ArgumentException();
            }
            savedPaths.Add(path);
            return(path);
        }