Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Jul 18, 2024
1 parent 1bc652f commit 95edd93
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions JL.Core/Dicts/DictUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static class DictUtils
public static readonly Dictionary<string, Dict> BuiltInDicts = new(7, StringComparer.OrdinalIgnoreCase)
{
{
"Custom Word Dictionary (Profile)", new Dict(DictType.ProfileCustomWordDictionary,
nameof(DictType.ProfileCustomWordDictionary), new Dict(DictType.ProfileCustomWordDictionary,
"Custom Word Dictionary (Profile)",
Path.Join(ProfileUtils.ProfileFolderPath, "Default_Custom_Words.txt"),
true, -1, 128, false,
Expand All @@ -52,7 +52,7 @@ public static class DictUtils
new NewlineBetweenDefinitionsOption(true)))
},
{
"Custom Name Dictionary (Profile)", new Dict(DictType.ProfileCustomNameDictionary,
nameof(DictType.ProfileCustomNameDictionary), new Dict(DictType.ProfileCustomNameDictionary,
"Custom Name Dictionary (Profile)",
Path.Join(ProfileUtils.ProfileFolderPath, "Default_Custom_Names.txt"),
true, 0, 128, false,
Expand All @@ -61,7 +61,7 @@ public static class DictUtils
new NoAllOption(false)))
},
{
"Custom Word Dictionary", new Dict(DictType.CustomWordDictionary,
nameof(DictType.CustomWordDictionary), new Dict(DictType.CustomWordDictionary,
"Custom Word Dictionary",
Path.Join(Utils.ResourcesPath, "custom_words.txt"),
true, 1, 128, false,
Expand All @@ -71,7 +71,7 @@ public static class DictUtils
new NewlineBetweenDefinitionsOption(true)))
},
{
"Custom Name Dictionary", new Dict(DictType.CustomNameDictionary,
nameof(DictType.CustomNameDictionary), new Dict(DictType.CustomNameDictionary,
"Custom Name Dictionary",
Path.Join(Utils.ResourcesPath, "custom_names.txt"),
true, 2, 128, false,
Expand Down Expand Up @@ -1441,11 +1441,11 @@ internal static async Task DeserializeDicts()

if (deserializedDicts is not null)
{
foreach ((string key, Dict dict) in BuiltInDicts)
foreach (Dict dict in BuiltInDicts.Values)
{
if (deserializedDicts.Values.All(d => d.Type != dict.Type))
{
deserializedDicts.Add(key, dict);
deserializedDicts.Add(dict.Name, dict);
}
}

Expand Down Expand Up @@ -1533,7 +1533,7 @@ private static void InitDictOptions(Dict dict)
}
else if (dict.Type is DictType.CustomWordDictionary or DictType.ProfileCustomWordDictionary)
{
DictOptions builtInCustomWordOptions = BuiltInDicts["Custom Word Dictionary"].Options;
DictOptions builtInCustomWordOptions = BuiltInDicts[nameof(DictType.CustomWordDictionary)].Options;
dict.Options.NewlineBetweenDefinitions ??= builtInCustomWordOptions.NewlineBetweenDefinitions;
}
else
Expand Down

0 comments on commit 95edd93

Please sign in to comment.