launcher: add no_gpu_dialog option

This commit is contained in:
somewhatlurker
2019-10-11 06:51:56 +11:00
parent b6c29b7819
commit 8496dce848
3 changed files with 13 additions and 2 deletions
+2
View File
@@ -9,6 +9,8 @@ Enable=1
[Launcher]
# Forces the launcher to be skipped, you can use the --launch parameter instead of this.
Skip=0
# Disables unsupported GPU warning dialogs.
No_GPU_Dialog=0
[Patches]
#Enable or disable mouse cursor
@@ -57,7 +57,8 @@ LPCWSTR COMPONENTS_SECTION = L"components";
LPCWSTR PLAYERDATA_SECTION = L"playerdata";
LPCWSTR KEYCONFIG_SECTION = L"keyconfig";
int nSkipLauncher = GetPrivateProfileIntW(L"launcher", L"skip", FALSE, CONFIG_FILE);
int nSkipLauncher = GetPrivateProfileIntW(LAUNCHER_SECTION, L"skip", FALSE, CONFIG_FILE);
int nNoGPUDialog = GetPrivateProfileIntW(LAUNCHER_SECTION, L"no_gpu_diaog", FALSE, CONFIG_FILE);
std::vector<DEVMODEW> getScreenModes() {
@@ -186,6 +187,7 @@ ConfigOptionBase* optionsArray[] = {
new NumericOption(L"xinput_preferred", KEYCONFIG_SECTION, KEYCONFIG_FILE, L"XInput Controller Num:", L"Sets the preferred XInput controller.\nIf unavailable, the next connected controller is used.", 0, 0, 3),
new OptionMetaSpacer(8),
new BooleanOption(L"no_gpu_diaog", LAUNCHER_SECTION, CONFIG_FILE, L"Disable GPU Warning", L"Disables the warning dialog for unsupported GPUs.", L"", false),
new StringOption(L"command_line", LAUNCHER_SECTION, CONFIG_FILE, L"Command Line:", L"Allows setting command line parameters for the game when using the launcher.\nDisabling the launcher will bypass this.", L"", false),
};
+8 -1
View File
@@ -166,12 +166,13 @@ namespace Launcher {
this->labelGPU->Text += "OpenGL: " + version + "\n";
int linkStart = this->labelGPU->Text->Length;
bool showGpuDialog = false;
if (!vendor->Contains("NVIDIA")) // check OpenGL renderer to get actual GPU being used for vendor check (ensure not running on iGPU)
{
this->labelGPU->Text += "Issues: NVIDIA GPU REQUIRED!";
GPUIssueText = "Your graphics card is not supported! Only NVIDIA GPUs can run the game.\nPlease use a GTX 600 series or later GPU.\n\nIf you have a laptop with an NVIDIA GPU, you may need to set diva.exe to use it in NVIDIA Control Panel.";
this->labelGPU->LinkColor = System::Drawing::Color::Red;
SkinnedMessageBox::Show(this, GPUIssueText, "PD Launcher", MessageBoxButtons::OK, MessageBoxIcon::Warning);
showGpuDialog = true;
}
else if (gpuModel->StartsWith("TU"))
{
@@ -198,6 +199,7 @@ namespace Launcher {
this->labelGPU->Text += "Issues: Driver too old.";
GPUIssueText = "Your GPU should be able to run the game, but it looks like your OpenGL version is too old.\nA driver update should fix this.";
this->labelGPU->LinkColor = System::Drawing::Color::Orange;
showGpuDialog = true;
}
else
{
@@ -217,17 +219,22 @@ namespace Launcher {
this->labelGPU->Text += "Issues: GPU too old! 3D rendering might be broken.\n(Click for more information)";
GPUIssueText = "Your GPU is very old and does not support rendering techniques used by the game.\nYou may be able to play, but graphics will likely have major issues.\nPlease upgrade to a GTX 600 series or later GPU.";
this->labelGPU->LinkColor = System::Drawing::Color::Orange;
showGpuDialog = true;
}
else //if (gpuModel->Length == 0 || gpuModel->StartsWith("Unk") || gpuModel->StartsWith("Oth"))
{
this->labelGPU->Text += "Issues: Unable to detect GPU architecture.\n(Click for more information)";
GPUIssueText = "It looks like you have an NVIDIA GPU, but something went wrong while trying to determine your GPU's architecture (type).\nThis may be a caused by a bug, but it probably indicates potential issues.\nPlease make sure you have a GTX 600 series or later GPU. (GTX 400 series or later should also work)";
this->labelGPU->LinkColor = System::Drawing::Color::Orange;
showGpuDialog = true;
}
int linkEnd = this->labelGPU->Text->Length - linkStart;
this->labelGPU->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &ui::LinkLabelLinkClickedGPUIssueHandler);
this->labelGPU->LinkArea = System::Windows::Forms::LinkArea(linkStart, linkEnd);
if (showGpuDialog && !nNoGPUDialog)
SkinnedMessageBox::Show(this, GPUIssueText + "\n\nYou can disable this message from the options tab.", "PD Launcher", MessageBoxButtons::OK, MessageBoxIcon::Warning);
}
protected: