- 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>
<ApplicationIcon>Resources\ini.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Version>3.5.0.0</Version>
<Version>3.5.0.1</Version>
<PackageIcon>Resources\ini.ico</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<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);
writer.WriteLine("{");
writer.WriteLine(" \"$version\": 1,");
writer.WriteLine(" \"logging\": false,");
writer.WriteLine(" \"hook_steamclient\": true,");
writer.WriteLine(" \"unlock_all\": true,");
writer.WriteLine(" \"unlock_all\": " + (unlockAll ? "true" : "false") + ",");
writer.WriteLine(" \"override\": [],");
writer.WriteLine(" \"dlc_ids\": [");
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);
File.Create(config).Close();
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.Close();
});