diff options
| author | Tannin <devnull@localhost> | 2013-10-16 23:04:03 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-10-16 23:04:03 +0200 |
| commit | b47c89661e603336abd98d5ecd0a82f6743cab18 (patch) | |
| tree | 00f0bed2c72835ef4019831526d1a16ff0d9fd5d /src/pluginlist.cpp | |
| parent | 0b84cc3d45e15d2edec6a083b5139e6d7528b53d (diff) | |
- plugin (esp/esm) list is now exposed to plugins (read-only functionality right now)
- integrated fomod installer now supports file dependencies
- bugfix: integrated fomod installer crashed if the installer had no optiosn´´ns
Diffstat (limited to 'src/pluginlist.cpp')
| -rw-r--r-- | src/pluginlist.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 55f8a39e..74aa6ff3 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -571,6 +571,46 @@ void PluginList::refreshLoadOrder() } } +IPluginList::PluginState PluginList::state(const QString &name) const +{ + auto iter = m_ESPsByName.find(name.toLower()); + if (iter == m_ESPsByName.end()) { + return IPluginList::STATE_MISSING; + } else { + return m_ESPs[iter->second].m_Enabled ? IPluginList::STATE_ACTIVE : IPluginList::STATE_INACTIVE; + } +} + +int PluginList::priority(const QString &name) const +{ + auto iter = m_ESPsByName.find(name.toLower()); + if (iter == m_ESPsByName.end()) { + return -1; + } else { + return m_ESPs[iter->second].m_Priority; + } +} + +int PluginList::loadOrder(const QString &name) const +{ + auto iter = m_ESPsByName.find(name.toLower()); + if (iter == m_ESPsByName.end()) { + return -1; + } else { + return m_ESPs[iter->second].m_LoadOrder; + } +} + +bool PluginList::isMaster(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_IsMaster; + } +} + void PluginList::updateIndices() { |
