diff options
| author | Qudix <17361645+Qudix@users.noreply.github.com> | 2022-02-24 18:34:10 -0600 |
|---|---|---|
| committer | Qudix <17361645+Qudix@users.noreply.github.com> | 2022-02-24 18:34:10 -0600 |
| commit | 5b855f2e19071c542339090d8635ef9efff848ba (patch) | |
| tree | 914dee46eecd94d853cc33b32b4805d144520fd9 /src/pluginlist.cpp | |
| parent | e78f46cc9ec440a04e8421d150d114db2ca6810d (diff) | |
Add `isMasterFlagged` `isLight` `isLightFlagged`
Note: The behavior of isMaster has been changed to match isLightFlagged
Diffstat (limited to 'src/pluginlist.cpp')
| -rw-r--r-- | src/pluginlist.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 52434e89..80653595 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -933,6 +933,17 @@ bool PluginList::isMaster(const QString &name) const }
}
+bool PluginList::isMasterFlagged(const QString& name) const
+{
+ auto iter = m_ESPsByName.find(name);
+ if (iter == m_ESPsByName.end()) {
+ return false;
+ }
+ else {
+ return m_ESPs[iter->second].isMasterFlagged;
+ }
+}
+
bool PluginList::isLight(const QString &name) const
{
auto iter = m_ESPsByName.find(name);
@@ -1693,8 +1704,9 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, {
try {
ESP::File file(ToWString(fullPath));
- isMaster = file.isMaster();
auto extension = name.right(3).toLower();
+ isMaster = (extension == "esm");
+ isMasterFlagged = file.isMaster();
isLight = lightPluginsAreSupported && (extension == "esl");
isLightFlagged = lightPluginsAreSupported && file.isLight();
@@ -1707,6 +1719,7 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, } catch (const std::exception &e) {
log::error("failed to parse plugin file {}: {}", fullPath, e.what());
isMaster = false;
+ isMasterFlagged = false;
isLight = false;
isLightFlagged = false;
}
|
