diff --git a/source-code/source/plugins/Launcher/ConfigOption.h b/source-code/source/plugins/Launcher/ConfigOption.h index 8555aef..6a6d828 100644 --- a/source-code/source/plugins/Launcher/ConfigOption.h +++ b/source-code/source/plugins/Launcher/ConfigOption.h @@ -1087,9 +1087,10 @@ class PluginOption : public ConfigOptionBase { public: bool _defaultVal; + std::wstring _builddate; std::vector _configopts; - PluginOption(LPCWSTR iniVarName, LPCWSTR iniSectionName, LPCWSTR iniFilePath, LPCWSTR friendlyName, LPCWSTR description, bool defaultVal, std::vector configopts) + PluginOption(LPCWSTR iniVarName, LPCWSTR iniSectionName, LPCWSTR iniFilePath, LPCWSTR friendlyName, LPCWSTR description, bool defaultVal, std::vector configopts, std::wstring builddate = L"Unknown") { _iniVarName = iniVarName; _iniSectionName = iniSectionName; @@ -1098,6 +1099,7 @@ public: _description = description; _defaultVal = defaultVal; _configopts = configopts; + _builddate = builddate; } virtual int AddToPanel(Panel^ panel, unsigned int left, unsigned int top, ToolTip^ tooltip) diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index 94c8b3b..f4674d0 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -474,7 +474,7 @@ std::vector GetPluginOptions(std::vector* plugins) for (PluginInfo &pi : *plugins) { - PluginOption* opt = new PluginOption(pi.filename.c_str(), L"plugins", CONFIG_FILE, pi.name.c_str(), pi.description.c_str(), true, pi.configopts); + PluginOption* opt = new PluginOption(pi.filename.c_str(), L"plugins", CONFIG_FILE, pi.name.c_str(), pi.description.c_str(), true, pi.configopts, pi.builddate); outvec.push_back(opt); } diff --git a/source-code/source/plugins/Launcher/ui.h b/source-code/source/plugins/Launcher/ui.h index 9e16741..9150d16 100644 --- a/source-code/source/plugins/Launcher/ui.h +++ b/source-code/source/plugins/Launcher/ui.h @@ -1112,8 +1112,9 @@ private: System::Boolean hasInvalidSettings() bool divaGLEnabled = false; bool novidiaEnabled = false; bool shaderPatchEnabled = false; + bool divaImGuiOldEnabled = false; - for (ConfigOptionBase* option : AllPluginOpts) + for (PluginOption* option : AllPluginOpts) { if (lstrcmpW(option->_friendlyName, L"DivaGL") == 0) { @@ -1121,8 +1122,8 @@ private: System::Boolean hasInvalidSettings() if (divaGLEnabled) { if (hasInvalidGLUT) goto divagl_freeglut; - else if (novidiaEnabled) goto divagl_novidia; - else if (shaderPatchEnabled) goto divagl_shaderpatch; + else if (novidiaEnabled || shaderPatchEnabled) goto divagl_novidia; + else if (divaImGuiOldEnabled) goto divagl_divaimguiold; } } else if (lstrcmpW(option->_friendlyName, L"Novidia") == 0) @@ -1133,7 +1134,12 @@ private: System::Boolean hasInvalidSettings() else if (lstrcmpW(option->_friendlyName, L"ShaderPatch") == 0) { shaderPatchEnabled = ((CheckBox^)CheckBox::FromHandle(option->mainControlHandle))->Checked; - if (shaderPatchEnabled && divaGLEnabled) goto divagl_shaderpatch; + if (shaderPatchEnabled && divaGLEnabled) goto divagl_novidia; + } + else if (lstrcmpW(option->_friendlyName, L"DivaImGui") == 0 && option->_builddate == L"Unknown") + { + divaImGuiOldEnabled = ((CheckBox^)CheckBox::FromHandle(option->mainControlHandle))->Checked; + if (divaImGuiOldEnabled && divaGLEnabled) goto divagl_divaimguiold; } } @@ -1144,9 +1150,12 @@ divagl_freeglut: return true; divagl_novidia: -divagl_shaderpatch: SkinnedMessageBox::Show(this, "Plugins: Novidia and ShaderPatch must be disabled if DivaGL is enabled.", "PD Launcher", MessageBoxButtons::OK, MessageBoxIcon::Error); return true; + +divagl_divaimguiold: + SkinnedMessageBox::Show(this, "Plugins: Your version of DivaImGui is too old for DivaGL; please either update or disable it.", "PD Launcher", MessageBoxButtons::OK, MessageBoxIcon::Error); + return true; } private: System::Void Button_Launch_Click(System::Object^ sender, System::EventArgs^ e) { diff --git a/source-code/source/plugins/Novidia/src/dllmain.cpp b/source-code/source/plugins/Novidia/src/dllmain.cpp index 582c85b..5a60b7b 100644 --- a/source-code/source/plugins/Novidia/src/dllmain.cpp +++ b/source-code/source/plugins/Novidia/src/dllmain.cpp @@ -380,12 +380,6 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv if (ul_reason_for_call == DLL_PROCESS_ATTACH) { - if (hasConflicts()) - { - // detected an incompatible plugin (i.e. DivaGL) - return TRUE; - } - loadConfig(); if (!disable_amd_check) diff --git a/source-code/source/plugins/Novidia/src/framework.h b/source-code/source/plugins/Novidia/src/framework.h index 14fde8f..8d764fa 100644 --- a/source-code/source/plugins/Novidia/src/framework.h +++ b/source-code/source/plugins/Novidia/src/framework.h @@ -152,21 +152,3 @@ void InjectCode(void* address, const std::vector data) // delete[] hModules; // return false; //} - -bool hasConflicts() -{ - puts("[Novidia] Checking for conflicts..."); - - if(GetModuleHandleW(L"DivaGL.dva") != NULL) - { - // detected DivaGL - puts("[Novidia] Detected DivaGL! Quitting!"); -#ifdef _DEBUG - MessageBoxExW(NULL, L"Detected DivaGL! Quitting!\n", L"Novidia", MB_OK, 0); -#endif - return true; - } - - puts("[Novidia] No conflicts found."); - return false; -} diff --git a/source-code/source/plugins/ShaderPatch/src/dllmain.cpp b/source-code/source/plugins/ShaderPatch/src/dllmain.cpp index ea2b4f0..24ab6a6 100644 --- a/source-code/source/plugins/ShaderPatch/src/dllmain.cpp +++ b/source-code/source/plugins/ShaderPatch/src/dllmain.cpp @@ -294,12 +294,6 @@ BOOL APIENTRY DllMain(HMODULE hModule, { if (ul_reason_for_call == DLL_PROCESS_ATTACH) { - if (hasConflicts()) - { - // detected an incompatible plugin (i.e. DivaGL) - return TRUE; - } - // install a thunk to hook InjectCode((void*)0x1405e5991, { 0x48, 0x83, 0xec, 0x28 }); // SUB RSP, 0x28 InjectCode((void*)0x1405e5995, { 0xe8, 0x56, 0xe8, 0xb9, 0xff }); // CALL 0x1401841f0 diff --git a/source-code/source/plugins/ShaderPatch/src/framework.h b/source-code/source/plugins/ShaderPatch/src/framework.h index e5c3f74..8e38d50 100644 --- a/source-code/source/plugins/ShaderPatch/src/framework.h +++ b/source-code/source/plugins/ShaderPatch/src/framework.h @@ -161,22 +161,3 @@ LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str(); // delete[] hModules; // return false; //} - - -bool hasConflicts() -{ - puts("[ShaderPatch] Checking for conflicts..."); - - if (GetModuleHandleW(L"DivaGL.dva") != NULL) - { - // detected DivaGL - puts("[ShaderPatch] Detected DivaGL! Quitting!"); -#ifdef _DEBUG - MessageBoxExW(NULL, L"Detected DivaGL! Quitting!\n", L"ShaderPatch", MB_OK, 0); -#endif - return true; - } - - puts("[ShaderPatch] No conflicts found."); - return false; -}