Фикс логики основной формы

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-03-01 17:18:30 +07:00
parent e633408665
commit 9b7ee59707

View File

@@ -19,10 +19,7 @@ namespace SaveWizard_rewritten
public static extern int DecryptAndDecodeFile(string InputFile, string OutputFile);
private Dictionary<TextBox, WindowText> items = null;
private string opened_file_path, selected_game;
private Dictionary<string, string> dlc = null;
private Dictionary<string, bool> owns = null;
public MainForm()
@@ -98,17 +95,16 @@ namespace SaveWizard_rewritten
string config_path = $"configs/{selected_game}/dlc.json";
if (File.Exists(config_path))
{
dlc = JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(config_path));
Dictionary<string, string> dlc = JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(config_path));
owns = new Dictionary<string, bool>
{
{ "base", true }
};
List<string> companies = RegexHandler.GetArrayItems(RegexHandler.SearchLine("companies:"));
foreach (var company in companies)
foreach (var item in dlc)
foreach (string company in companies)
foreach (KeyValuePair<string, string> item in dlc)
if (company.Contains(item.Value))
owns[item.Key] = true;
owns = null;
}
else
MessageBox.Show($"'dlc.json' from '{selected_game}' have errors or not found, functionality has been limited", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -124,7 +120,6 @@ namespace SaveWizard_rewritten
opened_file_path = null;
RegexHandler.FillLines(null);
selected_game = null;
dlc = null;
owns = null;
foreach (KeyValuePair<TextBox, WindowText> item in items)
{