diff --git a/CreamInstaller/CreamInstaller.csproj b/CreamInstaller/CreamInstaller.csproj
index f64b759..3878619 100644
--- a/CreamInstaller/CreamInstaller.csproj
+++ b/CreamInstaller/CreamInstaller.csproj
@@ -5,7 +5,7 @@
True
Resources\ini.ico
true
- 3.5.0.5
+ 3.5.1.0
Resources\ini.ico
LICENSE
2021, pointfeev (https://github.com/pointfeev)
diff --git a/CreamInstaller/Forms/InstallForm.cs b/CreamInstaller/Forms/InstallForm.cs
index 66a4ffe..865da8b 100644
--- a/CreamInstaller/Forms/InstallForm.cs
+++ b/CreamInstaller/Forms/InstallForm.cs
@@ -56,26 +56,39 @@ internal partial class InstallForm : CustomForm
}
}
- internal static void WriteSmokeConfiguration(StreamWriter writer, bool unlockAll, SortedList dlc, List<(string id, string name, SortedList dlc)> extraDlc, InstallForm installForm = null)
+ internal static void WriteSmokeConfiguration(StreamWriter writer, SortedList overrideDlc, SortedList allDlc, 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\": " + (unlockAll ? "true" : "false") + ",");
- writer.WriteLine(" \"override\": [],");
+ writer.WriteLine(" \"unlock_all\": true,");
+ if (overrideDlc.Count > 0)
+ {
+ writer.WriteLine(" \"override\": [");
+ KeyValuePair lastOverrideDlc = overrideDlc.Last();
+ foreach (KeyValuePair pair in overrideDlc)
+ {
+ Thread.Sleep(0);
+ string dlcId = pair.Key;
+ (_, string dlcName, _) = pair.Value;
+ writer.WriteLine($" {dlcId}{(pair.Equals(lastOverrideDlc) ? "" : ",")}");
+ if (installForm is not null)
+ installForm.UpdateUser($"Added override DLC to SmokeAPI.json with appid {dlcId} ({dlcName})", InstallationLog.Action, info: false);
+ }
+ writer.WriteLine(" ],");
+ }
+ else
+ writer.WriteLine(" \"override\": [],");
writer.WriteLine(" \"dlc_ids\": [");
- IEnumerable> dlcs = dlc.ToList();
- foreach ((string id, string name, SortedList _dlc) in extraDlc)
- dlcs = dlcs.Concat(_dlc);
- KeyValuePair lastDlc = dlcs.Last();
- foreach (KeyValuePair pair in dlcs)
+ KeyValuePair lastAllDlc = allDlc.Last();
+ foreach (KeyValuePair pair in allDlc)
{
Thread.Sleep(0);
string dlcId = pair.Key;
(_, string dlcName, _) = pair.Value;
- writer.WriteLine($" {dlcId}{(pair.Equals(lastDlc) ? "" : ",")}");
+ writer.WriteLine($" {dlcId}{(pair.Equals(lastAllDlc) ? "" : ",")}");
if (installForm is not null)
installForm.UpdateUser($"Added DLC to SmokeAPI.json with appid {dlcId} ({dlcName})", InstallationLog.Action, info: false);
}
@@ -151,7 +164,16 @@ 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.Count >= selection.AllDlc.Count, selection.SelectedDlc, selection.ExtraDlc, installForm);
+ IEnumerable> allDlc = selection.AllDlc.AsEnumerable();
+ foreach ((string id, string name, SortedList extraDlc) in selection.ExtraDlc)
+ allDlc = allDlc.Concat(extraDlc);
+ IEnumerable> overrideDlc = allDlc.Except(selection.SelectedDlc);
+ foreach ((string id, string name, SortedList extraDlc) in selection.ExtraSelectedDlc)
+ overrideDlc = overrideDlc.Except(extraDlc);
+ WriteSmokeConfiguration(writer,
+ new(overrideDlc.ToDictionary(pair => pair.Key, pair => pair.Value), AppIdComparer.Comparer),
+ new(allDlc.ToDictionary(pair => pair.Key, pair => pair.Value), AppIdComparer.Comparer),
+ installForm);
writer.Flush();
writer.Close();
});
@@ -287,7 +309,7 @@ internal partial class InstallForm : CustomForm
installForm.UpdateUser("Generating ScreamAPI configuration for " + selection.Name + $" in directory \"{directory}\" . . . ", InstallationLog.Operation);
File.Create(config).Close();
StreamWriter writer = new(config, true, Encoding.UTF8);
- WriteScreamConfiguration(writer, selection.SelectedDlc, selection.ExtraDlc, installForm);
+ WriteScreamConfiguration(writer, selection.SelectedDlc, selection.ExtraSelectedDlc, installForm);
writer.Flush();
writer.Close();
});
@@ -323,7 +345,7 @@ internal partial class InstallForm : CustomForm
{
Thread.Sleep(0);
if (selection.IsSteam && selection.SelectedDlc.Any(d => d.Value.type is DlcType.Steam)
- || selection.ExtraDlc.Any(item => item.dlc.Any(dlc => dlc.Value.type is DlcType.Steam)))
+ || selection.ExtraSelectedDlc.Any(item => item.dlc.Any(dlc => dlc.Value.type is DlcType.Steam)))
{
directory.GetSmokeApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
if (File.Exists(sdk32) || File.Exists(sdk32_o) || File.Exists(sdk64) || File.Exists(sdk64_o) || File.Exists(config))
@@ -337,7 +359,7 @@ internal partial class InstallForm : CustomForm
}
}
if (selection.IsEpic && selection.SelectedDlc.Any(d => d.Value.type is DlcType.EpicCatalogItem or DlcType.EpicEntitlement)
- || selection.ExtraDlc.Any(item => item.dlc.Any(dlc => dlc.Value.type is DlcType.EpicCatalogItem or DlcType.EpicEntitlement)))
+ || selection.ExtraSelectedDlc.Any(item => item.dlc.Any(dlc => dlc.Value.type is DlcType.EpicCatalogItem or DlcType.EpicEntitlement)))
{
directory.GetScreamApiComponents(out string sdk32, out string sdk32_o, out string sdk64, out string sdk64_o, out string config);
if (File.Exists(sdk32) || File.Exists(sdk32_o) || File.Exists(sdk64) || File.Exists(sdk64_o) || File.Exists(config))
diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs
index e0a5ce4..d005f3f 100644
--- a/CreamInstaller/Forms/SelectForm.cs
+++ b/CreamInstaller/Forms/SelectForm.cs
@@ -220,7 +220,7 @@ internal partial class SelectForm : CustomForm
}
ProgramSelection selection = ProgramSelection.FromId(appId) ?? new();
- selection.Enabled = allCheckBox.Checked || selection.SelectedDlc.Any() || selection.ExtraDlc.Any();
+ selection.Enabled = allCheckBox.Checked || selection.SelectedDlc.Any() || selection.ExtraSelectedDlc.Any();
selection.Id = appId;
selection.Name = appData?.name ?? name;
selection.RootDirectory = gameDirectory;
@@ -321,7 +321,7 @@ internal partial class SelectForm : CustomForm
}
ProgramSelection selection = ProgramSelection.FromId(@namespace) ?? new();
- selection.Enabled = allCheckBox.Checked || selection.SelectedDlc.Any() || selection.ExtraDlc.Any();
+ selection.Enabled = allCheckBox.Checked || selection.SelectedDlc.Any() || selection.ExtraSelectedDlc.Any();
selection.Id = @namespace;
selection.Name = name;
selection.RootDirectory = directory;
diff --git a/CreamInstaller/Paradox/ParadoxLauncher.cs b/CreamInstaller/Paradox/ParadoxLauncher.cs
index 38b93b6..865a395 100644
--- a/CreamInstaller/Paradox/ParadoxLauncher.cs
+++ b/CreamInstaller/Paradox/ParadoxLauncher.cs
@@ -29,11 +29,20 @@ internal static class ParadoxLauncher
if (paradoxLauncher is not null)
{
paradoxLauncher.ExtraDlc.Clear();
+ paradoxLauncher.ExtraSelectedDlc.Clear();
foreach (ProgramSelection selection in ProgramSelection.AllEnabled.Where(s => s != paradoxLauncher && s.Publisher == "Paradox Interactive"))
- paradoxLauncher.ExtraDlc.Add(new(selection.Id, selection.Name, selection.SelectedDlc));
+ {
+ paradoxLauncher.ExtraDlc.Add(new(selection.Id, selection.Name, selection.AllDlc));
+ paradoxLauncher.ExtraSelectedDlc.Add(new(selection.Id, selection.Name, selection.SelectedDlc));
+ }
if (!paradoxLauncher.ExtraDlc.Any())
+ {
foreach (ProgramSelection selection in ProgramSelection.AllSafe.Where(s => s != paradoxLauncher && s.Publisher == "Paradox Interactive"))
+ {
paradoxLauncher.ExtraDlc.Add(new(selection.Id, selection.Name, selection.AllDlc));
+ paradoxLauncher.ExtraSelectedDlc.Add(new(selection.Id, selection.Name, selection.AllDlc));
+ }
+ }
}
}
diff --git a/CreamInstaller/ProgramSelection.cs b/CreamInstaller/ProgramSelection.cs
index 93890ec..6c9cb09 100644
--- a/CreamInstaller/ProgramSelection.cs
+++ b/CreamInstaller/ProgramSelection.cs
@@ -34,7 +34,9 @@ internal class ProgramSelection
internal readonly SortedList AllDlc = new(AppIdComparer.Comparer);
internal readonly SortedList SelectedDlc = new(AppIdComparer.Comparer);
- internal readonly List<(string id, string name, SortedList dlc)> ExtraDlc = new(); // for Paradox Launcher
+
+ internal readonly List<(string id, string name, SortedList dlc)> ExtraDlc = new(); // for Paradox Launcher
+ internal readonly List<(string id, string name, SortedList dlc)> ExtraSelectedDlc = new(); // for Paradox Launcher
internal bool AreDllsLocked
{
@@ -79,7 +81,7 @@ internal class ProgramSelection
break;
}
}
- Enabled = SelectedDlc.Any() || ExtraDlc.Any();
+ Enabled = SelectedDlc.Any() || ExtraSelectedDlc.Any();
}
internal ProgramSelection() => All.Add(this);