diff options
| -rw-r--r-- | readme.md | 6 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 94 | ||||
| -rw-r--r-- | src/modinfodialog.ui | 4 | ||||
| -rw-r--r-- | src/shared/appconfig.inc | 2 |
4 files changed, 42 insertions, 64 deletions
@@ -1,5 +1,3 @@ -[](https://ci.appveyor.com/project/ModOrganizer2/modorganizer-736bd)
-
# Mod Organizer
Mod Organizer (MO) is a tool for managing mod collections of arbitrary size. It is specifically designed for people who like to experiment with mods and thus need an easy and reliable way to install and uninstall them.
@@ -20,14 +18,14 @@ If you want to submit your code changes, please use a good formatting style like Through the work of a few people of the community MO2 has come quite far, now it needs some more of those people to go further.
## Reporting Issues:
-Issues should be reported to the GitHub page or on the open discord server: [Mod Organizer 2](https://discord.gg/ewUVAqyrQX). Here is also where dev builds are tested, bugs are reported and investigated, suggestions are discussed and a lot more.
+Issues should be reported to the GitHub page or on the open Discord server: [Mod Organizer 2](https://discord.gg/ewUVAqyrQX). Here is also where dev builds are tested, bugs are reported and investigated, suggestions are discussed and a lot more.
Credits to Tannin, LePresidente, Silarn, erasmux, AL12, LostDragonist, AnyOldName3, isa, Holt59, Project579, przester, Qudix, RJ, Jonathan Feenstra and many others for the development.
## Download Location
* on [GitHub.com](https://github.com/Modorganizer2/modorganizer/releases)
-* on [NexusMods.com](https://www.nexusmods.com/skyrimspecialedition/mods/6194)
+* on [NexusMods.com](https://www.nexusmods.com/site/mods/6)
## Old Download Location
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f61f5944..0a4fba2e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2993,41 +2993,28 @@ void MainWindow::on_actionExit_triggered() void MainWindow::actionEndorseMO() { - // Normally this would be the managed game but MO2 is only uploaded to the Skyrim SE - // site right now - IPluginGame* game = m_OrganizerCore.getGame("skyrimse"); - if (!game) - return; - - if (QMessageBox::question( - this, tr("Endorse Mod Organizer"), - tr("Do you want to endorse Mod Organizer on %1 now?") - .arg(NexusInterface::instance().getGameURL(game->gameShortName())), - QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + if (QMessageBox::question(this, tr("Endorse Mod Organizer"), + tr("Do you want to endorse Mod Organizer on Nexus now?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { NexusInterface::instance().requestToggleEndorsement( - game->gameShortName(), game->nexusModOrganizerID(), - m_OrganizerCore.getVersion().string(), true, this, QVariant(), QString()); + QString::fromStdWString(AppConfig::mo2NexusGameId()), + AppConfig::mo2NexusModId(), m_OrganizerCore.getVersion().string(), true, this, + QVariant(), QString()); } } void MainWindow::actionWontEndorseMO() { - // Normally this would be the managed game but MO2 is only uploaded to the Skyrim SE - // site right now - IPluginGame* game = m_OrganizerCore.getGame("skyrimse"); - if (!game) - return; - if (QMessageBox::question( this, tr("Abstain from Endorsing Mod Organizer"), tr("Are you sure you want to abstain from endorsing Mod Organizer 2?\n" - "You will have to visit the mod page on the %1 Nexus site to change your " - "mind.") - .arg(NexusInterface::instance().getGameURL(game->gameShortName())), + "You will have to visit the mod page on the Nexus Tools site to change " + "your mind."), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { NexusInterface::instance().requestToggleEndorsement( - game->gameShortName(), game->nexusModOrganizerID(), - m_OrganizerCore.getVersion().string(), false, this, QVariant(), QString()); + QString::fromStdWString(AppConfig::mo2NexusGameId()), + AppConfig::mo2NexusModId(), m_OrganizerCore.getVersion().string(), false, this, + QVariant(), QString()); } } @@ -3092,7 +3079,6 @@ void MainWindow::nxmEndorsementsAvailable(QVariant userData, QVariant resultData std::multimap<QString, std::pair<int, QString>> sorted; QStringList games = m_OrganizerCore.managedGame()->validShortNames(); games += m_OrganizerCore.managedGame()->gameShortName(); - bool searchedMO2NexusGame = false; for (auto endorsementData : data) { QVariantMap endorsement = endorsementData.toMap(); std::pair<int, QString> data = std::make_pair<int, QString>( @@ -3102,10 +3088,7 @@ void MainWindow::nxmEndorsementsAvailable(QVariant userData, QVariant resultData } for (auto game : games) { IPluginGame* gamePlugin = m_OrganizerCore.getGame(game); - if (gamePlugin != nullptr && - gamePlugin->gameShortName().compare("SkyrimSE", Qt::CaseInsensitive) == 0) - searchedMO2NexusGame = true; - auto iter = sorted.equal_range(gamePlugin->gameNexusName()); + auto iter = sorted.equal_range(gamePlugin->gameNexusName()); for (auto result = iter.first; result != iter.second; ++result) { std::vector<ModInfo::Ptr> modsList = ModInfo::getByModID(result->first, result->second.first); @@ -3120,31 +3103,18 @@ void MainWindow::nxmEndorsementsAvailable(QVariant userData, QVariant resultData mod->setIsEndorsed(false); } } - - if (Settings::instance().nexus().endorsementIntegration()) { - if (result->first == "skyrimspecialedition" && - result->second.first == gamePlugin->nexusModOrganizerID()) { - m_OrganizerCore.settings().nexus().setEndorsementState( - endorsementStateFromString(result->second.second)); - - toggleMO2EndorseState(); - } - } } } + if (Settings::instance().nexus().endorsementIntegration()) { + auto iter = + sorted.equal_range(QString::fromStdWString(AppConfig::mo2NexusGameId())); + for (auto result = iter.first; result != iter.second; ++result) { + if (result->second.first == AppConfig::mo2NexusModId()) { + m_OrganizerCore.settings().nexus().setEndorsementState( + endorsementStateFromString(result->second.second)); - if (!searchedMO2NexusGame && Settings::instance().nexus().endorsementIntegration()) { - auto gamePlugin = m_OrganizerCore.getGame("SkyrimSE"); - if (gamePlugin) { - auto iter = sorted.equal_range(gamePlugin->gameNexusName()); - for (auto result = iter.first; result != iter.second; ++result) { - if (result->second.first == gamePlugin->nexusModOrganizerID()) { - m_OrganizerCore.settings().nexus().setEndorsementState( - endorsementStateFromString(result->second.second)); - - toggleMO2EndorseState(); - break; - } + toggleMO2EndorseState(); + break; } } } @@ -3607,9 +3577,8 @@ void MainWindow::nxmRequestFailed(QString gameName, int modID, int, QVariant, in int errorCode, const QString& errorString) { if (errorCode == QNetworkReply::ContentAccessDenied || - errorCode == QNetworkReply::ContentNotFoundError) { - log::debug("{}", - tr("Mod ID %1 no longer seems to be available on Nexus.").arg(modID)); + errorCode == QNetworkReply::ContentNotFoundError || + errorCode == QNetworkReply::ServiceUnavailableError) { // update last checked timestamp on orphaned mods as well to avoid repeating // requests @@ -3620,10 +3589,19 @@ void MainWindow::nxmRequestFailed(QString gameName, int modID, int, QVariant, in break; } } - auto orphanedMods = ModInfo::getByModID(gameNameReal, modID); - for (auto mod : orphanedMods) { - mod->setLastNexusUpdate(QDateTime::currentDateTimeUtc()); - mod->setLastNexusQuery(QDateTime::currentDateTimeUtc()); + if (gameName == QString::fromStdWString(AppConfig::mo2NexusGameId()) && + modID == AppConfig::mo2NexusModId()) { + log::info("{}", tr("This action appears to be blocked. If you're trying to " + "endorse MO2, please download it from Nexus first.")); + } else { + log::debug("{}", + tr("Mod ID %1 no longer seems to be available on Nexus.").arg(modID)); + auto orphanedMods = ModInfo::getByModID(gameNameReal, modID); + for (auto mod : orphanedMods) { + mod->setLastNexusUpdate(QDateTime::currentDateTimeUtc()); + mod->setLastNexusQuery(QDateTime::currentDateTimeUtc()); + mod->setNexusID(-1); + } } } else { MessageDialog::showMessage( diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index f52101c0..55d6e34b 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -984,7 +984,7 @@ text-align: left;</string> <html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mod ID for this mod on Nexus. This is filled in automatically if you downloaded and installed the mod from inside MO. Otherwise you can enter it manually. To find the correct id, find the mod on nexus. The URL will look like this: <a href=" https://www.nexusmods.com/skyrimspecialedition/mods/6194"><span style=" text-decoration: underline; color:#0000ff;">https://www.nexusmods.com/skyrimspecialedition/mods/6194</span></a>. In this example, 6194 is the id you're looking for. Besides: The above is the link to Mod Organizer 2 on Nexus. Why not go there now and endorse us?</p></body></html></string>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mod ID for this mod on Nexus. This is filled in automatically if you downloaded and installed the mod from inside MO. Otherwise you can enter it manually. To find the correct ID, find the mod on Nexus. The URL will look like this: <a href=" https://www.nexusmods.com/site/mods/6"><span style=" text-decoration: underline; color:#0000ff;">https://www.nexusmods.com/site/mods/6</span></a>. In this example, 6 is the id you're looking for. Besides: The above is the link to Mod Organizer 2 on Nexus. Why not go there now and endorse us?</p></body></html></string>
</property>
</widget>
</item>
@@ -1012,7 +1012,7 @@ p, li { white-space: pre-wrap; } <html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Installed Version of the Mod. The tooltip will contain the current version available on nexus. The installed version is only set if you installed the mod through MO.</span></p></body></html></string>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Installed Version of the Mod. The tooltip will contain the current version available on Nexus. The installed version is only set if you installed the mod through MO.</span></p></body></html></string>
</property>
<property name="text">
<string>Version</string>
diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc index b3946774..2ac8f7a2 100644 --- a/src/shared/appconfig.inc +++ b/src/shared/appconfig.inc @@ -20,6 +20,8 @@ APPPARAM(std::wstring, vfs32DLLName, L"usvfs_x86.dll") APPPARAM(std::wstring, vfs64DLLName, L"usvfs_x64.dll")
APPPARAM(std::wstring, nxmHandlerExe, L"nxmhandler.exe")
APPPARAM(std::wstring, nxmHandlerIni, L"downloadhandler.ini")
+APPPARAM(std::wstring, mo2NexusGameId, L"site")
+APPPARAM(int, mo2NexusModId, 6)
APPPARAM(std::wstring, portableLockFileName, L"portable.txt")
APPPARAM(const wchar_t*, localSavePlaceholder, L"__MOProfileSave__\\")
|
