Fix invalid condition for "limit to my creatures", a bit of additional logging

This commit is contained in:
RisaDev
2024-06-13 23:01:28 +03:00
parent 2fdf223683
commit 49b220ac2d
2 changed files with 8 additions and 5 deletions

View File

@@ -45,12 +45,13 @@ public class TemplateManager
public void LoadTemplates()
{
_logger.Information("Loading templates from directory...");
_logger.Information("Loading templates...");
_templates.Clear();
List<(Template, string)> invalidNames = new();
foreach (var file in _saveService.FileNames.Templates())
{
_logger.Debug($"Reading template {file.FullName}");
try
{
var text = File.ReadAllText(file.FullName);
@@ -77,7 +78,7 @@ public class TemplateManager
_logger.Information(
$"Moved {invalidNames.Count - failed} templates to correct names.{(failed > 0 ? $" Failed to move {failed} templates to correct names." : string.Empty)}");
_logger.Information("Directory load complete");
_logger.Information("Templates load complete");
_event.Invoke(TemplateChanged.Type.ReloadedAll, null, null);
}