Update and move DivaGL plugin conflict checks to launcher
This commit is contained in:
@@ -1087,9 +1087,10 @@ class PluginOption : public ConfigOptionBase
|
||||
{
|
||||
public:
|
||||
bool _defaultVal;
|
||||
std::wstring _builddate;
|
||||
std::vector<ConfigOptionBase*> _configopts;
|
||||
|
||||
PluginOption(LPCWSTR iniVarName, LPCWSTR iniSectionName, LPCWSTR iniFilePath, LPCWSTR friendlyName, LPCWSTR description, bool defaultVal, std::vector<ConfigOptionBase*> configopts)
|
||||
PluginOption(LPCWSTR iniVarName, LPCWSTR iniSectionName, LPCWSTR iniFilePath, LPCWSTR friendlyName, LPCWSTR description, bool defaultVal, std::vector<ConfigOptionBase*> 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)
|
||||
|
||||
@@ -474,7 +474,7 @@ std::vector<PluginOption*> GetPluginOptions(std::vector<PluginInfo>* 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user