From 692898fe461a178383ea2b803dcb985f552f629f Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 7 Nov 2021 10:17:03 -0800 Subject: [PATCH] Set metadata for sav on certain paths Closes #3282 --- PKHeX.Core/Editing/Program/StartupArguments.cs | 7 +++++++ PKHeX.Core/Saves/Util/SaveUtil.cs | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Editing/Program/StartupArguments.cs b/PKHeX.Core/Editing/Program/StartupArguments.cs index 8365d65c0..8cd555c95 100644 --- a/PKHeX.Core/Editing/Program/StartupArguments.cs +++ b/PKHeX.Core/Editing/Program/StartupArguments.cs @@ -27,11 +27,18 @@ namespace PKHeX.Core { var other = FileUtil.GetSupportedFile(path, SAV); if (other is SaveFile s) + { + s.Metadata.SetExtraInfo(path); SAV = s; + } else if (other is PKM pkm) + { Entity = pkm; + } else if (other is not null) + { Extra.Add(other); + } } } diff --git a/PKHeX.Core/Saves/Util/SaveUtil.cs b/PKHeX.Core/Saves/Util/SaveUtil.cs index 61dd148c7..de56bb5de 100644 --- a/PKHeX.Core/Saves/Util/SaveUtil.cs +++ b/PKHeX.Core/Saves/Util/SaveUtil.cs @@ -545,7 +545,10 @@ namespace PKHeX.Core if (sav == null) continue; - sav.Metadata.SetExtraInfo(split.Header, split.Footer); + var meta = sav.Metadata; + meta.SetExtraInfo(split.Header, split.Footer); + if (path is not null) + meta.SetExtraInfo(path); return sav; } #endif