This commit is contained in:
pointfeev 2021-11-30 12:24:06 -05:00
parent 10bf901fd4
commit 9f29bfbe59
No known key found for this signature in database
GPG key ID: AA14DC36C4D7D13C
3 changed files with 8 additions and 4 deletions

View file

@ -34,7 +34,11 @@ namespace CreamInstaller
} }
} }
private void Toggle(KeyValuePair<int, string> dlcApp, bool enabled) => SelectedSteamDlc[dlcApp.Key] = enabled ? dlcApp.Value : null; private void Toggle(KeyValuePair<int, string> dlcApp, bool enabled)
{
if (enabled) SelectedSteamDlc[dlcApp.Key] = dlcApp.Value;
else SelectedSteamDlc.Remove(dlcApp.Key);
}
public void ToggleDlc(int dlcAppId, bool enabled) public void ToggleDlc(int dlcAppId, bool enabled)
{ {
@ -66,7 +70,7 @@ namespace CreamInstaller
public static ProgramSelection FromAppId(int appId) => AllSafe.Find(s => s.SteamAppId == appId); public static ProgramSelection FromAppId(int appId) => AllSafe.Find(s => s.SteamAppId == appId);
public static KeyValuePair<int, string>? GetAllSteamDlc(int appId) public static KeyValuePair<int, string>? GetDlcFromAppId(int appId)
{ {
foreach (ProgramSelection selection in AllSafe) foreach (ProgramSelection selection in AllSafe)
foreach (KeyValuePair<int, string> app in selection.AllSteamDlc) foreach (KeyValuePair<int, string> app in selection.AllSteamDlc)

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>2.0.3.3</Version> <Version>2.0.4.0</Version>
<PackageIcon>Resources\ini.ico</PackageIcon> <PackageIcon>Resources\ini.ico</PackageIcon>
<PackageIconUrl /> <PackageIconUrl />
<Description>Automatically generates and installs CreamAPI files for Steam games on the user's computer. It can also generate and install CreamAPI for the Paradox Launcher should the user select a Paradox Interactive game.</Description> <Description>Automatically generates and installs CreamAPI files for Steam games on the user's computer. It can also generate and install CreamAPI for the Paradox Launcher should the user select a Paradox Interactive game.</Description>

View file

@ -378,7 +378,7 @@ namespace CreamInstaller
if (e.Button == MouseButtons.Right) if (e.Button == MouseButtons.Right)
{ {
ProgramSelection selection = ProgramSelection.FromAppId(int.Parse(e.Node.Name)); ProgramSelection selection = ProgramSelection.FromAppId(int.Parse(e.Node.Name));
KeyValuePair<int, string>? dlc = ProgramSelection.GetAllSteamDlc(int.Parse(e.Node.Name)); KeyValuePair<int, string>? dlc = ProgramSelection.GetDlcFromAppId(int.Parse(e.Node.Name));
int appId = selection?.SteamAppId ?? dlc?.Key ?? 0; int appId = selection?.SteamAppId ?? dlc?.Key ?? 0;
if (appId > 0) Process.Start(new ProcessStartInfo if (appId > 0) Process.Start(new ProcessStartInfo
{ {