update nuget packages

This commit is contained in:
2023-11-20 18:30:28 +01:00
parent b4c2459440
commit bf946021ad
3 changed files with 21 additions and 10 deletions

View File

@@ -22,6 +22,8 @@ namespace SM64RomManager.LangRes_Collector
var myAppDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var myConfigFilePath = Path.Combine(myAppDir, "FilterConfig.json");
var filterConfig = JObject.Parse(File.ReadAllText(myConfigFilePath)).ToObject<LangResFilterConfig>();
var allLoadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().Select(x => x.GetName()).ToArray();
var typeNameString = typeof(string).Name;
// Get root path
ofd.Title = "Root (repository) directory";
@@ -68,7 +70,10 @@ namespace SM64RomManager.LangRes_Collector
// Copy and prepair files
foreach (var resFileInput in resFiles)
{
var resReader = new ResXResourceReader(resFileInput);
var resReader = new ResXResourceReader(resFileInput)
{
UseResXDataNodes = true
};
var propsToCopy = new Dictionary<string, string>();
// Collect input properties
@@ -85,10 +90,16 @@ namespace SM64RomManager.LangRes_Collector
}
// Hold property to write later, if it's a string
if (useProp && kvp.Value is string val)
try
{
if (useProp && kvp.Value is ResXDataNode node && node.GetValue(allLoadedAssemblies) is string val)
{
if (!string.IsNullOrEmpty(val))
propsToCopy.Add(propName, val);
}
}
catch(FileNotFoundException)
{
if (!string.IsNullOrEmpty(val))
propsToCopy.Add(propName, (string)kvp.Value);
}
}