diff options
| author | Brian Munro <brian.alexander.munro@gmail.com> | 2018-01-13 11:27:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-13 11:27:09 +0200 |
| commit | 5d5a7b851168285dd1a67c5d681270d1e68ccd7b (patch) | |
| tree | 040f8ae58c2cd88c46b80ebe03f24d79bc81d03d | |
| parent | 0413bf27a5b973989a6ec2df0a35a11d1beb60c9 (diff) | |
| parent | d267b8aaf365b67da12e40297575f1c5bf119135 (diff) | |
Merge pull request #203 from erasmux/dev
Add warning when MO1 hook.dll is left in game folder
| -rw-r--r-- | src/organizercore.cpp | 42 | ||||
| -rw-r--r-- | src/organizercore.h | 5 | ||||
| -rw-r--r-- | src/plugincontainer.cpp | 1 |
3 files changed, 33 insertions, 15 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 3d2ed4ef..b84488da 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -33,6 +33,7 @@ #include <questionboxmemory.h>
#include "lockeddialog.h"
#include "instancemanager.h"
+#include <scriptextender.h>
#include <QApplication>
#include <QCoreApplication>
@@ -1945,11 +1946,28 @@ void OrganizerCore::syncOverwrite() }
}
+QString OrganizerCore::oldMO1HookDll() const
+{
+ if (auto extender = managedGame()->feature<ScriptExtender>()) {
+ QString hookdll = QDir::toNativeSeparators(
+ managedGame()->dataDirectory().absoluteFilePath(extender->PluginPath() + "/hook.dll"));
+ if (QFile(hookdll).exists())
+ return hookdll;
+ }
+ return QString();
+}
+
std::vector<unsigned int> OrganizerCore::activeProblems() const
{
std::vector<unsigned int> problems;
- if (m_PluginList.enabledCount() > 255) {
- problems.push_back(PROBLEM_TOOMANYPLUGINS);
+ const auto& hookdll = oldMO1HookDll();
+ if (!hookdll.isEmpty()) {
+ // This warning will now be shown every time the problems are checked, which is a bit
+ // of a "log spam". But since this is a sevre error which will most likely make the
+ // game crash/freeze/etc. and is very hard to diagnose, this "log spam" will make it
+ // easier for the user to notice the warning.
+ qWarning("hook.dll found in game folder: %s", qPrintable(hookdll));
+ problems.push_back(PROBLEM_MO1SCRIPTEXTENDERWORKAROUND);
}
return problems;
}
@@ -1957,8 +1975,8 @@ std::vector<unsigned int> OrganizerCore::activeProblems() const QString OrganizerCore::shortDescription(unsigned int key) const
{
switch (key) {
- case PROBLEM_TOOMANYPLUGINS: {
- return tr("Too many esps, esms, and esls enabled");
+ case PROBLEM_MO1SCRIPTEXTENDERWORKAROUND: {
+ return tr("MO1 \"Script Extender\" load mechanism has left hook.dll in your game folder");
} break;
default: {
return tr("Description missing");
@@ -1969,15 +1987,13 @@ QString OrganizerCore::shortDescription(unsigned int key) const QString OrganizerCore::fullDescription(unsigned int key) const
{
switch (key) {
- case PROBLEM_TOOMANYPLUGINS: {
- return tr("The game doesn't allow more than 255 active plugins "
- "(including the official ones) to be loaded. You have to "
- "disable some unused plugins or "
- "merge some plugins into one. You can find a guide here: <a "
- "href=\"http://wiki.step-project.com/"
- "Guide:Merging_Plugins\">http://wiki.step-project.com/"
- "Guide:Merging_Plugins</a>");
- } break;
+ case PROBLEM_MO1SCRIPTEXTENDERWORKAROUND: {
+ return tr("<a href=\"%1\">hook.dll</a> has been found in your game folder (right click to copy the full path). "
+ "This is most likely a leftover of setting the ModOrganizer 1 load mechanism to \"Script Extender\", "
+ "in which case you must remove this file either by changing the load mechanism in ModOrganizer 1 or "
+ "manually removing the file, otherwise the game is likely to crash and burn.").arg(oldMO1HookDll());
+ break;
+ }
default: {
return tr("Description missing");
} break;
diff --git a/src/organizercore.h b/src/organizercore.h index 8ef8baaa..9e81f0c3 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -266,6 +266,8 @@ private: bool createDirectory(const QString &path);
+ QString oldMO1HookDll() const;
+
/**
* @brief return a descriptor of the mappings real file->virtual file
*/
@@ -290,8 +292,7 @@ private slots: void loginFailed(const QString &message);
private:
-
- static const unsigned int PROBLEM_TOOMANYPLUGINS = 1;
+ static const unsigned int PROBLEM_MO1SCRIPTEXTENDERWORKAROUND = 1;
private:
diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index c4976d2c..c980c0a1 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -292,6 +292,7 @@ void PluginContainer::loadPlugins() // remove the load check file on success
loadCheck.remove();
+ bf::at_key<IPluginDiagnose>(m_Plugins).push_back(m_Organizer);
bf::at_key<IPluginDiagnose>(m_Plugins).push_back(this);
m_Organizer->connectPlugins(this);
|
