From 4c64448947e624fa0a8e7025499cb889d272d232 Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Mon, 18 Jan 2021 07:55:02 -0700 Subject: Add a warning about overwrite mods being disabled --- src/profile.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/profile.cpp') diff --git a/src/profile.cpp b/src/profile.cpp index 3cc1a2a3..f8fc3eb9 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -382,6 +382,8 @@ void Profile::refreshModStatus() std::set namesRead; + bool warnAboutOverwrite = false; + // load mods from file and update enabled state and priority for them int index = 0; while (!file.atEnd()) { @@ -405,6 +407,9 @@ void Profile::refreshModStatus() } if (modName.size() > 0) { QString lookupName = modName; + if (modName.compare("overwrite", Qt::CaseInsensitive) == 0) { + warnAboutOverwrite = true; + } if (namesRead.find(lookupName) != namesRead.end()) { continue; } else { @@ -486,6 +491,19 @@ void Profile::refreshModStatus() file.close(); updateIndices(); + + // User has a mod named some variation of "overwrite". Tell them about it. + if (warnAboutOverwrite) { + QMessageBox::warning( + nullptr, + tr("Overwrite mod conflict"), + tr("At least one mod named \"overwrite\" was detected, disabled, and moved to the lowest priority on the mod list. " + "You may want to rename this mod and enable it again.") + ); + // also, mark the mod-list as changed + modStatusModified = true; + } + if (modStatusModified) { m_ModListWriter.write(); } -- cgit v1.3.1