diff options
| author | Jeremy Rimpo <jrim@rimpo.org> | 2018-03-05 00:13:09 -0600 |
|---|---|---|
| committer | Jeremy Rimpo <jrim@rimpo.org> | 2018-03-05 00:13:09 -0600 |
| commit | 3556d4f58f09b5d21b1179bbdf87e9bd78be7254 (patch) | |
| tree | 810fbe6696a01e8f997219fcccde3512c93ba7ec | |
| parent | 5fcd51aad81c9c4495a19306d13c4f55bd2519f8 (diff) | |
Light flagged master support and other minor changes
| -rw-r--r-- | src/instancemanager.cpp | 4 | ||||
| -rw-r--r-- | src/modinfo.h | 2 | ||||
| -rw-r--r-- | src/modinfoforeign.cpp | 6 | ||||
| -rw-r--r-- | src/pluginlist.cpp | 22 | ||||
| -rw-r--r-- | src/pluginlist.h | 2 |
5 files changed, 25 insertions, 11 deletions
diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index 29068c5b..d12ec119 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -133,7 +133,7 @@ QString InstanceManager::queryInstanceName(const QStringList &instanceList) cons QString instanceId; while (instanceId.isEmpty()) { QInputDialog dialog; - + dialog.setWindowTitle(QObject::tr("Enter a Name for the new Instance")); dialog.setLabelText(QObject::tr("Enter a new name or select one from the sugested list (only letters and numbers allowed):")); // would be neat if we could take the names from the game plugins but @@ -142,7 +142,7 @@ QString InstanceManager::queryInstanceName(const QStringList &instanceList) cons dialog.setComboBoxItems({ "NewName", "Fallout 4", "SkyrimSE", "Skyrim", "Fallout 3", "Fallout NV", "FO4VR", "Oblivion" }); dialog.setComboBoxEditable(true); - + if (dialog.exec() == QDialog::Rejected) { throw MOBase::MyException(QObject::tr("Canceled")); } diff --git a/src/modinfo.h b/src/modinfo.h index 0bdf6e43..d00c04e7 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -84,7 +84,7 @@ public: CONTENT_MCM
};
- static const int NUM_CONTENT_TYPES = CONTENT_SKYPROC + 1;
+ static const int NUM_CONTENT_TYPES = CONTENT_MCM + 1;
enum EHighlight {
HIGHLIGHT_NONE = 0,
diff --git a/src/modinfoforeign.cpp b/src/modinfoforeign.cpp index 0bde2c30..6ac66c67 100644 --- a/src/modinfoforeign.cpp +++ b/src/modinfoforeign.cpp @@ -57,12 +57,12 @@ ModInfoForeign::ModInfoForeign(const QString &modName, m_CreationTime = QFileInfo(referenceFile).created(); switch (modType) { case ModInfo::EModType::MOD_DLC: - m_Name = "DLC: " + modName; + m_Name = tr("DLC: ") + modName; break; case ModInfo::EModType::MOD_CC: - m_Name = "Creation Club: " + modName; + m_Name = tr("Creation Club: ") + modName; break; default: - m_Name = "Unmanaged: " + modName; + m_Name = tr("Unmanaged: ") + modName; } } diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 775086fd..8bf438f1 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -655,6 +655,16 @@ bool PluginList::isLight(const QString &name) const }
}
+bool PluginList::isLightFlagged(const QString &name) const
+{
+ auto iter = m_ESPsByName.find(name.toLower());
+ if (iter == m_ESPsByName.end()) {
+ return false;
+ } else {
+ return m_ESPs[iter->second].m_IsLightFlagged;
+ }
+}
+
QStringList PluginList::masters(const QString &name) const
{
auto iter = m_ESPsByName.find(name.toLower());
@@ -781,10 +791,10 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const for (auto sortedESP: sortESPs) {
if (sortedESP.m_LoadOrder == m_ESPs[index].m_LoadOrder)
break;
- if (sortedESP.m_IsLight && sortedESP.m_LoadOrder != -1)
+ if ((sortedESP.m_IsLight || sortedESP.m_IsLightFlagged) && sortedESP.m_LoadOrder != -1)
++numESLs;
}
- if (m_ESPs[index].m_IsLight) {
+ if (m_ESPs[index].m_IsLight || m_ESPs[index].m_IsLightFlagged) {
int ESLpos = 254 + ((numESLs+1) / 4096);
return QString("%1:%2").arg(ESLpos, 2, 16, QChar('0')).arg((numESLs)%4096).toUpper();
} else {
@@ -819,7 +829,7 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const if (m_ESPs[index].m_IsMaster) {
result.setItalic(true);
result.setWeight(QFont::Bold);
- } else if (m_ESPs[index].m_IsLight) {
+ } else if (m_ESPs[index].m_IsLight || m_ESPs[index].m_IsLightFlagged) {
result.setItalic(true);
}
return result;
@@ -1200,8 +1210,9 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, try {
ESP::File file(ToWString(fullPath));
m_IsMaster = file.isMaster();
- auto extension = name.right(3).toLower();
- m_IsLight = (extension == "esl"); // The .isLight() header is apparently meaningless.
+ auto extension = name.right(3).toLower();
+ m_IsLight = (extension == "esl");
+ m_IsLightFlagged = file.isLight();
m_Author = QString::fromLatin1(file.author().c_str());
m_Description = QString::fromLatin1(file.description().c_str());
@@ -1213,6 +1224,7 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, qCritical("failed to parse plugin file %s: %s", qPrintable(fullPath), e.what());
m_IsMaster = false;
m_IsLight = false;
+ m_IsLightFlagged = false;
}
}
diff --git a/src/pluginlist.h b/src/pluginlist.h index 8d1a5491..4762f79f 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -217,6 +217,7 @@ public: virtual bool onRefreshed(const std::function<void()> &callback);
virtual bool isMaster(const QString &name) const;
virtual bool isLight(const QString &name) const;
+ virtual bool isLightFlagged(const QString &name) const;
virtual QStringList masters(const QString &name) const;
virtual QString origin(const QString &name) const;
virtual void setLoadOrder(const QStringList &pluginList) override;
@@ -280,6 +281,7 @@ private: QString m_OriginName;
bool m_IsMaster;
bool m_IsLight;
+ bool m_IsLightFlagged;
bool m_ModSelected;
QString m_Author;
QString m_Description;
|
