From c35e7ef086d1e6456e186cb79b6e5b2cda52bbc9 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Fri, 11 Oct 2019 06:51:56 +1100 Subject: [PATCH] launcher: add no_gpu_dialog option --- source-code/data/plugins/config.ini | 2 ++ source-code/source/plugins/Launcher/framework.h | 4 +++- source-code/source/plugins/Launcher/ui.h | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source-code/data/plugins/config.ini b/source-code/data/plugins/config.ini index b5386bd..9ba0f58 100644 --- a/source-code/data/plugins/config.ini +++ b/source-code/data/plugins/config.ini @@ -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 diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index 086ba0d..3fba0d3 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -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 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), }; diff --git a/source-code/source/plugins/Launcher/ui.h b/source-code/source/plugins/Launcher/ui.h index 904a6cf..e5356f1 100644 --- a/source-code/source/plugins/Launcher/ui.h +++ b/source-code/source/plugins/Launcher/ui.h @@ -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: