Getting somewhere

This commit is contained in:
Lani Aung
2021-10-10 17:15:45 -06:00
parent e09f00945b
commit 738b3c6d35
19 changed files with 594 additions and 88 deletions
+6 -3
View File
@@ -23,7 +23,9 @@ namespace fxl.codes.kisekae.Services
public PlaysetModel ReadCnf(IFormFile file)
{
_logger.LogTrace($"Reading filename {file.FileName}");
return ParseStream(file.OpenReadStream());
var set = ParseStream(file.OpenReadStream());
set.Name = file.FileName;
return set;
}
public PlaysetModel ParseStream(Stream fileStream, string directory = null)
@@ -65,8 +67,6 @@ namespace fxl.codes.kisekae.Services
}
SetInitialPositions(model, initialPositions.ToString());
if (model.Palettes.Any() && model.Palettes[0].Colors.Any()) model.BorderColor = model.Palettes[0].Colors[borderColorIndex];
if (string.IsNullOrEmpty(directory)) return model;
foreach (var palette in model.Palettes)
@@ -78,6 +78,9 @@ namespace fxl.codes.kisekae.Services
{
_fileParser.ParseCel(directory, cel, model.Palettes);
}
if (model.Palettes.Any() && model.Palettes[0].Colors.Any()) model.BorderColor = model.Palettes[0].Colors[borderColorIndex];
model.Cels.Reverse();
return model;
}