From 87ff9ecb0ca2fcfc8022ecec6cd67b14426c9549 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 22 Apr 2024 21:23:57 +0100 Subject: [PATCH] Migrate static container output into each locations sub folder --- Process/Writer/FileWriter.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Process/Writer/FileWriter.cs b/Process/Writer/FileWriter.cs index 9b3adb8..f667acb 100644 --- a/Process/Writer/FileWriter.cs +++ b/Process/Writer/FileWriter.cs @@ -59,8 +59,16 @@ public class FileWriter : IWriter break; case OutputFileType.StaticContainer: var staticContainer = (Dictionary)data; - File.WriteAllText($@"{_outputPath}\loot\staticContainers.json", - _jsonSerializer.Serialize(staticContainer)); + foreach (var (key, value) in staticContainer) + { + foreach (var s in LootDumpProcessorContext.GetDirectoryMappings()[key].Name) + { + if (!Directory.Exists($@"{_outputPath}\locations\{s}")) + Directory.CreateDirectory($@"{_outputPath}\locations\{s}"); + File.WriteAllText($@"{_outputPath}\locations\{s}\staticContainers.json", + _jsonSerializer.Serialize(value)); + } + } break; case OutputFileType.StaticLoot: