diff options
| author | Al12rs <gabriel.cortesi@outlook.com> | 2018-07-17 14:37:50 +0200 |
|---|---|---|
| committer | Al12rs <gabriel.cortesi@outlook.com> | 2018-07-17 14:37:50 +0200 |
| commit | 35bbe0001efa9aac48c56503643b98ec03c080e7 (patch) | |
| tree | 2f9cd065f4368a7893680fa22c9ed5be10d4e7f6 | |
| parent | 75478f68a12c89af790ba2aae127d4834c6d44a5 (diff) | |
Added a flag to the plugin list indicating if a certain plugin has one or more archives attached.
Changed the tooltip to list the loaded archives.
Fixed tool tip to have titles for subsections.
| -rw-r--r-- | src/pluginlist.cpp | 26 | ||||
| -rw-r--r-- | src/pluginlist.h | 3 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index a6ae8fa7..9153df72 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -181,9 +181,17 @@ void PluginList::refresh(const QString &profileName try {
FilesOrigin &origin = baseDirectory.getOriginByID(current->getOrigin(archive));
+
QString iniPath = QFileInfo(filename).baseName() + ".ini";
bool hasIni = baseDirectory.findFile(ToWString(iniPath)).get() != nullptr;
+ std::set<QString> loadedArchives;
+ QString originPath = QString::fromWCharArray(origin.getPath().c_str());
+ QDir dir(QDir::toNativeSeparators(originPath));
+ for (QString filename : dir.entryList(QStringList() << QFileInfo(filename).baseName() + "*.bsa" << QFileInfo(filename).baseName() + "*.ba2")) {
+ loadedArchives.insert(filename);
+ }
+
QString originName = ToQString(origin.getName());
unsigned int modIndex = ModInfo::getIndex(originName);
if (modIndex != UINT_MAX) {
@@ -191,7 +199,7 @@ void PluginList::refresh(const QString &profileName originName = modInfo->name();
}
- m_ESPs.push_back(ESPInfo(filename, forceEnabled, originName, ToQString(current->getFullPath()), hasIni));
+ m_ESPs.push_back(ESPInfo(filename, forceEnabled, originName, ToQString(current->getFullPath()), hasIni, loadedArchives));
m_ESPs.rbegin()->m_Priority = -1;
} catch (const std::exception &e) {
reportError(tr("failed to update esp info for file %1 (source id: %2), error: %3").arg(filename).arg(current->getOrigin(archive)).arg(e.what()));
@@ -888,8 +896,15 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const if (!enabledMasters.empty()) {
text += "<br><b>" + tr("Enabled Masters") + "</b>: " + SetJoin(enabledMasters, ", ");
}
+ if (!m_ESPs[index].m_Archives.empty()) {
+ text += "<br><b>" + tr("Loads Archives") + "</b>: " + SetJoin(m_ESPs[index].m_Archives, ", ");
+ text += "<br>" + tr("There are Archives connected to this plugin. "
+ "Their assets will be added to your game, overwriting in case of conflicts following the plugin order. "
+ "Loose files will always overwrite assets from Archives.");
+ }
if (m_ESPs[index].m_HasIni) {
- text += "<br>" + tr("There is an ini file connected to this esp. "
+ text += "<br><b>" + tr("Loads INI settings") + "</b>: ";
+ text += "<br>" + tr("There is an ini file connected to this plugin. "
"Its settings will be added to your game settings, overwriting in case of conflicts.");
}
if (m_ESPs[index].m_IsLightFlagged && !m_ESPs[index].m_IsLight) {
@@ -917,6 +932,9 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const if (m_ESPs[index].m_HasIni) {
result.append(":/MO/gui/attachment");
}
+ if (!m_ESPs[index].m_Archives.empty()) {
+ result.append(":/MO/gui/archive_conflict_neutral");
+ }
if (m_ESPs[index].m_IsLightFlagged && !m_ESPs[index].m_IsLight) {
result.append(":/MO/gui/awaiting");
}
@@ -1228,9 +1246,9 @@ bool PluginList::eventFilter(QObject *obj, QEvent *event) PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled,
const QString &originName, const QString &fullPath,
- bool hasIni)
+ bool hasIni, std::set<QString> archives)
: m_Name(name), m_FullPath(fullPath), m_Enabled(enabled), m_ForceEnabled(enabled),
- m_Priority(0), m_LoadOrder(-1), m_OriginName(originName), m_HasIni(hasIni), m_ModSelected(false)
+ m_Priority(0), m_LoadOrder(-1), m_OriginName(originName), m_HasIni(hasIni), m_Archives(archives), m_ModSelected(false)
{
try {
ESP::File file(ToWString(fullPath));
diff --git a/src/pluginlist.h b/src/pluginlist.h index f6745aa8..583c7272 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -277,7 +277,7 @@ private: struct ESPInfo {
- ESPInfo(const QString &name, bool enabled, const QString &originName, const QString &fullPath, bool hasIni);
+ ESPInfo(const QString &name, bool enabled, const QString &originName, const QString &fullPath, bool hasIni, std::set<QString> archives);
QString m_Name;
QString m_FullPath;
bool m_Enabled;
@@ -294,6 +294,7 @@ private: QString m_Author;
QString m_Description;
bool m_HasIni;
+ std::set<QString> m_Archives;
std::set<QString> m_Masters;
mutable std::set<QString> m_MasterUnset;
bool operator < (const ESPInfo& str) const
|
