- SmokeAPI's unlock_all option will now be ticked false if not every single DLC is selected
This commit is contained in:
pointfeev 2022-05-16 04:47:08 -05:00
parent 1237b431c9
commit af99db0844
2 changed files with 4 additions and 4 deletions

View file

@ -5,7 +5,7 @@
<UseWindowsForms>True</UseWindowsForms> <UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Resources\ini.ico</ApplicationIcon> <ApplicationIcon>Resources\ini.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract> <IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Version>3.5.0.0</Version> <Version>3.5.0.1</Version>
<PackageIcon>Resources\ini.ico</PackageIcon> <PackageIcon>Resources\ini.ico</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile> <PackageLicenseFile>LICENSE</PackageLicenseFile>
<Copyright>2021, pointfeev (https://github.com/pointfeev)</Copyright> <Copyright>2021, pointfeev (https://github.com/pointfeev)</Copyright>

View file

@ -56,14 +56,14 @@ internal partial class InstallForm : CustomForm
} }
} }
internal static void WriteSmokeConfiguration(StreamWriter writer, SortedList<string, (DlcType type, string name, string icon)> dlc, List<(string id, string name, SortedList<string, (DlcType type, string name, string icon)> dlc)> extraDlc, InstallForm installForm = null) internal static void WriteSmokeConfiguration(StreamWriter writer, bool unlockAll, SortedList<string, (DlcType type, string name, string icon)> dlc, List<(string id, string name, SortedList<string, (DlcType type, string name, string icon)> dlc)> extraDlc, InstallForm installForm = null)
{ {
Thread.Sleep(0); Thread.Sleep(0);
writer.WriteLine("{"); writer.WriteLine("{");
writer.WriteLine(" \"$version\": 1,"); writer.WriteLine(" \"$version\": 1,");
writer.WriteLine(" \"logging\": false,"); writer.WriteLine(" \"logging\": false,");
writer.WriteLine(" \"hook_steamclient\": true,"); writer.WriteLine(" \"hook_steamclient\": true,");
writer.WriteLine(" \"unlock_all\": true,"); writer.WriteLine(" \"unlock_all\": " + (unlockAll ? "true" : "false") + ",");
writer.WriteLine(" \"override\": [],"); writer.WriteLine(" \"override\": [],");
writer.WriteLine(" \"dlc_ids\": ["); writer.WriteLine(" \"dlc_ids\": [");
IEnumerable<KeyValuePair<string, (DlcType type, string name, string icon)>> dlcs = dlc.ToList(); IEnumerable<KeyValuePair<string, (DlcType type, string name, string icon)>> dlcs = dlc.ToList();
@ -151,7 +151,7 @@ internal partial class InstallForm : CustomForm
installForm.UpdateUser("Generating SmokeAPI configuration for " + selection.Name + $" in directory \"{directory}\" . . . ", InstallationLog.Operation); installForm.UpdateUser("Generating SmokeAPI configuration for " + selection.Name + $" in directory \"{directory}\" . . . ", InstallationLog.Operation);
File.Create(config).Close(); File.Create(config).Close();
StreamWriter writer = new(config, true, Encoding.UTF8); StreamWriter writer = new(config, true, Encoding.UTF8);
WriteSmokeConfiguration(writer, selection.SelectedDlc, selection.ExtraDlc, installForm); WriteSmokeConfiguration(writer, selection.SelectedDlc.Count >= selection.AllDlc.Count, selection.SelectedDlc, selection.ExtraDlc, installForm);
writer.Flush(); writer.Flush();
writer.Close(); writer.Close();
}); });