public override void GetSettings(ProjectModel.Properties headerSettings) { base.GetSettings(headerSettings); headerSettings["DiscardRedundant"] = DiscardRedundantTiles ? "1" : "0"; headerSettings["ReducePalette"] = ReducePalette ? "1" : "0"; headerSettings["ExportPalette"] = ExportPalette ? "1" : "0"; headerSettings["ChrType"] = Type.ToString(); headerSettings["Palette"] = SerializePalette(PaletteAssignment); if (TilePalettes != null) { headerSettings["TilePalettes"] = string.Join(":", TilePalettes.Select(SerializePalette)); } }
public void SetSettings(ProjectModel.Properties headerSettings) { DiscardRedundantTiles = (headerSettings["DiscardRedundant"] == "1"); ReducePalette = (headerSettings["ReducePalette"] == "1"); ExportPalette = (headerSettings["ExportPalette"] == "1"); Enum.TryParse(headerSettings["ChrType"], true, out Type); if (!string.IsNullOrWhiteSpace(headerSettings["Palette"])) { PaletteAssignment = DeserializePalette(headerSettings["Palette"]); } if (!string.IsNullOrWhiteSpace(headerSettings["TilePalettes"])) { TilePalettes = headerSettings["TilePalettes"].Split(':').Select(DeserializePalette).ToList(); } }
public override DataPipeline Clone(bool toEditor = false) { Func <string, string> convertFilePath = (s) => Path.Combine(File.Project.Directory.FullName, s); if (toEditor) { convertFilePath = (s) => File.Project.GetRelativePath(s); } var pipeline = new ChrPipeline(File, convertFilePath(ChrOutput), String.IsNullOrWhiteSpace(PaletteOutput) ? null : convertFilePath(PaletteOutput)); var settings = new ProjectModel.Properties(); GetSettings(settings); pipeline.SetSettings(settings); return(pipeline); }
public virtual void GetSettings(ProjectModel.Properties headerSettings) { }