Paradox Launcher warning
This commit is contained in:
parent
4c04b7e40c
commit
7399655a9a
1 changed files with 38 additions and 14 deletions
|
@ -344,6 +344,42 @@ namespace CreamInstaller
|
||||||
OnLoad();
|
OnLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool ParadoxLauncherDlcDialog(Form form)
|
||||||
|
{
|
||||||
|
ProgramSelection paradoxLauncher = ProgramSelection.FromIdentifier("Paradox Launcher");
|
||||||
|
if (!(paradoxLauncher is null) && paradoxLauncher.Enabled)
|
||||||
|
{
|
||||||
|
paradoxLauncher.ExtraSteamAppIdDlc = new();
|
||||||
|
foreach (ProgramSelection selection in ProgramSelection.AllSafeEnabled)
|
||||||
|
{
|
||||||
|
if (selection.Identifier == paradoxLauncher.Identifier) continue;
|
||||||
|
if (!selection.AppInfo.TryGetValue("publisher", out string publisher) || publisher != "Paradox Interactive") continue;
|
||||||
|
paradoxLauncher.ExtraSteamAppIdDlc.Add(new(selection.SteamAppId, selection.DisplayName, selection.SelectedSteamDlc));
|
||||||
|
}
|
||||||
|
if (!paradoxLauncher.ExtraSteamAppIdDlc.Any())
|
||||||
|
{
|
||||||
|
foreach (ProgramSelection selection in ProgramSelection.AllSafe)
|
||||||
|
{
|
||||||
|
if (selection.Identifier == paradoxLauncher.Identifier) continue;
|
||||||
|
if (!selection.AppInfo.TryGetValue("publisher", out string publisher) || publisher != "Paradox Interactive") continue;
|
||||||
|
paradoxLauncher.ExtraSteamAppIdDlc.Add(new(selection.SteamAppId, selection.DisplayName, selection.AllSteamDlc));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!paradoxLauncher.ExtraSteamAppIdDlc.Any())
|
||||||
|
{
|
||||||
|
if (new DialogForm(form).Show(Program.ApplicationName, SystemIcons.Warning,
|
||||||
|
$"WARNING: There are no installed games with DLC that can be added to the Paradox Launcher!" +
|
||||||
|
"\n\nInstalling CreamAPI for the Paradox Launcher is pointless, since no DLC will be added to the configuration!",
|
||||||
|
"Ignore", "Cancel") == DialogResult.OK)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnAccept(object sender, EventArgs e)
|
private void OnAccept(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (ProgramSelection.All.Count > 0)
|
if (ProgramSelection.All.Count > 0)
|
||||||
|
@ -355,21 +391,9 @@ namespace CreamInstaller
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ParadoxLauncherDlcDialog(this)) return;
|
||||||
ProgramSelection paradoxLauncher = ProgramSelection.FromIdentifier("Paradox Launcher");
|
|
||||||
if (!(paradoxLauncher is null))
|
|
||||||
{
|
|
||||||
paradoxLauncher.ExtraSteamAppIdDlc = new();
|
|
||||||
foreach (ProgramSelection selection in ProgramSelection.AllSafeEnabled)
|
|
||||||
{
|
|
||||||
if (selection.Identifier == paradoxLauncher.Identifier) continue;
|
|
||||||
if (!selection.AppInfo.TryGetValue("publisher", out string publisher) || publisher != "Paradox Interactive") continue;
|
|
||||||
paradoxLauncher.ExtraSteamAppIdDlc.Add(new(selection.SteamAppId, selection.DisplayName, selection.SelectedSteamDlc));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Hide();
|
Hide();
|
||||||
InstallForm installForm = new InstallForm(this);
|
InstallForm installForm = new(this);
|
||||||
installForm.ShowDialog();
|
installForm.ShowDialog();
|
||||||
if (installForm.Reselecting)
|
if (installForm.Reselecting)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue