mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix ExtraIni setter issues
This commit is contained in:
@@ -79,6 +79,31 @@ namespace SabreTools.DatFiles
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populate the setters using a set of field names
|
||||
/// </summary>
|
||||
/// <param name="mappings">Dictionary of mappings</param>
|
||||
public void PopulateSettersFromDictionary(Dictionary<(string, string), string>? mappings)
|
||||
{
|
||||
// If the dictionary is null or empty, just return
|
||||
if (mappings == null || mappings.Count == 0)
|
||||
return;
|
||||
|
||||
var watch = new InternalStopwatch("Populating setters from dictionary");
|
||||
|
||||
// Now we loop through and get values for everything
|
||||
foreach (var mapping in mappings)
|
||||
{
|
||||
string field = $"{mapping.Key.Item1}.{mapping.Key.Item2}";
|
||||
string value = mapping.Value;
|
||||
|
||||
if (!SetSetter(field, value))
|
||||
logger.Warning($"The value {value} did not match any known field names. Please check the wiki for more details on supported field names.");
|
||||
}
|
||||
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set remover from a value
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user