diff options
| author | TanninOne <seppleviathan@gmx.de> | 2015-12-06 13:24:19 +0100 |
|---|---|---|
| committer | TanninOne <seppleviathan@gmx.de> | 2015-12-06 13:24:19 +0100 |
| commit | e31cf3f2fd99073d22fdddfdb106a59858e14299 (patch) | |
| tree | de7bbfd6de6afe830f8ec1a624876cf174aab376 /src/loadmechanism.cpp | |
| parent | 688e149c96c29d8249c9db416f5773cfc7baad6d (diff) | |
| parent | 3670ab2528ff6a129af4e4aeaf50574e2c9080ba (diff) | |
Merge pull request #372 from ThosRTanner/issue/356
Refactor gameinfo & 'shared' library to use game plugins (9 of 17)
Diffstat (limited to 'src/loadmechanism.cpp')
| -rw-r--r-- | src/loadmechanism.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/loadmechanism.cpp b/src/loadmechanism.cpp index 4d06bea9..99fce3ba 100644 --- a/src/loadmechanism.cpp +++ b/src/loadmechanism.cpp @@ -64,7 +64,8 @@ void LoadMechanism::removeHintFile(QDir &targetDirectory) bool LoadMechanism::isDirectLoadingSupported()
{
- IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ //FIXME: Seriously? isn't there a 'do i need steam' thing?
+ IPluginGame const *game = qApp->property("managed_game").value<IPluginGame const *>();
if (game->gameName().compare("oblivion", Qt::CaseInsensitive) == 0) {
// oblivion can be loaded directly if it's not the steam variant
return !game->gameDirectory().exists("steam_api.dll");
@@ -76,13 +77,11 @@ bool LoadMechanism::isDirectLoadingSupported() bool LoadMechanism::isScriptExtenderSupported()
{
- IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ IPluginGame const *game = qApp->property("managed_game").value<IPluginGame const *>();
ScriptExtender *extender = game->feature<ScriptExtender>();
// test if there even is an extender for the managed game and if so whether it's installed
- return (extender != nullptr)
- && (game->gameDirectory().exists(extender->name() + "_loader.exe")
- || game->gameDirectory().exists(extender->name() + "_steam_loader.dll"));
+ return extender != nullptr && extender->isInstalled();
}
bool LoadMechanism::isProxyDLLSupported()
@@ -92,7 +91,7 @@ bool LoadMechanism::isProxyDLLSupported() // plus: the proxy dll hasn't been working for at least the whole 1.12.x versions of MO and
// noone reported it so why maintain an unused feature?
return false;
-/* IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+/* IPluginGame const *game = qApp->property("managed_game").value<IPluginGame const *>();
return game->gameDirectory().exists(QString::fromStdWString(AppConfig::proxyDLLTarget()));*/
}
@@ -124,7 +123,7 @@ bool LoadMechanism::hashIdentical(const QString &fileNameLHS, const QString &fil void LoadMechanism::deactivateScriptExtender()
{
try {
- IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ IPluginGame const *game = qApp->property("managed_game").value<IPluginGame const *>();
ScriptExtender *extender = game->feature<ScriptExtender>();
if (extender == nullptr) {
throw MyException(QObject::tr("game doesn't support a script extender"));
@@ -150,7 +149,7 @@ void LoadMechanism::deactivateScriptExtender() void LoadMechanism::deactivateProxyDLL()
{
try {
- IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ IPluginGame const *game = qApp->property("managed_game").value<IPluginGame const *>();
QString targetPath = game->gameDirectory().absoluteFilePath(QString::fromStdWString(AppConfig::proxyDLLTarget()));
@@ -179,7 +178,7 @@ void LoadMechanism::deactivateProxyDLL() void LoadMechanism::activateScriptExtender()
{
try {
- IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ IPluginGame const *game = qApp->property("managed_game").value<IPluginGame const *>();
ScriptExtender *extender = game->feature<ScriptExtender>();
if (extender == nullptr) {
throw MyException(QObject::tr("game doesn't support a script extender"));
@@ -219,7 +218,7 @@ void LoadMechanism::activateScriptExtender() void LoadMechanism::activateProxyDLL()
{
try {
- IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ IPluginGame const *game = qApp->property("managed_game").value<IPluginGame const *>();
QString targetPath = game->gameDirectory().absoluteFilePath(QString::fromStdWString(AppConfig::proxyDLLTarget()));
|
